Skip to content

Commit

Permalink
minor bug
Browse files Browse the repository at this point in the history
  • Loading branch information
treangen committed Aug 2, 2011
1 parent 4658662 commit f815ba5
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions Utilities/perl/metaphyler_contigs.pl
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,27 @@
use warnings;


my $dir = "/fs/szasmg3/boliu/metaphyler/MetaPhylerV1.21/data/";


#---------------------------------------------------#
# command line parameters
#---------------------------------------------------#
my $blastfile = ""; # input blastx file
my $prefix = ""; # output files prefix
my $contigCovfile = "";
if (scalar @ARGV == 3) {
my $outdir = ".";
my $rundir = ".";
if (scalar @ARGV == 5) {
$blastfile = $ARGV[0];
$prefix = $ARGV[1];
$contigCovfile = $ARGV[2];
$outdir = $ARGV[3];
$rundir = $ARGV[4];
} else {
Usage();
}

my $dir = "$rundir/config/";
#---------------------------------------------------#


Expand Down Expand Up @@ -172,7 +178,7 @@
#---------------------------------------------------#

# output classification file
open(OUTPUT, ">./$prefix.classify.txt");
open(OUTPUT, ">$outdir/$prefix.classify.txt");
select OUTPUT;

foreach my $rid (keys %hits) {
Expand Down Expand Up @@ -242,7 +248,7 @@
}

if ($assign == 1 && $num ==1 && $hacc =~ /^tm7/) {
$numMapped++;
$numMapped++;#=($numMapped*$cov);

print "$rid\t$hacc\tNA\t";

Expand Down Expand Up @@ -298,8 +304,8 @@
if ($g2m{$hacc} eq "tsf") { next;}

# total number of reads mapped
$numMapped++;

#$numMapped++;
$numMapped+=($cov*$hspl);
print "$rid\t$hacc\t$g2m{$hacc}\t";
my $levtag = 0;

Expand Down Expand Up @@ -361,8 +367,8 @@
# taxonomic profile at each level
#---------------------------------------------------#
# output taxonomic profile file
open(PCT, ">./$prefix.taxprof.pct.txt");
open(COUNT, ">./$prefix.taxprof.count.txt");
open(PCT, ">$outdir/$prefix.taxprof.pct.txt");
open(COUNT, ">$outdir/$prefix.taxprof.count.txt");
foreach my $lev (@tlevs) {

print PCT ">$lev\n";
Expand Down

0 comments on commit f815ba5

Please sign in to comment.