<commit_before>#!/usr/bin/env perl

# Copyright [1999-2016] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics 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.

package Bio::EnsEMBL::Analysis::Hive::RunnableDB::HiveClassifyTranscriptSupport;

use strict;
use warnings;
use feature 'say';

use parent ('Bio::EnsEMBL::Analysis::Hive::RunnableDB::HiveBaseRunnableDB');

sub fetch_input {
  my $self = shift;

  my $target_db = $self->param('target_db');

  unless($target_db) {
    $self->throw("target_db not passed into param hash. Expected an input id of the format:\n".
                 "{'iid' => 'target_db_connection_hash'}");
  }

  my $target_dba = $self->hrdb_get_dba($target_db);
  $self->hrdb_set_con($target_dba,'target_db');

  my $classification_type = $self->param('classification_type');
  unless($classification_type) {
    $self->warning("The classification_type param has not been passed in so defaulting to 'standard'");
    $classification_type = 'standard';
  }

  $self->classification_type($classification_type);<commit_msg>Change to HiveClassifyTranscriptSupport.pm Added in a skip_analysis param to skip the analyses if it isn't needed, eg RNA-seq db not present<commit_after>#!/usr/bin/env perl

# Copyright [1999-2016] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics 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.

package Bio::EnsEMBL::Analysis::Hive::RunnableDB::HiveClassifyTranscriptSupport;

use strict;
use warnings;
use feature 'say';

use parent ('Bio::EnsEMBL::Analysis::Hive::RunnableDB::HiveBaseRunnableDB');

sub fetch_input {
  my $self = shift;

  if($self->param('skip_analysis')) {
    $self->complete_early('Skip analysis flag is enabled, so no classification will be carried out');
  }

  my $target_db = $self->param('target_db');

  unless($target_db) {
    $self->throw("target_db not passed into param hash. Expected an input id of the format:\n".
                 "{'iid' => 'target_db_connection_hash'}");
  }

  my $target_dba = $self->hrdb_get_dba($target_db);
  $self->hrdb_set_con($target_dba,'target_db');

  my $classification_type = $self->param('classification_type');
  unless($classification_type) {
    $self->warning("The classification_type param has not been passed in so defaulting to 'standard'");
    $classification_type = 'standard';
  }

  $self->classification_type($classification_type);
{'fraction_non_alphanumeric': 0.11065573770491803, 'fraction_numerical': 0.00702576112412178, 'mean_word_length': 4.922010398613518, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, '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': '2500101', 'n_tokens_mistral': 1044, 'n_tokens_neox': 979, 'n_words': 332}