13
13
my $run ;
14
14
GetOptions(
15
15
" h|?" => \&help,
16
- " v :s" => \$invcf ,
17
- " p :s" => \$inphy ,
18
- " o :s" => \$outdir ,
19
- " k :s" => \$key ,
20
- " s :s" => \$shdir ,
21
- " b :s" => \$bootnum ,
22
- " f :s" => \$fraction ,
23
- " m :s" => \$model ,
24
- " c :s" => \$config_file ,
25
- " p :s" => \$pattern ,
26
- " r :s" => \$run ,
16
+ " vcf :s" => \$invcf ,
17
+ " phy :s" => \$inphy ,
18
+ " outdir :s" => \$outdir ,
19
+ " key :s" => \$key ,
20
+ " shdir :s" => \$shdir ,
21
+ " bootnum :s" => \$bootnum ,
22
+ " bootfrac :s" => \$fraction ,
23
+ " model :s" => \$model ,
24
+ " config :s" => \$config_file ,
25
+ " pattern :s" => \$pattern ,
26
+ " run :s" => \$run ,
27
27
) || &help;
28
28
&help unless (($invcf || $inphy ) && $outdir && $key );
29
-
30
29
sub help
31
30
{
32
31
print "
33
32
Description: vcf to NJ-tree by pre-computed distance matrix and parallelizing bootstraps
34
33
35
- -v <file> input vcf file [force if no -p ]
36
- -p <file> input phylip file [force if no -v ]
37
- -o <dir> output directory [force]
38
- -k <str> output prefix [force]
39
- -s <dir> shell directory [-o]
40
- -b <int> bootstrap times [100]
41
- -f <float> fraction of bootstrap sampling [0.25]
42
- -m <str> substitution model [pdist]
43
- pdist: p-distance
44
- jc : Juke-Cantor
45
- k2p : Kimura 2 Parameters
46
- f81 : Felsenstein 81
47
- f84 : Felsenstein 84
48
- tn93 : Tamura and Nei 1993
49
- -c <file> config file [optional]
50
- -p <str> config split pattern [:=]
51
- -r <T/F> run or not [T]
34
+ -vcf <file> input vcf file [force if no -phy ]
35
+ -phy <file> input phylip file [force if no -vcf ]
36
+ -outdir <dir> output directory [force]
37
+ -key <str> output prefix [force]
38
+ -shdir <dir> shell directory [-o]
39
+ -bootnum <int> bootstrap times [100]
40
+ -bootfrac <float> fraction of bootstrap sampling [0.25]
41
+ -model <str> substitution model [pdist]
42
+ pdist: p-distance
43
+ jc : Juke-Cantor
44
+ k2p : Kimura 2 Parameters
45
+ f81 : Felsenstein 81
46
+ f84 : Felsenstein 84
47
+ tn93 : Tamura and Nei 1993
48
+ -config <file> config file [optional]
49
+ -pattern <str> config split pattern [:=]
50
+ -run <T/F> run or not [T]
52
51
-h Help document
53
52
" ;
54
53
exit ;
@@ -85,7 +84,7 @@ sub help
85
84
$pattern ||= " :=" ;
86
85
# #### read config
87
86
my %config ;
88
- &read_config($config_file );
87
+ &read_config($config_file ) if defined $config_file ;
89
88
90
89
$config {snp_tree_bootnum } //= 100;
91
90
$config {snp_tree_model } ||= " pdist" ;
@@ -99,7 +98,7 @@ sub help
99
98
$config {fastme } ||= " /Bio/User/kxie/software/mambaforge/envs/fastme/bin/fastme" ;
100
99
$config {maxjob } ||= 20;
101
100
$config {queue } ||= " all.q,fast.q,centos7" ;
102
- $config {submit } ||= " node " ;
101
+ $config {submit } ||= " qsub " ;
103
102
104
103
105
104
&main();
118
117
my ($cmd , $phyfile );
119
118
if (defined $invcf && !defined $inphy ){
120
119
($cmd , $phyfile ) = &filter($invcf );
120
+ print PIPE " $cmd \n " ;
121
121
}else {
122
122
$phyfile = $inphy ;
123
123
}
124
- print PIPE " $cmd \n " ;
125
124
126
125
# distance
127
126
my ($cmd1 , $cmd2 ) = &distance($phyfile );
176
175
print SH1 " $cmd \n " ;
177
176
$cmd = " $config {fastme} -i $outdir /$key .orig.dist -o $outdir /$key \. orig.tree" ;
178
177
print SH2 " $cmd \n " ;
179
- for (my $i = 1 ; $i <= $config {snp_tree_bootnum }; $i ++) {
178
+ for (my $i = 0 ; $i <= $config {snp_tree_bootnum }; $i ++) {
180
179
$i = sprintf (" %04d" , $i );
181
180
$cmd = " $config {goalign} build distboot -i $phy -p -t 4 -m $config {snp_tree_model} " ;
182
181
$cmd .= " -f $config {snp_tree_bootfrac} -o $tmpdir /$key .boot$i .dist" ;
0 commit comments