Skip to content

Commit

Permalink
Fixes Issue #132
Browse files Browse the repository at this point in the history
Makes a temp file that has the reference sequence named “reference” so
that percentcoverage doesn’t choke.
  • Loading branch information
daisieh committed Apr 8, 2014
1 parent 4396eaf commit 27e2d8a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Postprocessing/PercentCoverage.pl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
use File::Basename qw(basename);
use lib "$FindBin::Bin/../lib";
use Postprocessing;
use Parsing qw(parsefasta);
use File::Temp qw(tempfile);

my $ref_file = shift @ARGV;
my $contigs_file = shift @ARGV;
Expand All @@ -24,7 +26,15 @@
die "Couldn't find contigs file $contigs_file";
}

my $contigs = percentcoverage ($ref_file, $contigs_file, $out_name, $aligner);
my ($reffasta, $reffastaarray) = parsefasta ($ref_file);
my ($fh, $filename) = tempfile();
print $fh ">reference\n";
foreach my $r (@$reffastaarray) {
print $fh "$reffasta->{$r}\n";
}
close $fh;

my $contigs = percentcoverage ($filename, $contigs_file, $out_name, $aligner);

if (defined $contigs) {
my $refseq = delete $contigs->{reference};
Expand Down

0 comments on commit 27e2d8a

Please sign in to comment.