Skip to content

Commit

Permalink
allow for inflation factor for MCL to be changed
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjpage committed May 21, 2017
1 parent 7a97f5a commit ec1793e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = Bio-Roary
version = 3.8.0
version = 3.8.1
author = Andrew J. Page <ap13@sanger.ac.uk>
license = GPL_3
copyright_holder = Wellcome Trust Sanger Institute
Expand Down
2 changes: 2 additions & 0 deletions lib/Bio/Roary.pm
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ has 'group_limit' => ( is => 'rw', isa => 'Num', default =
has 'core_definition' => ( is => 'rw', isa => 'Num', default => 1.0 );
has 'verbose' => ( is => 'rw', isa => 'Bool', default => 0 );
has 'mafft' => ( is => 'ro', isa => 'Bool', default => 0 );
has 'inflation_value' => ( is => 'rw', isa => 'Num', default => 1.5 );

has 'output_multifasta_files' => ( is => 'ro', isa => 'Bool', default => 0 );

Expand Down Expand Up @@ -108,6 +109,7 @@ sub run {
mcl_exec => $self->mcl_exec,
job_runner => $self->job_runner,
cpus => $self->cpus,
inflation_value => $self->inflation_value,
output_file => $output_mcl_filename
);
$mcl->run();
Expand Down
7 changes: 6 additions & 1 deletion lib/Bio/Roary/CommandLine/Roary.pm
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ has 'kraken_db' => ( is => 'rw', isa => 'Str', default => '/lustre/scratch118/i
has 'run_qc' => ( is => 'rw', isa => 'Bool', default => 0 );
has '_working_directory' => ( is => 'rw', isa => 'File::Temp::Dir', lazy => 1, builder => '_build__working_directory' );

has 'inflation_value' => ( is => 'rw', isa => 'Num', default => 1.5 );

sub _build__working_directory
{
my ($self) = @_;
Expand All @@ -69,7 +71,7 @@ sub BUILD {
$job_runner, $makeblastdb_exec, $mcxdeblast_exec, $mcl_exec, $blastp_exec,
$apply_unknowns_filter, $cpus, $output_multifasta_files, $verbose_stats, $translation_table,
$run_qc, $core_definition, $help, $kraken_db, $cmd_version,
$mafft, $output_directory, $check_dependancies,
$mafft, $output_directory, $check_dependancies, $inflation_value,
);

GetOptionsFromArray(
Expand Down Expand Up @@ -99,6 +101,7 @@ sub BUILD {
'k|kraken_db=s' => \$kraken_db,
'w|version' => \$cmd_version,
'a|check_dependancies' => \$check_dependancies,
'inflation_value=f' => \$inflation_value,
'h|help' => \$help,
);

Expand Down Expand Up @@ -143,6 +146,7 @@ sub BUILD {
$self->mcxdeblast_exec($mcxdeblast_exec) if ( defined($mcxdeblast_exec) );
$self->mcl_exec($mcl_exec) if ( defined($mcl_exec) );
$self->cpus($cpus) if ( defined($cpus) );
$self->inflation_value($inflation_value) if ( defined($inflation_value));

if ( defined($perc_identity) ) {
$self->perc_identity($perc_identity);
Expand Down Expand Up @@ -298,6 +302,7 @@ sub run {
core_definition => $self->core_definition,
verbose => $self->verbose,
mafft => $self->mafft,
inflation_value => $self->inflation_value,
);
$pan_genome_obj->run();

Expand Down
4 changes: 2 additions & 2 deletions lib/Bio/Roary/External/Mcl.pm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ has 'output_file' => ( is => 'ro', isa => 'Str', default => 'output_groups'

has '_score' => ( is => 'ro', isa => 'Str', default => 'r' );

has '_inflation_value' => ( is => 'ro', isa => 'Num', default => 1.5 );
has 'inflation_value' => ( is => 'ro', isa => 'Num', default => 1.5 );
has '_logging' => ( is => 'ro', isa => 'Str', default => '> /dev/null 2>&1' );

has 'memory_in_mb' => ( is => 'ro', isa => 'Int', lazy => 1, builder => '_build_memory_in_mb' );
Expand Down Expand Up @@ -84,7 +84,7 @@ sub _command_to_run {
$self->_full_mcxdeblast_exec, '-m9', '--score='.$self->_score,
'--line-mode=abc', $self->blast_results, '2> /dev/null',
'|', $self->mcl_exec, '-', '--abc',
'-I', $self->_inflation_value, '-o', $self->output_file,
'-I', $self->inflation_value, '-o', $self->output_file,
$self->_logging
)
);
Expand Down

0 comments on commit ec1793e

Please sign in to comment.