<commit_before>=head1 LICENSE

Copyright [1999-2014] EMBL-European Bioinformatics Institute
and Wellcome Trust Sanger Institute

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

=cut


=pod

=head1 NAME

Bio::EnsEMBL::EGPipeline::PipeConfig::BlastProtein_conf

=head1 DESCRIPTION

Align amino acids sequences against a set of core databases.

=head1 Author

<NAME>

=cut

package Bio::EnsEMBL::EGPipeline::PipeConfig::BlastProtein_conf;

use strict;
use warnings;

use base ('Bio::EnsEMBL::EGPipeline::PipeConfig::EGGeneric_conf');

use Bio::EnsEMBL::Hive::Version 2.4;

use File::Spec::Functions qw(catdir);

sub default_options {
  my $self = shift @_;
  return {
    %{$self->SUPER::default_options},
    
    pipeline_name => 'blast_protein_'.$self->o('ensembl_release'),
    
    species      => [],
    antispecies  => [],
    division     => [],
    run_all      => 0,
    meta_filters => {},
    
    # Parameters for dumping and splitting Fasta query files.
    max_seq_length          => 10000000,
    max_seq_length_per_file => $self->o('max_seq_length'),
    max_seqs_per_file       => 500,
    max_files_per_directory => 100,
    max_dirs_per_directory  => $self->o('max_files_per_directory'),
    
    max_hive_capacity => 100,
    
    # Source for proteomes can be one of: 'file', 'database', 'uniprot'
    proteome_source    => 'file',
    logic_name_prefix  => $self->o('proteome_source'),
    source_label       => 'Protein alignments',
    is_canonical       => 1,
    
    # This parameter should only be specified if proteome_source = 'file'
    db_fasta_file => undef,
    
    # Dump the proteomes of other species and align them.
    source_species      => [],
    source_antispecies  => [],
    source_division     => [],
    source_run_all      => 0,
    source_meta_filters => {},
    
    # Taxonomic level is one of 'fungi', 'invertebrates', 'plants';
    # the UniProt source can be 'sprot' or 'trembl'.
    uniprot_ftp_uri  => 'ftp://ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/taxonomic_divisions',
    taxonomic_level  => 'invertebrates',
    uniprot_source   => 'sprot',
    taxonomic_levels => [$self->o('taxonomic_level')],
    uniprot_sources  => [$self->o('uniprot_source')],
    uniprot_dir      => catdir($self->o('pipeline_dir'), 'uniprot'),
    
    # Default is to use ncbi-blast; wu-blast is possible, for backwards
    # compatability, but it is now unsupported and orders of magnitude
    # slower than ncbi-blast. Setting BLASTMAT is irrelevant for ncbi-blast,
    # but the Ensembl code requires it to be set as an environment variable,
    # pointing to a directory that exists.
    blast_type       => 'ncbi',
    blast_dir        => '/nfs/panda/ensemblgenomes/external/ncbi-blast-2+',
    makeblastdb_exe  => catdir($self->o('blast_dir'), 'bin/makeblastdb'),
    blastp_exe       => catdir($self->o('blast_dir'), 'bin/blastp'),
    blastx_exe       => catdir($self->o('blast_dir'), 'bin/blastx'),
    blast_matrix     => undef,
    blast_threads    => 3,
    blast_parameters => '-word_size 3 -num_alignments 100000 -num_descriptions 100000 -lcase_masking -seg yes -num_threads '.$self->o('blast_threads'),
    
    # For wu-blast, set the following  parameters instead of the above.
    # blast_type       => 'wu',
    # blast_dir        => '/nfs/panda/ensemblgenomes/external/wublast',
    # makeblastdb_exe  => catdir($self->o('blast_dir'), 'wu-formatdb'),
    # blastp_exe       => catdir($self->o('blast_dir'), 'blastp'),
    # blastx_exe       => catdir($self->o('blast_dir'), 'blastx'),
    # blast_matrix     => catdir($self->o('blast_dir'), 'matrix'),
    # blast_parameters => '-W 3 -B 100000 -V 100000 -hspmax=0 -lcmask -wordmask=seg',
    
    # For parsing the output.
    output_regex     => '^\s*([\w\-]+)',
    pvalue_threshold => 0.01,
    filter_prune     => 1,
    filter_min_score => 200,
    
    # By default, do both blastp and blastx.
    # Specify blast_db if you don't want it in the directory alongside db_file.
    blast_db => undef,
    blastp   => 1,
    blastx   => 1,
    
    # Filter so that only best X hits get saved.
    filter_top_x => 1,
    blastp_top_x => 1,
    blastx_top_x => 10,
    
    # Generate a GFF file for loading into, e.g., WebApollo
    create_gff    => 0,
    gt_exe        => '/nfs/panda/ensemblgenomes/external/genometools/bin/gt',
    gff3_tidy     => $self->o('gt_exe').' gff3 -tidy -sort -retainids',
    gff3_validate => $self->o('gt_exe').' gff3validator',
    
    analyses =>
    [
      {
        'logic_name'    => 'blastp',
        'display_label' => $self->o('source_label'),
        'description'   => 'Peptide sequences aligned to the proteome with <em>blastp</em>.',
        'displayable'   => 1,<commit_msg>Revert regex for hitname, to exclude hyphens<commit_after>=head1 LICENSE

Copyright [1999-2014] EMBL-European Bioinformatics Institute
and Wellcome Trust Sanger Institute

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

=cut


=pod

=head1 NAME

Bio::EnsEMBL::EGPipeline::PipeConfig::BlastProtein_conf

=head1 DESCRIPTION

Align amino acids sequences against a set of core databases.

=head1 Author

<NAME>

=cut

package Bio::EnsEMBL::EGPipeline::PipeConfig::BlastProtein_conf;

use strict;
use warnings;

use base ('Bio::EnsEMBL::EGPipeline::PipeConfig::EGGeneric_conf');

use Bio::EnsEMBL::Hive::Version 2.4;

use File::Spec::Functions qw(catdir);

sub default_options {
  my $self = shift @_;
  return {
    %{$self->SUPER::default_options},
    
    pipeline_name => 'blast_protein_'.$self->o('ensembl_release'),
    
    species      => [],
    antispecies  => [],
    division     => [],
    run_all      => 0,
    meta_filters => {},
    
    # Parameters for dumping and splitting Fasta query files.
    max_seq_length          => 10000000,
    max_seq_length_per_file => $self->o('max_seq_length'),
    max_seqs_per_file       => 500,
    max_files_per_directory => 100,
    max_dirs_per_directory  => $self->o('max_files_per_directory'),
    
    max_hive_capacity => 100,
    
    # Source for proteomes can be one of: 'file', 'database', 'uniprot'
    proteome_source    => 'file',
    logic_name_prefix  => $self->o('proteome_source'),
    source_label       => 'Protein alignments',
    is_canonical       => 1,
    
    # This parameter should only be specified if proteome_source = 'file'
    db_fasta_file => undef,
    
    # Dump the proteomes of other species and align them.
    source_species      => [],
    source_antispecies  => [],
    source_division     => [],
    source_run_all      => 0,
    source_meta_filters => {},
    
    # Taxonomic level is one of 'fungi', 'invertebrates', 'plants';
    # the UniProt source can be 'sprot' or 'trembl'.
    uniprot_ftp_uri  => 'ftp://ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/taxonomic_divisions',
    taxonomic_level  => 'invertebrates',
    uniprot_source   => 'sprot',
    taxonomic_levels => [$self->o('taxonomic_level')],
    uniprot_sources  => [$self->o('uniprot_source')],
    uniprot_dir      => catdir($self->o('pipeline_dir'), 'uniprot'),
    
    # Default is to use ncbi-blast; wu-blast is possible, for backwards
    # compatability, but it is now unsupported and orders of magnitude
    # slower than ncbi-blast. Setting BLASTMAT is irrelevant for ncbi-blast,
    # but the Ensembl code requires it to be set as an environment variable,
    # pointing to a directory that exists.
    blast_type       => 'ncbi',
    blast_dir        => '/nfs/panda/ensemblgenomes/external/ncbi-blast-2+',
    makeblastdb_exe  => catdir($self->o('blast_dir'), 'bin/makeblastdb'),
    blastp_exe       => catdir($self->o('blast_dir'), 'bin/blastp'),
    blastx_exe       => catdir($self->o('blast_dir'), 'bin/blastx'),
    blast_matrix     => undef,
    blast_threads    => 3,
    blast_parameters => '-word_size 3 -num_alignments 100000 -num_descriptions 100000 -lcase_masking -seg yes -num_threads '.$self->o('blast_threads'),
    
    # For wu-blast, set the following  parameters instead of the above.
    # blast_type       => 'wu',
    # blast_dir        => '/nfs/panda/ensemblgenomes/external/wublast',
    # makeblastdb_exe  => catdir($self->o('blast_dir'), 'wu-formatdb'),
    # blastp_exe       => catdir($self->o('blast_dir'), 'blastp'),
    # blastx_exe       => catdir($self->o('blast_dir'), 'blastx'),
    # blast_matrix     => catdir($self->o('blast_dir'), 'matrix'),
    # blast_parameters => '-W 3 -B 100000 -V 100000 -hspmax=0 -lcmask -wordmask=seg',
    
    # For parsing the output.
    output_regex     => '^\s*(\w+)',
    pvalue_threshold => 0.01,
    filter_prune     => 1,
    filter_min_score => 200,
    
    # By default, do both blastp and blastx.
    # Specify blast_db if you don't want it in the directory alongside db_file.
    blast_db => undef,
    blastp   => 1,
    blastx   => 1,
    
    # Filter so that only best X hits get saved.
    filter_top_x => 1,
    blastp_top_x => 1,
    blastx_top_x => 10,
    
    # Generate a GFF file for loading into, e.g., WebApollo
    create_gff    => 0,
    gt_exe        => '/nfs/panda/ensemblgenomes/external/genometools/bin/gt',
    gff3_tidy     => $self->o('gt_exe').' gff3 -tidy -sort -retainids',
    gff3_validate => $self->o('gt_exe').' gff3validator',
    
    analyses =>
    [
      {
        'logic_name'    => 'blastp',
        'display_label' => $self->o('source_label'),
        'description'   => 'Peptide sequences aligned to the proteome with <em>blastp</em>.',
        'displayable'   => 1,
{'fraction_non_alphanumeric': 0.12739399714149596, 'fraction_numerical': 0.016388756550738445, 'mean_word_length': 3.1306572215663127, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 171, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1415883', 'n_tokens_mistral': 3736, 'n_tokens_neox': 3409, 'n_words': 881}