App-Dazz
view release on metacpan or search on metacpan
lib/App/Dazz/Command/group.pm view on Meta::CPAN
package App::Dazz::Command::group;
use strict;
use warnings;
use autodie;
use App::Dazz -command;
use App::Dazz::Common;
use constant abstract => "group anchors by long reads";
sub opt_spec {
return (
[ "dir|d=s", "output directory", ],
[ "range|r=s", "ranges of anchors", { required => 1 }, ],
[ "coverage|c=i", "minimal coverage", { default => 2 }, ],
[ "max=i", "max distance", { default => 5000 }, ],
[ "len|l=i", "minimal length of overlaps", { default => 1000 }, ],
[ "idt|i=f", "minimal identity of overlaps", { default => 0.85 }, ],
[ "keep", "don't remove multi-matched reads", ],
[ 'oa=s', 'overlaps between anchors', ],
[ "parallel|p=i", "number of threads", { default => 4 }, ],
[ "verbose|v", "verbose mode", ],
[ "png", "write a png file via graphviz", ],
{ show_defaults => 1, }
);
}
# ä¸ä»£ reads éæä¸ä¸ªå¸¸è§çé误, å³åä¸ ZMW éçæµåºç»æä¸, æ¥å¤´åºåé¨åçæµåºç»æåºç°äºè¾å¤çé误,
# å æ¤å¹¶æ²¡æå°æ¥å¤´åºåå»é¤å¹²å, å½¢æç subreads é嫿å¤ä»½åºå ç»ä¸åä¸ç段, å®ä»¬ä¹é´ä»¥æ¥å¤´åºå为é´é.
#
# `dazz group` å½ä»¤é»è®¤ä¼å°è¿ç§ä¸ä»£ç reads å»é¤. `--keep` é项ä¼çä¸è¿ç§ reads, è¿éç¨äºç»è£
好çä¸ä»£åºå.
#
# ```text
# ===
# ------------>
# )
# <----------
# ===
# ```
sub usage_desc {
return "dazz group [options] <dazz DB> <ovlp file>";
}
sub description {
my $desc;
$desc .= ucfirst(abstract) . ".\n";
$desc .= "\tThis command relies on an existing dazz db.\n";
return $desc;
}
sub validate_args {
my ( $self, $opt, $args ) = @_;
if ( @{$args} != 2 ) {
my $message = "This command need one or more input files.\n\tIt found";
$message .= sprintf " [%s]", $_ for @{$args};
$message .= ".\n";
$self->usage_error($message);
}
for ( @{$args} ) {
if ( !Path::Tiny::path($_)->is_file ) {
$self->usage_error("The input file [$_] doesn't exist.");
}
}
if ( !AlignDB::IntSpan->valid( $opt->{range} ) ) {
$self->usage_error("Invalid --range [$opt->{range}]\n");
}
if ( $opt->{oa} ) {
if ( !Path::Tiny::path( $opt->{oa} )->is_file ) {
$self->usage_error("The overlap file [$opt->{oa}] doesn't exist.\n");
}
}
if ( !exists $opt->{dir} ) {
$opt->{dir}
= Path::Tiny::path( $args->[0] )->parent->child("group")->absolute->stringify;
}
( run in 0.889 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )