line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package BioX::Map::CLIS::Cmd::Compare; |
2
|
1
|
|
|
1
|
|
2031
|
use Modern::Perl; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
7
|
|
3
|
1
|
|
|
1
|
|
108
|
use IO::All; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
7
|
|
4
|
1
|
|
|
1
|
|
45
|
use Carp "confess"; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
31
|
|
5
|
1
|
|
|
1
|
|
3
|
use Moo; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
6
|
1
|
|
|
1
|
|
265
|
use MooX::Options prefer_commandline => 1, with_config_from_file => 1; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
7
|
1
|
|
|
1
|
|
29096
|
use MooX::Cmd; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
8
|
1
|
|
|
1
|
|
1179
|
use BioX::Map; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
9
|
1
|
|
|
1
|
|
23
|
use Types::Standard qw(Int Str Bool Enum); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
9
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.0.11'; # VERSION: |
12
|
|
|
|
|
|
|
# ABSTRACT: a wrapper for mapping software |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
around _build_config_identifier => sub { 'berry' }; |
16
|
|
|
|
|
|
|
around _build_config_prefix => sub { 'biox_map' }; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
option indir => ( |
21
|
|
|
|
|
|
|
is => 'ro', |
22
|
|
|
|
|
|
|
format => 's', |
23
|
|
|
|
|
|
|
short => 'i', |
24
|
|
|
|
|
|
|
default => '', |
25
|
|
|
|
|
|
|
doc => "path of one fastq file", |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
option soap_suffix => ( |
31
|
|
|
|
|
|
|
is => 'ro', |
32
|
|
|
|
|
|
|
format => 's', |
33
|
|
|
|
|
|
|
short => 's', |
34
|
|
|
|
|
|
|
doc => "suffix of all samples' soap result", |
35
|
|
|
|
|
|
|
default => 'soap', |
36
|
|
|
|
|
|
|
); |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
option bwa_suffix => ( |
40
|
|
|
|
|
|
|
is => 'ro', |
41
|
|
|
|
|
|
|
format => 's', |
42
|
|
|
|
|
|
|
short => 'b', |
43
|
|
|
|
|
|
|
doc => "suffix of all samples' bwa result", |
44
|
|
|
|
|
|
|
default => 'bwa', |
45
|
|
|
|
|
|
|
); |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
option outfile => ( |
49
|
|
|
|
|
|
|
is => 'ro', |
50
|
|
|
|
|
|
|
format => 's', |
51
|
|
|
|
|
|
|
short => 'o', |
52
|
|
|
|
|
|
|
default => 'summary.txt', |
53
|
|
|
|
|
|
|
doc => "file used to store summary file", |
54
|
|
|
|
|
|
|
); |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub execute { |
58
|
0
|
|
|
0
|
1
|
|
my ($self, $args_ref, $chain_ref) = @_; |
59
|
0
|
|
|
|
|
|
my $pre_message = "please input parameters, genome is required, either infile or indir is required"; |
60
|
0
|
|
|
|
|
|
my ($indir, $outfile, $soap_suffix, $bwa_suffix) = ($self->indir, $self->outfile, $self->soap_suffix, $self->bwa_suffix); |
61
|
0
|
0
|
0
|
|
|
|
$self->options_usage(1, $pre_message) unless ($outfile and $indir and $soap_suffix and $bwa_suffix); |
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
62
|
0
|
|
|
|
|
|
my $bm = BioX::Map->new; |
63
|
0
|
|
|
|
|
|
say "indir:$indir"; |
64
|
0
|
|
|
0
|
|
|
my @soap_result = io($indir)->filter( sub {$_->filename =~/\.$soap_suffix$/} )->all_files; |
|
0
|
|
|
|
|
|
|
65
|
0
|
|
|
0
|
|
|
my @bwa_result = io($indir)->filter( sub {$_->filename =~/\.$bwa_suffix$/} )->all_files; |
|
0
|
|
|
|
|
|
|
66
|
0
|
|
|
|
|
|
$outfile = io($outfile); |
67
|
0
|
|
|
|
|
|
$outfile->print("samplename\tsoap0\tsoap1\tsoap2\tbwa0\tbwa1\tbwa2\n"); |
68
|
0
|
|
|
|
|
|
for my $sr (@soap_result) { |
69
|
0
|
|
|
|
|
|
$bm->tool("soap"); |
70
|
0
|
|
|
|
|
|
my $filename = $sr->filename; |
71
|
0
|
|
|
|
|
|
say "###########sr: $sr ######filename: $filename"; |
72
|
0
|
|
|
|
|
|
$filename =~s/\.$soap_suffix$//i; |
73
|
0
|
|
|
|
|
|
say "soap result:$sr"; |
74
|
0
|
|
|
|
|
|
my $s_r = $bm->statis_result("$sr"); |
75
|
0
|
|
|
|
|
|
$bm->tool("bwa"); |
76
|
0
|
|
|
|
|
|
$sr =~s/$soap_suffix$/$bwa_suffix/i; |
77
|
0
|
|
|
|
|
|
say "bwa result:$sr"; |
78
|
0
|
|
|
|
|
|
my $b_r = $bm->statis_result("$sr"); |
79
|
0
|
|
|
|
|
|
$sr =~s/\.$bwa_suffix//i; |
80
|
0
|
|
|
|
|
|
$outfile->println(join "\t", $filename, @$s_r, @$b_r); |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
1; |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
__END__ |