comparison velvet/velveth_jgi_wrapper.pl @ 0:4afe13ac23b6 default tip

Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
author edward-kirton
date Tue, 07 Jun 2011 17:52:16 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4afe13ac23b6
1 #!/usr/bin/env perl
2
3 use strict;
4 use warnings;
5 my $start=time;
6 my $outfile=shift @ARGV;
7 my $outdir=shift @ARGV;
8 my $kmer=$ARGV[2];
9 die ("USER ERROR: Hash length (kmer) must be odd!\n") unless $kmer % 2;
10 my $tot_reads=0;
11 open (VELVETH, "@ARGV 2>&1|") or die("Unable to run velveth: $!\n");
12 open(OUT, ">$outfile") or die($!);
13 while (<VELVETH>) {
14 print OUT $_;
15 if (/^\[\d+\.\d+\] (\d+) sequences found/) {
16 $tot_reads += $1;
17 }
18 }
19 close VELVETH;
20 close OUT;
21 die("No reads found\n") unless $tot_reads;
22 my $sec=time-$start;
23 my $min=int($sec/60);
24 $sec -= ($min*60);
25 my $hr=int($min/60);
26 $min -= ($hr*60);
27 print "$tot_reads processed in";
28 print " $hr hr" if $hr;
29 print " $min min" if $min;
30 print " $sec sec\n";
31 exit