view release on metacpan or search on metacpan
lib/Bio/VertRes/Config/CommandLine/Common.pm view on Meta::CPAN
# ABSTRACT: Create config scripts
use Moose;
use Getopt::Long qw(GetOptionsFromArray);
use Bio::VertRes::Config::CommandLine::LogParameters;
use Bio::VertRes::Config::CommandLine::ConstructLimits;
use Bio::VertRes::Config::Exceptions;
has 'args' => ( is => 'ro', isa => 'ArrayRef', required => 1 );
has 'script_name' => ( is => 'ro', isa => 'Str', required => 1 );
has 'database' => ( is => 'rw', isa => 'Str', default => 'pathogen_prok_track' );
has 'config_base' => ( is => 'rw', isa => 'Str', default => '/nfs/pathnfs05/conf' );
has 'root_base' => ( is => 'rw', isa => 'Str', default => '/lustre/scratch108/pathogen/pathpipe' );
has 'log_base' => ( is => 'rw', isa => 'Str', default => '/nfs/pathnfs05/log' );
has 'database_connect_file' =>
( is => 'rw', isa => 'Str', default => '/software/pathogen/config/database_connection_details' );
has 'reference_lookup_file' =>
( is => 'rw', isa => 'Str', default => '/lustre/scratch108/pathogen/pathpipe/refs/refs.index' );
lib/Bio/VertRes/Config/CommandLine/LogParameters.pm view on Meta::CPAN
package Bio::VertRes::Config::CommandLine::LogParameters;
# ABSTRACT: A class to represent multiple top level files. It splits out mixed config files into the correct top level files
use Moose;
use Bio::VertRes::Config::Exceptions;
use File::Basename;
use File::Path qw(make_path);
has 'args' => ( is => 'ro', isa => 'ArrayRef', required => 1 );
has 'script_name' => ( is => 'ro', isa => 'Str', required => 1 );
has 'log_file' => ( is => 'rw', isa => 'Str', default => '/tmp/command_line.log' );
has '_output_string' => ( is => 'ro', isa => 'Str', lazy => 1, builder => '_build__output_string' );
has '_user_name' => ( is => 'ro', isa => 'Str', lazy => 1, builder => '_build__user_name' );
sub BUILD {
my ($self) = @_;
#Â Build the variable just after object construction because the array ref gets modified by GetOpts
$self->_output_string;
lib/Bio/VertRes/Config/MultipleTopLevelFiles.pm view on Meta::CPAN
package Bio::VertRes::Config::MultipleTopLevelFiles;
# ABSTRACT: A class to represent multiple top level files. It splits out mixed config files into the correct top level files
use Moose;
use Bio::VertRes::Config::TopLevel;
has 'database' => ( is => 'ro', isa => 'Str', required => 1 );
has 'pipeline_configs' => ( is => 'ro', isa => 'ArrayRef', required => 1 );
has 'config_base' => ( is => 'ro', isa => 'Str', required => 1 );
sub update_or_create {
my ($self) = @_;
my %short_name_to_configs;
#Â split by short name
for my $pipeline_config ( @{ $self->pipeline_configs } ) {
#Â Create the config file
lib/Bio/VertRes/Config/Pipelines/Common.pm view on Meta::CPAN
has 'root_pipeline_suffix' => ( is => 'ro', isa => 'Str', default => 'seq-pipelines' );
has 'database' => ( is => 'ro', isa => 'Str', required => 1 );
has 'host' => ( is => 'ro', isa => 'Str', lazy => 1, builder => '_build_host' );
has 'port' => ( is => 'ro', isa => 'Int', lazy => 1, builder => '_build_port' );
has 'user' => ( is => 'ro', isa => 'Str', lazy => 1, builder => '_build_user' );
has 'password' => ( is => 'ro', isa => 'Maybe[Str]', lazy => 1, builder => '_build_password' );
has 'database_connect_file' => ( is => 'ro', isa => 'Str', required => 1 );
has '_database_connection_details' =>
( is => 'ro', isa => 'Maybe[HashRef]', lazy => 1, builder => '_build__database_connection_details' );
sub _build_root {
my ($self) = @_;
join( '/', ( $self->root_base, $self->root_database_name, $self->root_pipeline_suffix ) );
}
sub _build_config {
my ($self) = @_;
my $conf_file_name = join( '_', ( $self->pipeline_short_name, $self->config_file_name ) );
join( '/', ( $self->config_base, $self->root_database_name, $self->pipeline_short_name, $conf_file_name ) );
lib/Bio/VertRes/Config/Pipelines/Roles/MetaDataFilter.pm view on Meta::CPAN
package Bio::VertRes::Config::Pipelines::Roles::MetaDataFilter;
# ABSTRACT: Moose Role for dealing with limits meta data filters
use Moose::Role;
has 'limits' => ( is => 'ro', isa => 'HashRef', required => 1 );
has '_escaped_limits' => ( is => 'ro', isa => 'HashRef', lazy => 1, builder => '_build__escaped_limits' );
sub _build__escaped_limits
{
my ($self) = @_;
my %escaped_limits;
for my $limit_type (keys %{$self->limits})
{
my @escaped_array_values;
for my $array_value ( @{$self->limits->{$limit_type}})
lib/Bio/VertRes/Config/Pipelines/Roles/RootDatabaseLookup.pm view on Meta::CPAN
package Bio::VertRes::Config::Pipelines::Roles::RootDatabaseLookup;
# ABSTRACT: Moose Role for translating non standard database names to their area
use Moose::Role;
has 'root_database_name' => ( is => 'ro', isa => 'Str', lazy => 1, builder => '_build_root_database_name' );
has 'non_standard_databases' => ( is => 'ro', isa => 'HashRef', lazy => 1, builder => '_build_non_standard_databases' );
sub _build_root_database_name {
my ($self) = @_;
return $self->root_database_name_lookup( $self->database );
}
sub _build_non_standard_databases {
my ($self) = @_;
my %non_standard_databases = (
'pathogen_virus_track' => 'viruses',
lib/Bio/VertRes/Config/Recipes/Common.pm view on Meta::CPAN
use Moose;
use Bio::VertRes::Config::MultipleTopLevelFiles;
use Bio::VertRes::Config::CommandLine::StudyNameSearch;
has 'database' => ( is => 'rw', isa => 'Str', required => 1 );
has 'database_connect_file' => ( is => 'ro', isa => 'Str', default => '/software/pathogen/config/database_connection_details' );
has 'config_base' => ( is => 'ro', isa => 'Str', default => '/nfs/pathnfs05/conf' );
has 'root_base' => ( is => 'ro', isa => 'Str', default => '/lustre/scratch108/pathogen/pathpipe' );
has 'log_base' => ( is => 'ro', isa => 'Str', default => '/nfs/pathnfs05/log' );
has 'overwrite_existing_config_file' => ( is => 'ro', isa => 'Bool', default => 0 );
has 'limits' => ( is => 'ro', isa => 'HashRef', default => sub { {} });
has '_pipeline_configs' => ( is => 'ro', isa => 'ArrayRef', default => sub { [] });
before 'create' => sub {
my ($self) = @_;
if(defined($self->limits->{project}))
{
for my $study_name ( @{$self->limits->{project}} )
{
$self->database(Bio::VertRes::Config::CommandLine::StudyNameSearch->new(
lib/Bio/VertRes/Config/References.pm view on Meta::CPAN
package Bio::VertRes::Config::References;
# ABSTRACT: A class for translating between a reference name and the location on disk
use Moose;
use Bio::VertRes::Config::Types;
use Bio::VertRes::Config::Exceptions;
has 'reference_lookup_file' => ( is => 'ro', isa => 'Bio::VertRes::Config::File', required => 1 );
has '_reference_names_to_files' => ( is => 'ro', isa => 'HashRef', lazy => 1, builder => '_build__reference_names_to_files');
has 'available_references' => ( is => 'ro', isa => 'ArrayRef', lazy => 1, builder => '_build_available_references');
sub _build__reference_names_to_files
{
my ($self) = @_;
my %reference_names_to_files;
open(my $index_file, $self->reference_lookup_file) or Bio::VertRes::Config::Exceptions::FileDoesntExist->throw(error => 'Couldnt open file '.$self->reference_lookup_file);
while(<$index_file>)
{
chomp;
my $line = $_;
lib/Bio/VertRes/Config/TopLevel.pm view on Meta::CPAN
use Moose;
use File::Basename;
use File::Path qw(make_path);
use Bio::VertRes::Config::Exceptions;
with 'Bio::VertRes::Config::Pipelines::Roles::RootDatabaseLookup';
has 'pipeline_short_name' => ( is => 'ro', isa => 'Str', required => 1 );
has 'database' => ( is => 'ro', isa => 'Str', required => 1 );
has 'pipeline_configs' => ( is => 'ro', isa => 'ArrayRef', required => 1 );
has 'overall_config' => ( is => 'ro', isa => 'Str', lazy => 1, builder => '_build_overall_config' );
has 'config_base' => ( is => 'ro', isa => 'Str', required => 1 );
has 'overall_config_file_name' => ( is => 'ro', isa => 'Str', lazy => 1, builder => '_build_overall_config_file_name' );
has '_overall_config_file_name_suffix' => ( is => 'ro', isa => 'Str', default => 'pipeline.conf' );
has '_filenames_to_action' => ( is => 'ro', isa => 'HashRef', lazy => 1, builder => '_build__filenames_to_action' );
has '_filenames_to_action' => ( is => 'ro', isa => 'HashRef', lazy => 1, builder => '_build__filenames_to_action' );
sub _build_overall_config_file_name {
my ($self) = @_;
return join( '_', ( $self->root_database_name, $self->pipeline_short_name, 'pipeline.conf' ) );
}
sub _build_overall_config {
my ($self) = @_;
return join( '/', ( $self->config_base, $self->root_database_name, $self->overall_config_file_name ) );
}