Skip to content

Commit

Permalink
fix bug of sequence/fasta_trim_aligned_fasta.pl
Browse files Browse the repository at this point in the history
  • Loading branch information
shenwei356 committed Dec 4, 2014
1 parent 967018f commit 58fbd24
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions sequence/fasta_trim_aligned_fasta.pl
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
while ( my $fa = &$next_seq() ) {
( $header, $seq ) = @$fa;
$sum++;
print STDERR "\rsum: $sum";
print STDERR "\rcount: $sum";
if ($do_once) {
$len = length $seq;
$$gaploc{$_} = 1 for 0 .. ( $len - 1 );
Expand All @@ -93,7 +93,7 @@
if ( scalar keys %$gaploc == 0 ) {
close $tmp_file_fh if $use_stdin;
remove_tmpfile() if $use_stdin;
die "no gap to trim\n";
die "\nno gap to trim\n";
}

print $tmp_file_fh ">$header\n$seq\n" if $use_stdin;
Expand All @@ -102,12 +102,13 @@

close $tmp_file_fh if $use_stdin;

print STDERR scalar keys %$gaploc, " gaps to trim\n";
my @index = keys %$gaploc;

print STDERR "\n", (scalar @index), " gaps to trim\n";
print STDERR "\nextract sequences...\n";

@files = ($tmp_file) if $use_stdin;

my @index = keys %$gaploc;
for my $file (@files) {
my $next_seq = FastaReader($file);
while ( my $fa = &$next_seq() ) {
Expand Down

0 comments on commit 58fbd24

Please sign in to comment.