« CLIPSeqTools/CompareApp/libraries_overlap_stats.pm
↑ Summary
CLIPSeqTools/App/count_reads_on_genic_elements.pm »
| 1 | =head1 NAME | ||
| 2 | |||
| 3 | CLIPSeqTools::App::all - Run all clipseqtools analyses | ||
| 4 | |||
| 5 | =head1 SYNOPSIS | ||
| 6 | |||
| 7 | clipseqtools all [options/parameters] | ||
| 8 | |||
| 9 | =head1 DESCRIPTION | ||
| 10 | |||
| 11 | Run all clipseqtools analyses. | ||
| 12 | |||
| 13 | =head1 OPTIONS | ||
| 14 | |||
| 15 | Input options for library. | ||
| 16 | --driver <Str> driver for database connection (eg. mysql, | ||
| 17 | SQLite). | ||
| 18 | --database <Str> database name or path to database file for file | ||
| 19 | based databases (eg. SQLite). | ||
| 20 | --table <Str> database table. | ||
| 21 | --host <Str> hostname for database connection. | ||
| 22 | --user <Str> username for database connection. | ||
| 23 | --password <Str> password for database connection. | ||
| 24 | --records_class <Str> type of records stored in database. | ||
| 25 | --filter <Filter> filter library. May be used multiple times. | ||
| 26 | Syntax: column_name="pattern" | ||
| 27 | e.g. keep reads with deletions AND not repeat | ||
| 28 | masked AND longer than 31 | ||
| 29 | -filter deletion="def" | ||
| 30 | -filter rmsk="undef" . | ||
| 31 | -filter query_length=">31". | ||
| 32 | Operators: >, >=, <, <=, =, !=, def, undef | ||
| 33 | |||
| 34 | Other input | ||
| 35 | -gtf <Str> GTF file with genes/transcripts. [Required] | ||
| 36 | -rname_sizes <Str> file with sizes for reference alignment sequences | ||
| 37 | (rnames). Must be tab delimited (chromosome\tsize) | ||
| 38 | with one line per rname. [Required] | ||
| 39 | |||
| 40 | Output | ||
| 41 | --o_prefix <Str> output path prefix. Script will create and add | ||
| 42 | extension to path. [Default: ./] | ||
| 43 | |||
| 44 | Other options. | ||
| 45 | --allowed_dis <Int> reads closer than this value are assembled in | ||
| 46 | clusters. Default: 0 | ||
| 47 | --plot call plotting script to create plots. | ||
| 48 | -v --verbose print progress lines and extra information. | ||
| 49 | -h -? --usage --help print help message | ||
| 50 | |||
| 51 | =cut | ||
| 52 | |||
| 53 | package CLIPSeqTools::App::all; | ||
| 54 | $CLIPSeqTools::App::all::VERSION = '1.0.0'; | ||
| 55 | |||
| 56 | # Make it an app command | ||
| 57 | use MooseX::App::Command; | ||
| 58 | extends 'CLIPSeqTools::App'; | ||
| 59 | |||
| 60 | |||
| 61 | ####################################################################### | ||
| 62 | ####################### Load External modules ##################### | ||
| 63 | ####################################################################### | ||
| 64 | use Modern::Perl; | ||
| 65 | use autodie; | ||
| 66 | use namespace::autoclean; | ||
| 67 | |||
| 68 | |||
| 69 | ####################################################################### | ||
| 70 | ####################### Command line options ###################### | ||
| 71 | ####################################################################### | ||
| 72 | option 'rname_sizes' => ( | ||
| 73 | is => 'rw', | ||
| 74 | isa => 'Str', | ||
| 75 | required => 1, | ||
| 76 | documentation => 'file with sizes for reference alignment sequences (rnames). Must be tab delimited (chromosome\tsize) with one line per rname.', | ||
| 77 | ); | ||
| 78 | |||
| 79 | |||
| 80 | ####################################################################### | ||
| 81 | ########################## Consume Roles ########################## | ||
| 82 | ####################################################################### | ||
| 83 | with | ||
| 84 | "CLIPSeqTools::Role::Option::Library" => { | ||
| 85 | -alias => { validate_args => '_validate_args_for_library' }, | ||
| 86 | -excludes => 'validate_args', | ||
| 87 | }, | ||
| 88 | "CLIPSeqTools::Role::Option::Genes" => { | ||
| 89 | -alias => { validate_args => '_validate_args_for_genes' }, | ||
| 90 | -excludes => 'validate_args', | ||
| 91 | }, | ||
| 92 | "CLIPSeqTools::Role::Option::Plot" => { | ||
| 93 | -alias => { validate_args => '_validate_args_for_plot' }, | ||
| 94 | -excludes => 'validate_args', | ||
| 95 | }, | ||
| 96 | "CLIPSeqTools::Role::Option::OutputPrefix" => { | ||
| 97 | -alias => { validate_args => '_validate_args_for_output_prefix' }, | ||
| 98 | -excludes => 'validate_args', | ||
| 99 | }; | ||
| 100 | |||
| 101 | |||
| 102 | ####################################################################### | ||
| 103 | ######################## Interface Methods ######################## | ||
| 104 | ####################################################################### | ||
| 105 | sub validate_args { | ||
| 106 | my ($self) = @_; | ||
| 107 | |||
| 108 | $self->_validate_args_for_library; | ||
| 109 | $self->_validate_args_for_genes; | ||
| 110 | $self->_validate_args_for_plot; | ||
| 111 | $self->_validate_args_for_output_prefix; | ||
| 112 | } | ||
| 113 | |||
| 114 | sub run { | ||
| 115 | my ($self) = @_; | ||
| 116 | |||
| 117 | my %options; | ||
| 118 | |||
| 119 | $options{'driver'} = $self->driver if defined $self->driver; | ||
| 120 | $options{'database'} = $self->database if defined $self->database; | ||
| 121 | $options{'table'} = $self->table if defined $self->table; | ||
| 122 | $options{'host'} = $self->host if defined $self->host; | ||
| 123 | $options{'user'} = $self->user if defined $self->user; | ||
| 124 | $options{'password'} = $self->password if defined $self->password; | ||
| 125 | $options{'records_class'} = $self->records_class if defined $self->records_class; | ||
| 126 | $options{'filter'} = $self->filter if defined $self->filter; | ||
| 127 | $options{'o_prefix'} = $self->o_prefix if defined $self->o_prefix; | ||
| 128 | $options{'gtf'} = $self->gtf if defined $self->gtf; | ||
| 129 | $options{'rname_sizes'} = $self->rname_sizes if defined $self->rname_sizes; | ||
| 130 | $options{'plot'} = $self->plot if defined $self->plot; | ||
| 131 | $options{'verbose'} = $self->verbose if defined $self->verbose; | ||
| 132 | |||
| 133 | CLIPSeqTools::App->initialize_command_class('CLIPSeqTools::App::cluster_size_and_score_distribution', %options)->run(); | ||
| 134 | CLIPSeqTools::App->initialize_command_class('CLIPSeqTools::App::count_reads_on_genic_elements', %options)->run(); | ||
| 135 | CLIPSeqTools::App->initialize_command_class('CLIPSeqTools::App::distribution_on_genic_elements', %options)->run(); | ||
| 136 | CLIPSeqTools::App->initialize_command_class('CLIPSeqTools::App::distribution_on_introns_exons', %options)->run(); | ||
| 137 | CLIPSeqTools::App->initialize_command_class('CLIPSeqTools::App::genome_coverage', %options)->run(); | ||
| 138 | CLIPSeqTools::App->initialize_command_class('CLIPSeqTools::App::genomic_distribution', %options)->run(); | ||
| 139 | CLIPSeqTools::App->initialize_command_class('CLIPSeqTools::App::nmer_enrichment_over_shuffled', %options)->run(); | ||
| 140 | CLIPSeqTools::App->initialize_command_class('CLIPSeqTools::App::nucleotide_composition', %options)->run(); | ||
| 141 | CLIPSeqTools::App->initialize_command_class('CLIPSeqTools::App::reads_long_gaps_size_distribution', %options)->run(); | ||
| 142 | CLIPSeqTools::App->initialize_command_class('CLIPSeqTools::App::size_distribution', %options)->run(); | ||
| 143 | CLIPSeqTools::App->initialize_command_class('CLIPSeqTools::App::conservation_distribution', %options)->run(); | ||
| 144 | } | ||
| 145 | |||
| 146 | |||
| 147 | 1; |