Mercurial > repos > edward-kirton > roche454_toolsuite
annotate roche454/runMapping_cDNA_wrapper.pl @ 1:584549c024c2 default tip
Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
| author | edward-kirton | 
|---|---|
| date | Tue, 07 Jun 2011 17:23:39 -0400 | 
| parents | 9e30cc10a6a3 | 
| children | 
| rev | line source | 
|---|---|
| 
0
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
1 #!/usr/bin/env/perl | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
2 | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
3 use warnings; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
4 use strict; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
5 use File::Copy; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
6 | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
7 # EXPECT 21 FILE HANDLES, SOME OF WHICH MAY BE 'None' | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
8 my $outdir=shift @ARGV; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
9 my $alignment_info=shift @ARGV; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
10 my $all_contigs_fasta=shift @ARGV; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
11 my $all_contigs_qual=shift @ARGV; | 
| 
1
 
584549c024c2
Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents: 
0 
diff
changeset
 | 
12 my $all_diffs=shift @ARGV; | 
| 
 
584549c024c2
Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents: 
0 
diff
changeset
 | 
13 my $all_struct_vars=shift @ARGV; | 
| 
 
584549c024c2
Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents: 
0 
diff
changeset
 | 
14 my $hc_diff=shift @ARGV; | 
| 
 
584549c024c2
Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents: 
0 
diff
changeset
 | 
15 my $hc_struct_vars=shift @ARGV; | 
| 
 
584549c024c2
Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents: 
0 
diff
changeset
 | 
16 my $mapping_qc=shift @ARGV; | 
| 
0
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
17 my $newbler_metrics=shift @ARGV; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
18 my $pair_align=shift @ARGV; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
19 my $read_status=shift @ARGV; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
20 my $ref_status=shift @ARGV; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
21 my $tag_pair_align=shift @ARGV; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
22 my $trim_status=shift @ARGV; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
23 my $trimmed_reads_fasta=shift @ARGV; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
24 my $trimmed_reads_qual=shift @ARGV; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
25 my $contigs_ace=shift @ARGV; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
26 my $gene_status=shift @ARGV; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
27 my $isotigs_ace=shift @ARGV; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
28 my $isotigs_fasta=shift @ARGV; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
29 my $isotigs_qual=shift @ARGV; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
30 my $isotigs_agp=shift @ARGV; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
31 my $isotigs_layout=shift @ARGV; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
32 | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
33 # REMOVE PARAMETERS FOR OPTIONAL FILES WHICH WERE NOT PROVIDED | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
34 | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
35 my @cmd=removeUnusedOptions(@ARGV); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
36 | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
37 # RUN COMMAND | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
38 # NOTE: FIRST ARG EXPECTED TO BE EXECUTABLE | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
39 my $stderr; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
40 eval { $stderr=`@cmd 2>&1`; }; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
41 if ( $@ ) { | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
42 print STDERR "Newbler ERROR: $stderr\n"; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
43 `cat $outdir/assembly/454NewblerProgress.txt 1>&2`; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
44 die($@); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
45 } | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
46 | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
47 get_outfile("$outdir/454AlignmentInfo.tsv", $alignment_info); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
48 get_outfile("$outdir/454AllContigs.fna", $all_contigs_fasta); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
49 get_outfile("$outdir/454AllContigs.qual", $all_contigs_qual); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
50 get_outfile("$outdir/454AllDiffs.txt", $all_diffs); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
51 get_outfile("$outdir/454AllStructVars.txt", $all_struct_vars); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
52 get_outfile("$outdir/454HCDiff.txt", $hc_diff); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
53 get_outfile("$outdir/454HCStructVars.txt", $hc_struct_vars); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
54 get_outfile("$outdir/454MappingQC.xls", $mapping_qc); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
55 get_outfile("$outdir/454NewblerMetrics.txt", $newbler_metrics); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
56 get_outfile("$outdir/454PairAlign.txt", $pair_align); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
57 get_outfile("$outdir/454ReadStatus.txt", $read_status); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
58 get_outfile("$outdir/454RefStatus.txt", $ref_status); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
59 get_outfile("$outdir/454TagPairAlign.txt", $tag_pair_align); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
60 get_outfile("$outdir/454TrimStatus.txt", $trim_status); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
61 get_outfile("$outdir/454TrimmedReads.fna", $trimmed_reads_fasta); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
62 get_outfile("$outdir/454TrimmedReads.qual", $trimmed_reads_qual); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
63 get_outfile("$outdir/454Contigs.ace", $contigs_ace); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
64 get_outfile("$outdir/454GeneStatus.txt", $gene_status); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
65 get_outfile("$outdir/454Isotigs.ace", $isotigs_ace); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
66 get_outfile("$outdir/454Isotigs.fna", $isotigs_fasta); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
67 get_outfile("$outdir/454Isotigs.qual", $isotigs_qual); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
68 get_outfile("$outdir/454Isotigs.txt", $isotigs_agp); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
69 get_outfile("$outdir/454IsotigsLayout.txt", $isotigs_layout); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
70 exit; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
71 | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
72 # EVERY 'None' ARG AND IT'S PRECEEDING OPTION TAG ARE DISCARDED | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
73 sub removeUnusedOptions { | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
74 my @cmd=(); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
75 my $prev; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
76 foreach (@_) { | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
77 unless ($_ eq 'None') { | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
78 push @cmd, $prev if defined($prev); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
79 $prev=$_; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
80 } else { | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
81 $prev=undef; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
82 } | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
83 } | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
84 push @cmd, $prev if defined($prev); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
85 return @cmd; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
86 } | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
87 | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
88 sub get_outfile { | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
89 my ($src, $dest)=@_; | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
90 # make sure dest defined and src exist; skip if dest is 'None' | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
91 if ( $dest and $dest ne 'None' and $src and -f $src ) { | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
92 move($src,$dest); | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
93 } | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
94 } | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
95 | 
| 
 
9e30cc10a6a3
Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
 
edward-kirton 
parents:  
diff
changeset
 | 
96 __END__ | 
