Egaz/Command/lpcnam.pm

filter: Statementstmt 19.5% 35 / 179 Branchbran 11.7% 4 / 34 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 62.5% 10 / 16 Podpod 100% 6 / 6 totaltotal 24.1% 58 / 240 CC 28 SCAR 47.5
CC
28
Cov
19%
execute
272.0
validate_args
47.9
__ANON__
2.0
CRAP 116.1
« Egaz/Command/lastz.pm ↑ Summary Egaz/Command/raxml.pm »
1 package App::Egaz::Command::lpcnam;
2 19 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 19 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 19 ▶use autodie;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 19 ▶use App::Egaz -command;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 19 ▶use App::Egaz::Common;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 ▶sub abstract {
Subroutine abstract: called CC=1 SCAR=0.0
Pod documented
10 2 return 'the pipeline of pairwise lav-psl-chain-net-axt-maf';
11 }
12  
13 4 ▶sub opt_spec {
Subroutine opt_spec: called CC=1 SCAR=0.0
Pod documented
14 return (
15 4 [ "outdir|o=s", "Output directory", ],
16 [ "lineargap=s", "axtChain linearGap, loose or medium", { default => "loose" }, ],
17 [ "minscore=i", "minimum score for axtChain", { default => 1000 }, ],
18 [ "tname|t=s", "target name", ],
19 [ "qname|q=s", "query name", ],
20 [ "syn", "create .synNet.maf instead of .net.maf", ],
21 [ "parallel|p=i", "number of threads", { default => 2 }, ],
22 [ "verbose|v", "verbose mode", ],
23 { show_defaults => 1, }
24 );
25 }
26  
27 4 ▶sub usage_desc {
Subroutine usage_desc: called CC=1 SCAR=0.0
Pod documented
28 4 return "egaz lpcnam [options] <path/target> <path/query> <path/lav>";
29 }
30  
31 1 ▶sub description {
Subroutine description: called CC=1 SCAR=0.0
Pod documented
32 1 my $desc;
33 1 $desc .= ucfirst(abstract) . ".\n";
34 1 $desc .= <<'MARKDOWN';
35  
36 * <path/target> and <path/query> are directories containing .fa, chr.sizes and chr.2bit files
37 * <path/lav> can be a .lav file, lav.tar.gz or a directory containing .lav files
38 * Many binaries from kent-tools are needed and should be found in $PATH:
39 * axtChain
40 * chainAntiRepeat
41 * chainMergeSort
42 * chainPreNet
43 * chainNet
44 * netSyntenic
45 * netChainSubset
46 * chainStitchId
47 * netSplit
48 * netToAxt
49 * axtSort
50 * axtToMaf
51 * netFilter
52 * chainSplit
53 * [Prebuild binaries](http://hgdownload.soe.ucsc.edu/admin/exe/linux.x86_64/)
54 * `--lineargap` and `--minscore`:
55 * Human18vsChimp2 use loose and 1000
56 * Human19vsChimp3 use medium and 5000
57 * loose is chicken/human linear gap costs
58 * medium is mouse/human linear gap costs
59 * Default names of target and query in .maf are defined by basename of <path/target> and <path/query>
60  
61 MARKDOWN
62  
63 1 return $desc;
64 }
65  
66 3 ▶sub validate_args {
Subroutine validate_args: called CC=13 SCAR=38.7
Pod documented
67 3 my ( $self, $opt, $args ) = @_;
68  
69 3 ▶ if ( @{$args} != 3 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@{$args;} != 3) 2 1 3
70 2 my $message = "This command need three input files/directories.\n\tIt found";
71 2 $message .= sprintf " [%s]", $_ for @{$args};
72 2 $message .= ".\n";
73 2 $self->usage_error($message);
74 }
75 1 for ( @{$args} ) {
76 3 ▶ if ( !( Path::Tiny::path($_)->is_file or Path::Tiny::path($_)->is_dir ) ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (Path::Tiny::path($_)->is_file or Path::Tiny::path($_)->is_dir) 1 2 3
Condition66%2/3
Path::Tiny::path($_)->is_file or Path::Tiny::path($_)->is_dir
l!l&&r!l&&!r
021
MC/DC50%1/2
Path::Tiny::path($_)->is_file or Path::Tiny::path($_)->is_dir
Path::Tiny::path($_)->is_file Path::Tiny::path($_)->is_dir
Truth table66%2/3
A or B
A= Path::Tiny::path($_)->is_fileB= Path::Tiny::path($_)->is_dir
ABresult
1X1
011
000
77 1 $self->usage_error("The input file/directory [$_] doesn't exist.");
78 }
79 }
80  
81 # set default --outdir
82 0 ▶ if ( Path::Tiny::path( $args->[2] )->is_file ) {
Branch: 1 branch
BranchTrueFalseTotal
if (Path::Tiny::path($args->[2])->is_file) 0 0 0
83 0 ▶ if ( !$opt->{outdir} ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($opt->{"outdir"}) 0 0 0
84 0 $opt->{outdir} = ".";
85 0 ▶ print STDERR "--outdir set to [.]\n" if $opt->{verbose};
Branch: 1 branch
BranchTrueFalseTotal
if $opt->{"verbose"} 0 0 0
86 }
87 }
88 0 ▶ if ( Path::Tiny::path( $args->[2] )->is_dir ) {
Branch: 1 branch
BranchTrueFalseTotal
if (Path::Tiny::path($args->[2])->is_dir) 0 0 0
89 0 $opt->{outdir} = $args->[2];
90 0 ▶ print STDERR "--outdir set to [$args->[2]]\n" if $opt->{verbose};
Branch: 1 branch
BranchTrueFalseTotal
if $opt->{"verbose"} 0 0 0
91 }
92  
93 0 ▶ if ( !$opt->{tname} ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($opt->{"tname"}) 0 0 0
94 0 $opt->{tname} = Path::Tiny::path( $args->[0] )->basename();
95 }
96 0 ▶ if ( !$opt->{qname} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $opt->{"qname"}) 0 0 0
97 0 $opt->{qname} = Path::Tiny::path( $args->[1] )->basename();
98 }
99 }
100  
101 0 ▶sub execute {
Subroutine execute: not called CC=16 SCAR=56.1
Pod documented
102 0 my ( $self, $opt, $args ) = @_;
103  
104 #@type Path::Tiny
105 0 my $outdir = Path::Tiny::path( $opt->{outdir} );
106 0 $outdir->mkpath();
107  
108 #----------------------------------------------------------#
109 # lav-psl-chain-net-axt section
110 #----------------------------------------------------------#
111 0 for my $d (qw{net axtNet}) {
112 0 $outdir->child($d)->mkpath();
113 }
114  
115 0 my $gzip_bin = "gzip";
116 0 ▶ if ( IPC::Cmd::can_run('pigz') ) {
Branch: 1 branch
BranchTrueFalseTotal
if (IPC::Cmd::can_run("pigz")) 0 0 0
117 0 $gzip_bin = "pigz -p " . $opt->{parallel};
118 }
119  
120 #----------------------------#
121 # lavToPsl
122 #----------------------------#
123 {
124 0 my @files;
125 0 ▶ if ( Path::Tiny::path( $args->[2] )->is_file ) {
Branch: 1 branch
BranchTrueFalseTotal
if (Path::Tiny::path($args->[2])->is_file) { } 0 0 0
126 0 my $basename = Path::Tiny::path( $args->[2] )->basename();
127 0 ▶ if ( $basename =~ m{\.lav$} ) { # a single .lav file
Branch: 1 branch
BranchTrueFalseTotal
if ($basename =~ /\.lav$/) { } 0 0 0
128 0 ▶ if ( !$outdir->child($basename)->is_file ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($outdir->child($basename)->is_file) 0 0 0
129 0 Path::Tiny::path( $args->[2] )->copy($outdir);
130 0 printf STDERR "* copy [%s] to [%s]\n", $args->[2], $outdir;
131 }
132 0 @files = ( $outdir->child($basename)->stringify );
133 }
134 else { # lav.tar.gz
135 0 system "tar xvfz $args->[2] -C $outdir";
136 0 @files = File::Find::Rule->file->name('*.lav')->in( $outdir->stringify );
137 }
138 }
139 else {
140 0 @files = File::Find::Rule->file->name('*.lav')->in( $outdir->stringify );
141 }
142 0 printf STDERR "* .lav files: [%d]\n", scalar @files;
143  
144 0 my $mce = MCE->new( chunk_size => 1, max_workers => $opt->{parallel}, );
145 $mce->foreach(
146 [ sort @files ],
147 0 ▶ sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
148 0 my ( $self, $chunk_ref, $chunk_id ) = @_;
149  
150 0 my $file = $chunk_ref->[0];
151 0 my $output = $file;
152 0 $output =~ s/lav$/psl/;
153  
154 0 my $cmd = "egaz lav2psl" . " $file" . " -o $output";
155 0 App::Egaz::Common::exec_cmd( $cmd, { verbose => $opt->{verbose}, } );
156 }
157 0 );
158 }
159  
160 #----------------------------#
161 # axtChain
162 #----------------------------#
163 {
164 0 my @files = File::Find::Rule->file->name('*.psl')->in( $outdir->stringify );
165 0 printf STDERR "* .psl files: [%d]\n", scalar @files;
166  
167 0 my $mce = MCE->new( chunk_size => 1, max_workers => $opt->{parallel}, );
168 $mce->foreach(
169 [ sort @files ],
170 0 ▶ sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
171 0 my ( $self, $chunk_ref, $chunk_id ) = @_;
172  
173 0 my $file = $chunk_ref->[0];
174 0 my $output = $file;
175 0 $output =~ s/psl$/chain/;
176  
177 # axtChain - Chain together axt alignments.
178 # usage:
179 # axtChain -linearGap=loose in.axt tNibDir qNibDir out.chain
180 # Where tNibDir/qNibDir are either directories full of nib files, or the
181 # name of a .2bit file
182 #
183 # chainAntiRepeat - Get rid of chains that are primarily the results of
184 # repeats and degenerate DNA
185 # usage:
186 # chainAntiRepeat tNibDir qNibDir inChain outChain
187 # options:
188 # -minScore=N - minimum score (after repeat stuff) to pass
189 # -noCheckScore=N - score that will pass without checks (speed tweak)
190 0 my $cmd
191 = "axtChain -minScore=$opt->{minscore} -linearGap=$opt->{lineargap} -psl"
192 . " $file"
193 . " $args->[0]/chr.2bit"
194 . " $args->[1]/chr.2bit"
195 . " stdout"
196 . " | chainAntiRepeat"
197 . " $args->[0]/chr.2bit"
198 . " $args->[1]/chr.2bit"
199 . " stdin"
200 . " $output";
201 0 App::Egaz::Common::exec_cmd( $cmd, { verbose => $opt->{verbose}, } );
202 }
203 0 );
204 }
205  
206 #----------------------------#
207 # chainMergeSort and chainPreNet
208 #----------------------------#
209 {
210 # This step would open all .chain files and reach system's maxfile limit.
211 # So merge 100 files a time.
212 #
213 # chainMergeSort - Combine sorted files into larger sorted file
214 # usage:
215 # chainMergeSort file(s)
216 # Output goes to standard output
217 # options:
218 # -saveId - keep the existing chain ids.
219 # -inputList=somefile - somefile contains list of input chain files.
220 # -tempDir=somedir/ - somedir has space for temporary sorting data, default ./
221 0 my @files = File::Find::Rule->file->name('*.chain')->in( $outdir->stringify );
222 0 my $i = 1;
223 0 ▶ while ( scalar @files ) {
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @files) 0 0 0
224 0 my @batching = splice @files, 0, 100;
225  
226 0 Path::Tiny::path( $outdir, "chainList.tmp" )->spew( [ map {"$_\n"} @batching ] );
227  
228 0 my $cmd
229 = "chainMergeSort"
230 . " -inputList="
231 . Path::Tiny::path( $outdir, "chainList.tmp" )->stringify
232 . " > $outdir/all.$i.chain.tmp";
233 0 App::Egaz::Common::exec_cmd( $cmd, { verbose => $opt->{verbose}, } );
234 0 Path::Tiny::path( $outdir, "chainList.tmp" )->remove;
235  
236 0 $i++;
237 }
238  
239 0 my $cmd = "chainMergeSort" . " $outdir/all.*.chain.tmp" . " > $outdir/all.chain";
240 0 App::Egaz::Common::exec_cmd( $cmd, { verbose => $opt->{verbose}, } );
241  
242 # chainPreNet - Remove chains that don't have a chance of being netted
243 # usage:
244 # chainPreNet in.chain target.sizes query.sizes out.chain
245 0 $cmd
246 = "chainPreNet"
247 . " $outdir/all.chain"
248 . " $args->[0]/chr.sizes"
249 . " $args->[1]/chr.sizes"
250 . " $outdir/all.pre.chain";
251 0 App::Egaz::Common::exec_cmd( $cmd, { verbose => $opt->{verbose}, } );
252 }
253  
254 #----------------------------#
255 # chain-net
256 #----------------------------#
257 {
258 # chainNet - Make alignment nets out of chains
259 # usage:
260 # chainNet in.chain target.sizes query.sizes target.net query.net
261 #
262 # netSyntenic - Add synteny info to net.
263 # usage:
264 # netSyntenic in.net out.net
265 0 my $cmd
266 = "chainNet -minSpace=1"
267 . " $outdir/all.pre.chain"
268 . " $args->[0]/chr.sizes"
269 . " $args->[1]/chr.sizes"
270 . " stdout" # $dir_lav/target.chainnet
271 . " $outdir/query.chainnet" . " | netSyntenic" . " stdin" . " $outdir/noClass.net";
272 0 App::Egaz::Common::exec_cmd( $cmd, { verbose => $opt->{verbose}, } );
273  
274 # netChainSubset - Create chain file with subset of chains that appear in
275 # the net
276 # usage:
277 # netChainSubset in.net in.chain out.chain
278 # options:
279 # -gapOut=gap.tab - Output gap sizes to file
280 # -type=XXX - Restrict output to particular type in net file
281 # -splitOnInsert - Split chain when get an insertion of another chain
282 # -wholeChains - Write entire chain references by net, don't split
283 # when a high-level net is encoundered. This is useful when nets
284 # have been filtered.
285 # -skipMissing - skip chains that are not found instead of generating
286 # an error. Useful if chains have been filtered.
287 #
288 # chainStitchId - Join chain fragments with the same chain ID into a single
289 # chain per ID. Chain fragments must be from same original chain but
290 # must not overlap. Chain fragment scores are summed.
291 # usage:
292 # chainStitchId in.chain out.chain
293 0 $cmd
294 = "netChainSubset -verbose=0 $outdir/noClass.net"
295 . " $outdir/all.chain"
296 . " stdout"
297 . " | chainStitchId"
298 . " stdin"
299 . " $outdir/over.chain";
300 0 App::Egaz::Common::exec_cmd( $cmd, { verbose => $opt->{verbose}, } );
301  
302 # netSplit - Split a genome net file into chromosome net files
303 # usage:
304 # netSplit in.net outDir
305 0 $cmd = "netSplit" . " $outdir/noClass.net" . " $outdir/net";
306 0 App::Egaz::Common::exec_cmd( $cmd, { verbose => $opt->{verbose}, } );
307 }
308  
309 #----------------------------#
310 # netToAxt
311 #----------------------------#
312 {
313 0 my @files = File::Find::Rule->file->name('*.net')->in("$outdir/net");
314 0 printf STDERR "* .net files: [%d]\n", scalar @files;
315  
316 0 my $mce = MCE->new( chunk_size => 1, max_workers => $opt->{parallel}, );
317 $mce->foreach(
318 [ sort @files ],
319 0 ▶ sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
320 0 my ( $self, $chunk_ref, $chunk_id ) = @_;
321  
322 0 my $file = $chunk_ref->[0];
323 0 my $output = Path::Tiny::path($file)->basename;
324 0 $output .= ".axt.gz";
325  
326 # netToAxt - Convert net (and chain) to axt.
327 # usage:
328 # netToAxt in.net in.chain target.2bit query.2bit out.axt
329 # note:
330 # directories full of .nib files (an older format)
331 # may also be used in place of target.2bit and query.2bit.
332 #
333 # axtSort - Sort axt files
334 # usage:
335 # axtSort in.axt out.axt
336 0 my $cmd
337 = "netToAxt"
338 . " $file"
339 . " $outdir/all.pre.chain"
340 . " $args->[0]/chr.2bit"
341 . " $args->[1]/chr.2bit"
342 . " stdout"
343 . " | axtSort stdin stdout"
344 . " | $gzip_bin >"
345 . " $outdir/axtNet/$output";
346 0 App::Egaz::Common::exec_cmd( $cmd, { verbose => $opt->{verbose}, } );
347 }
348 0 );
349  
350 }
351  
352 #----------------------------#
353 # clean
354 #----------------------------#
355 {
356 0 my $cwd = Path::Tiny->cwd;
357 0 chdir $outdir;
358  
359 # bsdtar (mac) doesn't support `--remove-files`
360 0 ▶ if ( !-e "lav.tar.gz" ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (-e "lav.tar.gz") 0 0 0
361 App::Egaz::Common::exec_cmd( "tar -cf - *.lav | $gzip_bin > lav.tar.gz",
362 0 { verbose => $opt->{verbose}, } );
363 }
364 0 for ( Path::Tiny::path(".")->children(qr/\.lav$/) ) {
365 0 $_->remove;
366 }
367  
368 App::Egaz::Common::exec_cmd( "tar -cf - net/ | $gzip_bin > net.tar.gz",
369 0 { verbose => $opt->{verbose}, } );
370 0 Path::Tiny::path("net")->remove_tree;
371  
372 App::Egaz::Common::exec_cmd( "tar -cf - *.psl | $gzip_bin > psl.tar.gz",
373 0 { verbose => $opt->{verbose}, } );
374 0 for ( Path::Tiny::path(".")->children(qr/^.+\.psl$/) ) {
375 0 $_->remove;
376 }
377  
378 0 for ( Path::Tiny::path(".")->children(qr/\.tmp$/) ) {
379 0 $_->remove;
380 }
381  
382 0 for my $p (qw{all all.pre over}) {
383 0 App::Egaz::Common::exec_cmd( "$gzip_bin $p.chain", { verbose => $opt->{verbose}, } );
384 }
385  
386 App::Egaz::Common::exec_cmd( "tar -cf - *.chain | $gzip_bin > chain.tar.gz",
387 0 { verbose => $opt->{verbose}, } );
388 0 for ( Path::Tiny::path(".")->children(qr/^.+\.chain$/) ) {
389 0 $_->remove;
390 }
391  
392 0 chdir $cwd;
393 }
394  
395 #----------------------------------------------------------#
396 # axt-maf section
397 #----------------------------------------------------------#
398 0 ▶ if ( !$opt->{syn} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $opt->{'syn'}) { } 0 0 0
399 0 $outdir->child("mafNet")->mkpath();
400  
401 0 my @files = File::Find::Rule->file->name('*.axt')->in( $outdir->stringify );
402 0 ▶ @files = File::Find::Rule->file->name('*.axt.gz')->in( $outdir->stringify )
Branch: 1 branch
BranchTrueFalseTotal
if scalar @files == 0 0 0 0
403 if scalar @files == 0;
404 0 printf STDERR "* .axt files: [%d]\n", scalar @files;
405  
406 #----------------------------#
407 # axtToMaf
408 #----------------------------#
409 0 ▶ my $worker = sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
410 0 my ( $self, $chunk_ref, $chunk_id ) = @_;
411  
412 0 my $file = $chunk_ref->[0];
413 0 my $output = Path::Tiny::path($file)->basename( ".axt", ".axt.gz" );
414 0 $output = Path::Tiny::path( $outdir, "mafNet", "$output.maf.gz" )->stringify;
415  
416 # axtToMaf - Convert from axt to maf format
417 # usage:
418 # axtToMaf in.axt tSizes qSizes out.maf
419 # Where tSizes and qSizes is a file that contains
420 # the sizes of the target and query sequences.
421 # Very often this with be a chrom.sizes file
422 # Options:
423 # -qPrefix=XX. - add XX. to start of query sequence name in maf
424 # -tPrefix=YY. - add YY. to start of target sequence name in maf
425 # -tSplit Create a separate maf file for each target sequence.
426 # In this case output is a dir rather than a file
427 # In this case in.maf must be sorted by target.
428 # -score - recalculate score
429 # -scoreZero - recalculate score if zero
430 0 my $cmd
431 = "axtToMaf"
432 . " -tPrefix=$opt->{tname}."
433 . " -qPrefix=$opt->{qname}."
434 . " $file"
435 . " $args->[0]/chr.sizes"
436 . " $args->[1]/chr.sizes"
437 . " stdout"
438 . " | $gzip_bin >"
439 . " $output";
440 0 App::Egaz::Common::exec_cmd( $cmd, { verbose => $opt->{verbose}, } );
441 0 };
442  
443 0 my $mce = MCE->new( chunk_size => 1, max_workers => $opt->{parallel}, );
444 0 $mce->foreach( [ sort @files ], $worker );
445 }
446 else {
447 0 for my $d (qw{chain synNet mafSynNet}) {
448 0 $outdir->child($d)->mkpath();
449 }
450  
451 #----------------------------#
452 # synNetMaf
453 #----------------------------#
454  
455 {
456 # netFilter - Filter out parts of net. What passes
457 # filter goes to standard output. Note a net is a
458 # recursive data structure. If a parent fails to pass
459 # the filter, the children are not even considered.
460 # usage:
461 # netFilter in.net(s)
462 0 my $cmd
463 = "netFilter" . " -syn"
464 . " $outdir/noClass.net"
465 . " | netSplit stdin"
466 . " $outdir/synNet";
467 0 App::Egaz::Common::exec_cmd( $cmd, { verbose => $opt->{verbose}, } );
468 }
469  
470 {
471 # chainSplit - Split chains up by target or query sequence
472 # usage:
473 # chainSplit outDir inChain(s)
474 # options:
475 # -q - Split on query (default is on target)
476 # -lump=N Lump together so have only N split files.
477 0 my $cmd = "chainSplit" . " $outdir/chain" . " $outdir/all.chain.gz";
478 0 App::Egaz::Common::exec_cmd( $cmd, { verbose => $opt->{verbose}, } );
479 }
480  
481 {
482 0 my @files = File::Find::Rule->file->name('*.net')->in("$outdir/synNet");
483 0 printf STDERR "* .net files: [%d]\n", scalar @files;
484  
485 0 ▶ my $worker = sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
486 0 my ( $self, $chunk_ref, $chunk_id ) = @_;
487  
488 0 my $file = $chunk_ref->[0];
489 0 my $base = Path::Tiny::path($file)->basename(".net");
490 0 my $output
491 = Path::Tiny::path( $outdir, "mafSynNet", "$base.synNet.maf.gz" )->stringify;
492 0 my $chain_file = Path::Tiny::path( $outdir, "chain", "$base.chain" )->stringify;
493  
494 0 my $cmd
495 = "netToAxt"
496 . " $file"
497 . " $chain_file"
498 . " $args->[0]/chr.2bit"
499 . " $args->[1]/chr.2bit"
500 . " stdout"
501 . " | axtSort stdin stdout"
502 . " | axtToMaf"
503 . " -tPrefix=$opt->{tname}."
504 . " -qPrefix=$opt->{qname}."
505 . " stdin"
506 . " $args->[0]/chr.sizes"
507 . " $args->[1]/chr.sizes"
508 . " stdout"
509 . " | $gzip_bin >"
510 . " $output";
511 0 App::Egaz::Common::exec_cmd( $cmd, { verbose => $opt->{verbose}, } );
512  
513 0 return;
514 0 };
515  
516 0 my $mce = MCE->new( chunk_size => 1, max_workers => $opt->{parallel}, );
517 0 $mce->foreach( [ sort @files ], $worker );
518 }
519  
520 #----------------------------#
521 # clean
522 #----------------------------#
523 {
524 0 Path::Tiny::path( $outdir, "synNet" )->remove_tree;
525 0 Path::Tiny::path( $outdir, "chain" )->remove_tree;
526 }
527 }
528  
529 0 return;
530 }
531  
532 19 1;
« Egaz/Command/lastz.pm ↑ Summary Egaz/Command/raxml.pm »