Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
4ureliek committed Feb 9, 2015
1 parent 0a821ad commit 5b19b27
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions ReannTE_FilterLow.pl
Expand Up @@ -14,7 +14,7 @@
use Bio::DB::Fasta;
use Bio::SeqIO;

my $v = "1.0";
my $v = "1.1";
my $usage = "\nUsage, v$v:
perl <scriptname.pl> -i <fa> [-r <RMpath>] [-p <XX>]
Expand Down Expand Up @@ -83,16 +83,16 @@ sub filter_low {
#output
my $name = $fa;
$name =~ s/\.fa$|\.fasta$//;
my $keep = "$name.nolow.fa";
my $rejected = "$name.low.fa";

if (-e "$fa.masked") {
my $db = Bio::DB::Fasta->new("$fa.masked") or confess "ERROR: could not create Bio::DB::Fasta object from $fa.masked $!\n";
#create list of the ID of the file
my @dbIDs = $db->get_all_ids();

#fa outputs
my $keep = "$name.nolow.fa";
open(my $keep_fh, ">", $keep) or confess "ERROR: could not create $keep $!\n";
my $rejected = "$name.low.fa";
#fa outputs
open(my $keep_fh, ">", $keep) or confess "ERROR: could not create $keep $!\n";
open(my $rejected_fh, ">", $rejected) or confess "ERROR: could not create $rejected $!\n";

#filter
Expand Down Expand Up @@ -122,7 +122,6 @@ sub filter_low {
mv_RMout($fa,"$name.RMlow"); #cleanup to avoid issue afterwards (other maskings)
}


#----------------------------------------------------------------------------
# rewrite in clean fasta format, will replace previous file
#----------------------------------------------------------------------------
Expand All @@ -137,7 +136,7 @@ sub rw_fasta {
$realfa_obj->write_seq($seq);
}
system "rm -f $fa";
system "mv $fasta $fa";
system "mv $fa $fa";
}

#----------------------------------------------------------------------------
Expand Down

0 comments on commit 5b19b27

Please sign in to comment.