Mercurial > repos > jvolkening > b2b_summarize_assembly
annotate summarize_run.pl @ 1:cd86d5f93b4a draft default tip
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 9260aa02a5f703bce63d2db5b69003df9be371ac
| author | jvolkening | 
|---|---|
| date | Fri, 08 Mar 2024 00:45:00 +0000 | 
| parents | 1995630ef409 | 
| children | 
| rev | line source | 
|---|---|
| 
0
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
1 #!/usr/bin/perl | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
2 | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
3 use strict; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
4 use warnings; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
5 | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
6 use Getopt::Long; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
7 use BioX::Seq::Stream; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
8 use List::Util qw/sum/; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
9 | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
10 my $fn_raw1; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
11 my $fn_raw2; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
12 my $fn_filt1; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
13 my $fn_filt2; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
14 my $fn_bedgraph; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
15 my $fn_qc1; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
16 my $fn_qc2; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
17 my $fn_consensus; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
18 my $fn_out; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
19 my $n_threads = 1; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
20 | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
21 GetOptions( | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
22 'raw_1=s' => \$fn_raw1, | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
23 'raw_2=s' => \$fn_raw2, | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
24 'filt_1=s' => \$fn_filt1, | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
25 'filt_2=s' => \$fn_filt2, | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
26 'bedgraph=s' => \$fn_bedgraph, | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
27 'fastqc_1=s' => \$fn_qc1, | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
28 'fastqc_2=s' => \$fn_qc2, | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
29 'consensus=s' => \$fn_consensus, | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
30 'out=s' => \$fn_out, | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
31 'threads=i' => \$n_threads, | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
32 ); | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
33 | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
34 my @counts; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
35 for ($fn_raw1, $fn_raw2, $fn_filt1, $fn_filt2) { | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
36 open my $in, '-|', 'wc', '-l', $_; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
37 my $ret = <$in>; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
38 close $in; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
39 chomp $ret; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
40 my ($count, $fn) = split ' ', $ret; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
41 die "line length not multiple of four for $_\n" | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
42 if ($count % 4); | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
43 push @counts, $count/4; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
44 } | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
45 | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
46 | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
47 die "raw pair count mismatch\n" if ($counts[0] != $counts[1]); | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
48 die "filtered pair count mismatch\n" if ($counts[2] != $counts[3]); | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
49 | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
50 # read fragment stats from STDIN | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
51 my @lens; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
52 while (<STDIN>) { | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
53 chomp $_; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
54 push @lens, $_; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
55 } | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
56 | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
57 my $frag_mean = int( sum(@lens)/scalar(@lens)+0.5 ); | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
58 my $frag_sd = int( sqrt( sum( map {($_ - $frag_mean)**2} @lens)/(scalar(@lens)-1) )+0.5 ); | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
59 | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
60 # extract FastQC data | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
61 #warn "extracting FastQC stats...\n"; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
62 | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
63 my @five_nums; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
64 for my $fn ($fn_qc1, $fn_qc2) { | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
65 open my $in, '<', $fn; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
66 | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
67 my $in_data = 0; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
68 my @data; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
69 LINE: | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
70 while (my $line = <$in>) { | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
71 chomp $line; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
72 if ($in_data) { | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
73 if ($line =~ /^>>END_MODULE/) { | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
74 last LINE; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
75 } | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
76 next if ($line =~ /^#/); | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
77 my ($score, $count) = split ' ', $line; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
78 push @data, [$score,$count]; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
79 } | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
80 elsif ($line =~ /^>>Per sequence quality scores/) { | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
81 $in_data = 1; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
82 } | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
83 } | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
84 | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
85 push @five_nums, data_to_5( @data ); | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
86 } | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
87 | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
88 # Count contigs | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
89 | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
90 my $p = BioX::Seq::Stream->new($fn_consensus); | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
91 my %n_contigs; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
92 my @names; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
93 while (my $seq = $p->next_seq) { | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
94 | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
95 my $id = $seq->id; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
96 push @names, $id; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
97 while ($seq =~ /[^Nn]+/g) { | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
98 ++$n_contigs{$id}; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
99 } | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
100 } | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
101 | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
102 # Parse assembly depth info | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
103 #warn "calculating coverage stats...\n"; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
104 | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
105 open my $in, '<', $fn_bedgraph; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
106 | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
107 my %cov_5nums; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
108 my %counts; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
109 my $last_end; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
110 my $last_contig; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
111 my $head = <$in>; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
112 while (my $line = <$in>) { | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
113 chomp $line; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
114 my ($contig,$start,$end,$depth) = split "\t", $line; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
115 $last_contig //= $contig; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
116 if ($contig ne $last_contig) { | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
117 | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
118 my @depths = sort {$a <=> $b} keys %counts; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
119 my @data; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
120 for (@depths) { | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
121 push @data, [$_, $counts{$_}]; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
122 } | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
123 $cov_5nums{$last_contig} = data_to_5( @data ); | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
124 $last_contig = $contig; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
125 %counts = (); | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
126 $last_end = undef; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
127 } | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
128 | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
129 if (defined($last_end) && $last_end < $start) { | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
130 $counts{0} += $start - $last_end; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
131 } | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
132 $counts{$depth} += $end - $start; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
133 $last_end = $end; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
134 } | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
135 my @depths = sort {$a <=> $b} keys %counts; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
136 my @data; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
137 for (@depths) { | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
138 push @data, [$_, $counts{$_}]; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
139 } | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
140 $cov_5nums{$last_contig} = data_to_5( @data ); | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
141 | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
142 open my $out, '>', $fn_out; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
143 print {$out} join("\t", | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
144 '#id', | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
145 'raw_read_pairs', | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
146 'filt_read_pairs', | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
147 'frag_len_mean', | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
148 'frag_len_sd', | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
149 'forward_qual', | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
150 'reverse_qual', | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
151 'n_contigs', | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
152 'coverage_depth', | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
153 ), "\n"; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
154 for my $id (@names) { | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
155 print {$out} join("\t", | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
156 $id, | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
157 $counts[0], | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
158 $counts[2], | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
159 $frag_mean, | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
160 $frag_sd, | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
161 $five_nums[0], | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
162 $five_nums[1], | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
163 $n_contigs{$id}, | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
164 $cov_5nums{$id}, | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
165 ), "\n"; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
166 } | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
167 close $out; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
168 | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
169 exit; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
170 | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
171 | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
172 sub data_to_5 { | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
173 | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
174 my (@data) = @_; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
175 my $total = sum map {$_->[1]} @data; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
176 my @five_num; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
177 my $curr = 0; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
178 for my $i (0..$#data) { | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
179 $curr += $data[$i]->[1]; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
180 for my $j (0..4) { | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
181 next if (defined $five_num[$j]); | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
182 my $quant = $j/4; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
183 if ($curr/$total > $quant) { | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
184 $five_num[$j] = $data[$i]->[0]; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
185 } | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
186 elsif ($curr/$total == $quant) { | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
187 $five_num[$j] = $i < $#data | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
188 ? int(($data[$i]->[0]+$data[$i+1]->[0])/2) | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
189 : $data[$i]->[0]; | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
190 } | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
191 } | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
192 } | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
193 return join('|',@five_num); | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
194 | 
| 
 
1995630ef409
planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
 
jvolkening 
parents:  
diff
changeset
 | 
195 } | 
