annotate summarize_run.pl @ 1:b31b119e3905 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:44:15 +0000
parents 9e0453df1745
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
9e0453df1745 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
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
2
9e0453df1745 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;
9e0453df1745 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;
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
5
9e0453df1745 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;
9e0453df1745 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;
9e0453df1745 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/;
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
9
9e0453df1745 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;
9e0453df1745 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;
9e0453df1745 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;
9e0453df1745 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;
9e0453df1745 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;
9e0453df1745 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;
9e0453df1745 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;
9e0453df1745 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;
9e0453df1745 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;
9e0453df1745 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;
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
20
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
21 GetOptions(
9e0453df1745 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,
9e0453df1745 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,
9e0453df1745 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,
9e0453df1745 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,
9e0453df1745 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,
9e0453df1745 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,
9e0453df1745 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,
9e0453df1745 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,
9e0453df1745 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,
9e0453df1745 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,
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
32 );
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
33
9e0453df1745 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;
9e0453df1745 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) {
9e0453df1745 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', $_;
9e0453df1745 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>;
9e0453df1745 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;
9e0453df1745 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;
9e0453df1745 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;
9e0453df1745 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"
9e0453df1745 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);
9e0453df1745 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;
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
44 }
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
45
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
46
9e0453df1745 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]);
9e0453df1745 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]);
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
49
9e0453df1745 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
9e0453df1745 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;
9e0453df1745 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>) {
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
53 chomp $_;
9e0453df1745 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, $_;
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
55 }
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
56
9e0453df1745 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 );
9e0453df1745 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 );
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
59
9e0453df1745 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
9e0453df1745 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";
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
62
9e0453df1745 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;
9e0453df1745 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) {
9e0453df1745 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;
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
66
9e0453df1745 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;
9e0453df1745 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;
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
69 LINE:
9e0453df1745 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>) {
9e0453df1745 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;
9e0453df1745 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) {
9e0453df1745 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/) {
9e0453df1745 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;
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
75 }
9e0453df1745 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 =~ /^#/);
9e0453df1745 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;
9e0453df1745 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];
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
79 }
9e0453df1745 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/) {
9e0453df1745 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;
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
82 }
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
83 }
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
84
9e0453df1745 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 );
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
86 }
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
87
9e0453df1745 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
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
89
9e0453df1745 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);
9e0453df1745 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;
9e0453df1745 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;
9e0453df1745 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) {
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
94
9e0453df1745 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;
9e0453df1745 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;
9e0453df1745 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) {
9e0453df1745 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};
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
99 }
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
100 }
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
101
9e0453df1745 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
9e0453df1745 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";
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
104
9e0453df1745 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;
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
106
9e0453df1745 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;
9e0453df1745 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;
9e0453df1745 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;
9e0453df1745 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;
9e0453df1745 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>;
9e0453df1745 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>) {
9e0453df1745 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;
9e0453df1745 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;
9e0453df1745 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;
9e0453df1745 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) {
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
117
9e0453df1745 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;
9e0453df1745 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;
9e0453df1745 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) {
9e0453df1745 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{$_}];
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
122 }
9e0453df1745 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 );
9e0453df1745 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;
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
125 %counts = ();
9e0453df1745 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;
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
127 }
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
128
9e0453df1745 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) {
9e0453df1745 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;
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
131 }
9e0453df1745 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;
9e0453df1745 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;
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
134 }
9e0453df1745 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;
9e0453df1745 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;
9e0453df1745 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) {
9e0453df1745 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{$_}];
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
139 }
9e0453df1745 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 );
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
141
9e0453df1745 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;
9e0453df1745 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",
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
144 '#id',
9e0453df1745 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',
9e0453df1745 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',
9e0453df1745 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',
9e0453df1745 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',
9e0453df1745 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',
9e0453df1745 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',
9e0453df1745 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',
9e0453df1745 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',
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
153 ), "\n";
9e0453df1745 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) {
9e0453df1745 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",
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
156 $id,
9e0453df1745 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],
9e0453df1745 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],
9e0453df1745 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,
9e0453df1745 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,
9e0453df1745 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],
9e0453df1745 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],
9e0453df1745 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},
9e0453df1745 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},
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
165 ), "\n";
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
166 }
9e0453df1745 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;
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
168
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
169 exit;
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
170
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
171
9e0453df1745 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 {
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
173
9e0453df1745 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) = @_;
9e0453df1745 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;
9e0453df1745 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;
9e0453df1745 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;
9e0453df1745 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) {
9e0453df1745 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];
9e0453df1745 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) {
9e0453df1745 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]);
9e0453df1745 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;
9e0453df1745 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) {
9e0453df1745 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];
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
185 }
9e0453df1745 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) {
9e0453df1745 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
9e0453df1745 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)
9e0453df1745 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];
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
190 }
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
191 }
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
192 }
9e0453df1745 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);
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
194
9e0453df1745 planemo upload for repository https://github.com/jvolkening/galaxy-tools/tree/master/tools/b2b_utils commit 54eef6140a5086e3373b2406efb2e18dbfae1336-dirty
jvolkening
parents:
diff changeset
195 }