| 1 | 1 | undef $VERSION; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | package Bio::Roary::CommandLine::Roary; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 1 | $Bio::Roary::CommandLine::Roary::VERSION = '3.13.0'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | # ABSTRACT: Take in FASTA files of proteins and cluster them | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use Moose; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 1 | ▶ | use Getopt::Long qw(GetOptionsFromArray); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 1 | ▶ | use Bio::Roary; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 1 | ▶ | use Bio::Roary::PrepareInputFiles; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 1 | ▶ | use Bio::Roary::QC::Report; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 1 | ▶ | use Bio::Roary::ReformatInputGFFs; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 1 | ▶ | use Bio::Roary::External::CheckTools; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 1 | ▶ | use File::Which; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 1 | ▶ | use File::Path qw(make_path); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 1 | ▶ | use Cwd qw(abs_path getcwd); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 1 | ▶ | use File::Temp; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 1 | ▶ | use File::Basename; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 1 | extends 'Bio::Roary::CommandLine::Common'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 1 | has 'args' => ( is => 'ro', isa => 'ArrayRef', required => 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 1 | has 'script_name' => ( is => 'ro', isa => 'Str', required => 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 1 | has 'help' => ( is => 'rw', isa => 'Bool', default => 0 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 1 | ▶ | has 'fasta_files' => ( is => 'rw', isa => 'ArrayRef', default => sub { [] } ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 1 | has 'output_filename' => ( is => 'rw', isa => 'Str', default => 'clustered_proteins' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 1 | has 'output_directory' => ( is => 'rw', isa => 'Str', default => '.' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 1 | has '_original_directory' => ( is => 'rw', isa => 'Str', default => '.' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 1 | has 'job_runner' => ( is => 'rw', isa => 'Str', default => 'Local' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 1 | has 'makeblastdb_exec' => ( is => 'rw', isa => 'Str', default => 'makeblastdb' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 1 | has 'blastp_exec' => ( is => 'rw', isa => 'Str', default => 'blastp' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 1 | has 'mcxdeblast_exec' => ( is => 'rw', isa => 'Str', default => 'mcxdeblast' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 1 | has 'mcl_exec' => ( is => 'rw', isa => 'Str', default => 'mcl' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 1 | has 'apply_unknowns_filter' => ( is => 'rw', isa => 'Bool', default => 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 1 | has 'cpus' => ( is => 'rw', isa => 'Int', default => 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 1 | has 'output_multifasta_files' => ( is => 'rw', isa => 'Bool', default => 0 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 1 | has 'perc_identity' => ( is => 'rw', isa => 'Num', default => 95 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 1 | has 'dont_delete_files' => ( is => 'rw', isa => 'Bool', default => 0 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 1 | has 'check_dependancies' => ( is => 'rw', isa => 'Bool', default => 0 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 1 | has 'dont_create_rplots' => ( is => 'rw', isa => 'Bool', default => 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 1 | has 'dont_run_qc' => ( is => 'rw', isa => 'Bool', default => 0 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 1 | has 'dont_split_groups' => ( is => 'rw', isa => 'Bool', default => 0 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 1 | has 'verbose_stats' => ( is => 'rw', isa => 'Bool', default => 0 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 1 | has 'translation_table' => ( is => 'rw', isa => 'Int', default => 11 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 1 | has 'mafft' => ( is => 'rw', isa => 'Bool', default => 0 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 1 | has 'allow_paralogs' => ( is => 'rw', isa => 'Bool', default => 0 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 1 | has 'group_limit' => ( is => 'rw', isa => 'Num', default => 50000 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 1 | has 'core_definition' => ( is => 'rw', isa => 'Num', default => 0.99 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 1 | has 'verbose' => ( is => 'rw', isa => 'Bool', default => 0 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 1 | has 'kraken_db' => ( is => 'rw', isa => 'Str', default => '/lustre/scratch118/infgen/pathogen/pathpipe/kraken/minikraken_20140330/' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 1 | has 'run_qc' => ( is => 'rw', isa => 'Bool', default => 0 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 1 | has '_working_directory' => ( is => 'rw', isa => 'File::Temp::Dir', lazy => 1, builder => '_build__working_directory' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 1 | has 'inflation_value' => ( is => 'rw', isa => 'Num', default => 1.5 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | sub _build__working_directory | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 1 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_build__working_directory: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 1 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 1 | return File::Temp->newdir( DIR => getcwd, CLEANUP => 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 1 | ▶ | sub BUILD { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BUILD: called CC=46 SCAR=57.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 1 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | my ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 1 | $fasta_files, $verbose, $create_rplots, $group_limit, $dont_run_qc, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | $max_threads, $dont_delete_files, $dont_split_groups, $perc_identity, $output_filename, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | $job_runner, $makeblastdb_exec, $mcxdeblast_exec, $mcl_exec, $blastp_exec, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | $apply_unknowns_filter, $cpus, $output_multifasta_files, $verbose_stats, $translation_table, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | $run_qc, $core_definition, $help, $kraken_db, $cmd_version, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | $mafft, $output_directory, $check_dependancies, $inflation_value, $allow_paralogs, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 1 | GetOptionsFromArray( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | $self->args, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 'o|output=s' => \$output_filename, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 'f|output_directory=s' => \$output_directory, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 'j|job_runner=s' => \$job_runner, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 'm|makeblastdb_exec=s' => \$makeblastdb_exec, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 'b|blastp_exec=s' => \$blastp_exec, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 'd|mcxdeblast_exec=s' => \$mcxdeblast_exec, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 'c|mcl_exec=s' => \$mcl_exec, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 'p|processors=i' => \$cpus, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 'u|apply_unknowns_filter=i' => \$apply_unknowns_filter, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 'e|output_multifasta_files' => \$output_multifasta_files, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 'i|perc_identity=i' => \$perc_identity, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 'z|dont_delete_files' => \$dont_delete_files, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 's|dont_split_groups' => \$dont_split_groups, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 'r|create_rplots' => \$create_rplots, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 'y|verbose_stats' => \$verbose_stats, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 't|translation_table=i' => \$translation_table, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 'g|group_limit=i' => \$group_limit, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 'qc|run_qc' => \$run_qc, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 'x|dont_run_qc' => \$dont_run_qc, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 'cd|core_definition=f' => \$core_definition, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 'v|verbose' => \$verbose, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 'n|mafft' => \$mafft, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 'ap|allow_paralogs' => \$allow_paralogs, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 'k|kraken_db=s' => \$kraken_db, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 'w|version' => \$cmd_version, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 'a|check_dependancies' => \$check_dependancies, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 'iv|inflation_value=f' => \$inflation_value, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 'h|help' => \$help, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 1 | ▶ | $self->version($cmd_version) if ( defined($cmd_version) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 1 | ▶ | if ( $self->version ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 0 | print $self->_version() ; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 1 | print "\nPlease cite Roary if you use any of the results it produces: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | Andrew J. Page, Carla A. Cummins, Martin Hunt, Vanessa K. Wong, Sandra Reuter, Matthew T. G. Holden, Maria Fookes, Daniel Falush, Jacqueline A. Keane, Julian Parkhill, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | \"Roary: Rapid large-scale prokaryote pan genome analysis\", Bioinformatics, 2015 Nov 15;31(22):3691-3693 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | doi: http://doi.org/10.1093/bioinformatics/btv421 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | Pubmed: 26198102\n\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 1 | ▶ | $self->help($help) if ( defined($help) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 1 | ▶ | if( $self->help ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 0 | print $self->usage_text; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 1 | ▶ | if ( defined($verbose) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 0 | $self->verbose($verbose); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 0 | $self->logger->level(10000); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 1 | ▶ | $self->check_dependancies($check_dependancies) if ( defined($check_dependancies) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 1 | ▶ | if ($self->check_dependancies) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 0 | my $check_tools = Bio::Roary::External::CheckTools->new(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 0 | $check_tools->check_all_tools; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 0 | $self->logger->error( "Roary version " . $self->_version() ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 0 | ▶ | if( @{ $self->args } < 1 ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 1 | ▶ | if ( @{ $self->args } < 2 ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | 0 | $self->logger->error("Error: You need to provide at least 2 files to build a pan genome"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 0 | die $self->usage_text; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 1 | my %basenames; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | 1 | foreach my $string (@{$self->args}) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 3 | my($base, $path, $suf) = fileparse($string); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 3 | ▶ | next unless $basenames{$base}++; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 0 | $self->logger->error("Error: GFF files must have unique basenames."); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 0 | die $self->usage_text; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 1 | ▶ | if ( @{ $self->args } < 2 ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 0 | $self->logger->error("Error: You need to provide at least 2 files to build a pan genome"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 0 | die $self->usage_text; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 1 | ▶ | $self->output_filename($output_filename) if ( defined($output_filename) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 1 | ▶ | $self->job_runner($job_runner) if ( defined($job_runner) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 1 | ▶ | $self->makeblastdb_exec($makeblastdb_exec) if ( defined($makeblastdb_exec) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 1 | ▶ | $self->blastp_exec($blastp_exec) if ( defined($blastp_exec) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | 1 | ▶ | $self->mcxdeblast_exec($mcxdeblast_exec) if ( defined($mcxdeblast_exec) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 1 | ▶ | $self->mcl_exec($mcl_exec) if ( defined($mcl_exec) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | 1 | ▶ | $self->cpus($cpus) if ( defined($cpus) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 1 | ▶ | $self->inflation_value($inflation_value) if ( defined($inflation_value)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 1 | ▶ | if ( defined($perc_identity) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | 0 | $self->perc_identity($perc_identity); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | 0 | ▶ | if ( $perc_identity < 50 ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | 0 | $self->logger->error( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | "The percentage identity is too low. Either something is wrong with your data, like contamination, or your doing something that the software isnt designed to support." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 1 | ▶ | $self->mafft($mafft) if ( defined($mafft) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | 1 | ▶ | $self->apply_unknowns_filter($apply_unknowns_filter) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | if ( defined($apply_unknowns_filter) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 1 | ▶ | if ( defined($output_multifasta_files) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | 0 | ▶ | if ( which('prank') ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 0 | $self->output_multifasta_files($output_multifasta_files); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 0 | ▶ | if ( which('mafft') ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | 0 | $self->output_multifasta_files($output_multifasta_files); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | 0 | $self->mafft(1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 0 | $self->logger->warn("PRANK not found in your PATH so using MAFFT instead to generate multiFASTA alignments."); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | 0 | $self->logger->warn("PRANK (or MAFFT) not found in your PATH so cannot generate multiFASTA alignments, skipping for now."); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 1 | ▶ | $self->dont_delete_files($dont_delete_files) if ( defined($dont_delete_files) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | 1 | ▶ | $self->dont_split_groups($dont_split_groups) if ( defined($dont_split_groups) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | 1 | ▶ | $self->dont_create_rplots(0) if ( defined($create_rplots) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | 1 | ▶ | $self->verbose_stats($verbose_stats) if ( defined $verbose_stats ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 1 | ▶ | $self->translation_table($translation_table) if ( defined($translation_table) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 1 | ▶ | $self->group_limit($group_limit) if ( defined($group_limit) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | 1 | ▶ | $self->kraken_db($kraken_db) if ( defined($kraken_db) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | 1 | ▶ | $self->output_directory($output_directory) if ( defined($output_directory) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | 1 | ▶ | if ( defined $verbose_stats && defined($output_multifasta_files) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $verbose_stats and defined $output_multifasta_files
MC/DC0%0/2
defined $verbose_stats and defined $output_multifasta_files
defined $verbose_stats
defined $output_multifasta_files
Truth table33%1/3
A and B
A= defined $verbose_statsB= defined $output_multifasta_files
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | 0 | $self->verbose_stats(0); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | 0 | $self->logger->warn("The verbose stats spreadsheet is not compatible with the core gene alignement so disabling verbose_stats"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | 1 | ▶ | if ( defined($run_qc) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | 0 | ▶ | if ( which('kraken') && which('kraken-report') ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
which("kraken") and which("kraken-report")
MC/DC0%0/2
which("kraken") and which("kraken-report")
which("kraken")
which("kraken-report")
Truth table0%0/3
A and B
A= which("kraken")B= which("kraken-report")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | 0 | $self->run_qc($run_qc); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 0 | $self->logger->warn("kraken or kraken-report not found in your PATH so cannot run QC, skipping for now."); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | 1 | ▶ | if ( $self->cpus > 1 ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | 0 | $self->job_runner('Parallel'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | 1 | ▶ | $self->core_definition( $core_definition / 100 ) if ( defined($core_definition) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | 1 | for my $filename ( @{ $self->args } ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 3 | ▶ | if ( !-e $filename ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | 0 | $self->logger->error("Error: Cant access file $filename"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | 0 | die $self->usage_text; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 3 | push( @{ $self->fasta_files }, abs_path($filename) ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | 1 | ▶ | $self->_working_directory( File::Temp->newdir( DIR => getcwd, CLEANUP => 0 ) ) if ( $self->dont_delete_files ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | 1 | ▶ | sub _setup_output_directory { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_setup_output_directory: called CC=9 SCAR=41.6
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | 1 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | 1 | ▶ | return if ( $self->output_directory eq '.' || $self->output_directory eq '' ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$self->output_directory eq "." or $self->output_directory eq ""
MC/DC0%0/2
$self->output_directory eq "." or $self->output_directory eq ""
$self->output_directory eq "."
$self->output_directory eq ""
Truth table33%1/3
A or B
A= $self->output_directory eq "."B= $self->output_directory eq ""
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | 0 | ▶ | if ( -e $self->output_directory || -d $self->output_directory ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
-e $self->output_directory or -d $self->output_directory
MC/DC0%0/2
-e $self->output_directory or -d $self->output_directory
-e $self->output_directory
-d $self->output_directory
Truth table0%0/3
A or B
A= -e $self->output_directoryB= -d $self->output_directory
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | 0 | $self->logger->warn("Output directory name exists already so adding a timestamp to the end"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | 0 | $self->output_directory( $self->output_directory() . '_' . time() ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | 0 | ▶ | if ( -e $self->output_directory || -d $self->output_directory ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
-e $self->output_directory or -d $self->output_directory
MC/DC0%0/2
-e $self->output_directory or -d $self->output_directory
-e $self->output_directory
-d $self->output_directory
Truth table0%0/3
A or B
A= -e $self->output_directoryB= -d $self->output_directory
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | 0 | die("Output directory name with time stamp exist so giving up"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | 0 | make_path( $self->output_directory, { error => \my $err } ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | 0 | ▶ | if (@$err) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | 0 | for my $diag (@$err) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | 0 | my ( $file, $message ) = %$diag; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | 0 | die("Error creating output directory $message"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | 0 | $self->logger->info( "Output directory created: " . $self->output_directory ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | 0 | $self->_original_directory( getcwd() ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | 0 | chdir( $self->output_directory ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | 0 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | 1 | ▶ | sub run { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
run: called CC=7 SCAR=23.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | 1 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | 0 | ▶ | return if($self->version || $self->help || ($self->check_dependancies && @{$self->fasta_files} < 1) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%3/9
$self->version or $self->help or $self->check_dependancies and @{$self->fasta_files;} < 1
$self->version or $self->help
$self->check_dependancies and @{$self->fasta_files;} < 1
MC/DC0%0/4
$self->version or $self->help or $self->check_dependancies and @{$self->fasta_files;} < 1
$self->version
$self->help
$self->check_dependancies
@{$self->fasta_files;} < 1
Truth table20%1/5
A or B or C and D
A= $self->versionB= $self->helpC= $self->check_dependanciesD= @{$self->fasta_files;} < 1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | 1 | $self->_setup_output_directory; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | 1 | $self->logger->info("Fixing input GFF files"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | 1 | my $reformat_input_files = Bio::Roary::ReformatInputGFFs->new( gff_files => $self->fasta_files, logger => $self->logger ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | 1 | $reformat_input_files->fix_duplicate_gene_ids(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | 1 | ▶ | if ( @{ $reformat_input_files->fixed_gff_files } == 0 ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | 0 | die( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | "All input files have been excluded from analysis. Please check you have valid GFF files, with annotation and a FASTA sequence at the end. Better still, reannotate your FASTA file with PROKKA." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | 1 | $self->fasta_files( $reformat_input_files->fixed_gff_files ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | 1 | $self->logger->info("Extracting proteins from GFF files"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | 1 | my $prepare_input_files = Bio::Roary::PrepareInputFiles->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | input_files => $self->fasta_files, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | job_runner => $self->job_runner, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | apply_unknowns_filter => $self->apply_unknowns_filter, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | cpus => $self->cpus, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | translation_table => $self->translation_table, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | verbose => $self->verbose, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | working_directory => $self->_working_directory, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | 1 | ▶ | if ( $self->run_qc ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | 0 | $self->logger->info("Running Kraken on each input assembly"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | 0 | my $qc_input_files = Bio::Roary::QC::Report->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | input_files => $self->fasta_files, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | job_runner => $self->job_runner, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | cpus => $self->cpus, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | verbose => $self->verbose, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | kraken_db => $self->kraken_db | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | 0 | $qc_input_files->report; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | 1 | my $pan_genome_obj = Bio::Roary->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | input_files => $self->fasta_files, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | fasta_files => $prepare_input_files->fasta_files, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | output_filename => $self->output_filename, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | job_runner => $self->job_runner, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | cpus => $self->cpus, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | makeblastdb_exec => $self->makeblastdb_exec, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | blastp_exec => $self->blastp_exec, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | output_multifasta_files => $self->output_multifasta_files, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | perc_identity => $self->perc_identity, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | dont_delete_files => $self->dont_delete_files, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | dont_create_rplots => $self->dont_create_rplots, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | dont_split_groups => $self->dont_split_groups, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | verbose_stats => $self->verbose_stats, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | translation_table => $self->translation_table, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | group_limit => $self->group_limit, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | core_definition => $self->core_definition, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | verbose => $self->verbose, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | mafft => $self->mafft, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | allow_paralogs => $self->allow_paralogs, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | inflation_value => $self->inflation_value, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | 1 | $pan_genome_obj->run(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | 0 | chdir( $self->_original_directory ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | 0 | ▶ | sub _version { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_version: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | 0 | ▶ | if ( defined($Bio::Roary::CommandLine::Roary::VERSION) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | 0 | return $Bio::Roary::CommandLine::Roary::VERSION . "\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | 0 | return "x.y.z\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | 0 | ▶ | sub usage_text { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
usage_text: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | 0 | return <<USAGE; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | Usage: roary [options] *.gff | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | Options: -p INT number of threads [1] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | -o STR clusters output filename [clustered_proteins] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | -f STR output directory [.] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | -e create a multiFASTA alignment of core genes using PRANK | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | -n fast core gene alignment with MAFFT, use with -e | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | -i minimum percentage identity for blastp [95] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | -cd FLOAT percentage of isolates a gene must be in to be core [99] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | -qc generate QC report with Kraken | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | -k STR path to Kraken database for QC, use with -qc | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | -a check dependancies and print versions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | -b STR blastp executable [blastp] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | -c STR mcl executable [mcl] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | -d STR mcxdeblast executable [mcxdeblast] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | -g INT maximum number of clusters [50000] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | -m STR makeblastdb executable [makeblastdb] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | -r create R plots, requires R and ggplot2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | -s dont split paralogs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | -t INT translation table [11] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | -ap allow paralogs in core alignment | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | -z dont delete intermediate files | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | -v verbose output to STDOUT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | -w print version and exit | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | -y add gene inference information to spreadsheet, doesnt work with -e | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | -iv STR Change the MCL inflation value [1.5] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | -h this help message | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | Example: Quickly generate a core gene alignment using 8 threads | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | roary -e --mafft -p 8 *.gff | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | For further info see: http://sanger-pathogens.github.io/Roary/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | USAGE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | 1 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | 1 | ▶ | no Moose; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||