Skip to content

Commit 7778cca

Browse files
committed
Remove some print commands
1 parent b38dd21 commit 7778cca

File tree

2 files changed

+43
-45
lines changed

2 files changed

+43
-45
lines changed

src/perl5/Bio/JBrowse/Cmd/IndexNames.pm

-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use Storable ();
1818
use File::Path ();
1919
use File::Temp ();
2020
use List::Util ();
21-
use Data::Dumper;
2221
use Encode qw(decode encode);
2322

2423
use GenomeDB ();
@@ -80,7 +79,6 @@ sub run {
8079
unless( @$refSeqs ) {
8180
die "No reference sequences defined in configuration, nothing to do.\n";
8281
}
83-
print Dumper($gdb->trackList);
8482
my @tracks = grep $self->track_is_included( $_->{label} ),
8583
@{ $gdb->trackList || [] };
8684
unless( @tracks ) {
@@ -367,7 +365,6 @@ sub find_names_files {
367365
# read either names.txt or names.json files
368366
my $name_records_iterator;
369367
my $names_txt = File::Spec->catfile( $dir, 'names.txt' );
370-
print "$names_txt\n";
371368
if( -e decode('UTF-8',$names_txt) ) {
372369
push @files, $self->make_file_record( $track, $names_txt );
373370
}

src/perl5/Bio/JBrowse/FeatureStream/Genbank.pm

+43-42
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use strict;
1010
use warnings;
1111

1212
use base 'Bio::JBrowse::FeatureStream';
13-
use Data::Dumper;
1413

1514
use Bio::JBrowse::FeatureStream::Genbank::LocationParser;
1615

@@ -32,12 +31,11 @@ sub _aggregate_features_from_gbk_record {
3231
# get index of top level feature ('mRNA' at current writing)
3332
my $indexTopLevel;
3433
my $count = 0;
35-
print Dumper $record;
3634
foreach my $feat ( @{$record->{FEATURES}} ){
37-
if ( _isTopLevel( $feat ) ){
38-
$indexTopLevel = $count;
39-
}
40-
$count++;
35+
if ( _isTopLevel( $feat ) ){
36+
$indexTopLevel = $count;
37+
}
38+
$count++;
4139
}
4240

4341
return unless defined $indexTopLevel;
@@ -56,52 +54,55 @@ sub _aggregate_features_from_gbk_record {
5654
delete $f->{SEQUENCE};
5755

5856
$f->{end} = $locations[-1]{end};
59-
$f->{type} = $record->{FEATURES}[$indexTopLevel]{name};
60-
$f->{seq_id} ||= $seq_id;
61-
62-
%$f = ( %{$record->{FEATURES}[$indexTopLevel]{feature} || {}}, %$f ); # get other attrs
63-
if( $f->{type} eq 'gene' ) {
64-
print "here2\n";
65-
$f->{name} = $record->{FEATURES}[$indexTopLevel]{feature}{gene};
66-
$f->{description} = $record->{FEATURES}[$indexTopLevel]{feature}{product} || $f->{FEATURES}[$indexTopLevel]{feature}{note};
67-
}
57+
#for my $f ( @features ) {
58+
$f->{start} += $offset + 1;
59+
$f->{end} += $offset;
60+
$f->{strand} = 1 unless defined $f->{strand};
61+
$f->{type} = $record->{FEATURES}[$indexTopLevel]{name};
62+
$f->{seq_id} ||= $seq_id;
63+
64+
%$f = ( %{$record->{FEATURES}[$indexTopLevel]{feature} || {}}, %$f ); # get other attrs
65+
if( $f->{type} eq 'mRNA' ) {
66+
$f->{name} = $record->{FEATURES}[$indexTopLevel]{feature}{gene};
67+
$f->{description} = $record->{FEATURES}[$indexTopLevel]{feature}{product} || $f->{FEATURES}[$indexTopLevel]{feature}{note};
68+
}
6869

69-
# convert FEATURES to subfeatures
70-
$f->{subfeatures} = [];
71-
if ( scalar( @{$record->{FEATURES} || [] }) > $indexTopLevel ) {
72-
for my $i ( $indexTopLevel + 1 .. $#{$record->{FEATURES}} ) {
73-
my $feature = $record->{FEATURES}[$i];
74-
my @sublocations = _parseLocation( $feature->{location} );
75-
for my $subloc ( @sublocations ) {
76-
$subloc->{start} += $offset + 1;
77-
$subloc->{end} += $offset;
78-
79-
my $newFeature = {
80-
%{ $feature->{feature}||{} },
81-
%$subloc,
82-
type => $feature->{name}
83-
};
84-
85-
$newFeature->{seq_id} ||= $seq_id;
86-
87-
push @{$f->{subfeatures}}, $newFeature;
70+
# convert FEATURES to subfeatures
71+
$f->{subfeatures} = [];
72+
if ( scalar( @{$record->{FEATURES} || [] }) > $indexTopLevel ) {
73+
for my $i ( $indexTopLevel + 1 .. $#{$record->{FEATURES}} ) {
74+
my $feature = $record->{FEATURES}[$i];
75+
my @sublocations = _parseLocation( $feature->{location} );
76+
for my $subloc ( @sublocations ) {
77+
$subloc->{start} += $offset + 1;
78+
$subloc->{end} += $offset;
79+
80+
my $newFeature = {
81+
%{ $feature->{feature}||{} },
82+
%$subloc,
83+
type => $feature->{name}
84+
};
85+
86+
$newFeature->{seq_id} ||= $seq_id;
87+
88+
push @{$f->{subfeatures}}, $newFeature;
89+
}
8890
}
8991
}
90-
}
92+
# }
9193

9294
return $f;
9395
}
9496

9597
sub _isTopLevel {
9698
my $feat = shift;
97-
my @topLevelFeatures = qw( gene ); # add more as needed?
99+
my @topLevelFeatures = qw( mRNA ); # add more as needed?
98100
my $isTopLevel = 0;
99101
foreach my $thisTopFeat ( @topLevelFeatures ){
100-
if ( $feat->{'name'} =~ m/$thisTopFeat/ ){
101-
print "here\n";
102-
$isTopLevel = 1;
103-
last;
104-
}
102+
if ( $feat->{'name'} =~ m/$thisTopFeat/ ){
103+
$isTopLevel = 1;
104+
last;
105+
}
105106
}
106107
return $isTopLevel;
107108
}
@@ -114,7 +115,7 @@ sub _getRegionOffset {
114115

115116
my $f = shift;
116117
my $offset = 0;
117-
if ( grep {$_ =~ /REGION\:/} @{$f->{'VERSION'}} ){ # this is a region file
118+
if ( grep {$_ =~ /REGION\:/} @{$f->{'VERSION'}} ){ # this is a region file
118119
# get array item after REGION token
119120
my $count = 0;
120121
my $regionIndexInArray;

0 commit comments

Comments
 (0)