Skip to content
Snippets Groups Projects
Commit 30687037 authored by Andy Yates's avatar Andy Yates
Browse files

Adding better strand support (strands in bed are +/- not 1/-1) and not adding...

Adding better strand support (strands in bed are +/- not 1/-1) and not adding a value if one was not defined
parent 90f6df20
No related branches found
No related tags found
No related merge requests found
......@@ -129,20 +129,21 @@ sub _store {
sub line_to_SimpleFeature {
my ($line, $analysis, $dba) = @_;
my ($chr, $start, $end, $label, $score, $strand) = split(/\t/, $line);
my ($chr, $start, $end, $label, $score, $ucsc_strand) = split(/\t/, $line);
$start++; # UCSC is 0 idx start
$score ||= 0;
$strand ||= 1;
#if was defined & -ve then set as so. +ve is default
my $strand = (defined $ucsc_strand && $strand eq '-') ? -1 : 1;
my $slice = get_Slice($chr, $dba);
my $sf = Bio::EnsEMBL::SimpleFeature->new(
-start => $start,
-end => $end,
-score => $score,
-analysis => $analysis,
-slice => $slice,
-strand => $strand,
-display_label => $label,
my %args = (
-start => $start,
-end => $end,
-analysis => $analysis,
-slice => $slice,
-strand => $strand,
-display_label => $label,
);
$args{-SCORE} = $score if defined $score; # only add score if it was there
my $sf = Bio::EnsEMBL::SimpleFeature->new(%args);
return $sf;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment