<commit_before>#!/usr/bin/env python
"""
Copyright 2014 Novartis Institutes for Biomedical Research

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.
"""

import os
import numpy
import time
import glob
import sys
import math
import re
import random
from yap_tools import *
from yap_file_io import *
from yap_preprocess import *
from yap_conflict_check import *
from yap_regroup_check import *
from yap_cuffdiff_check import *
from yap_cuff_merge_compare_check import *
from yap_printer import *
from yap_path_checks import *

def workflow_validator(workflow_struct, workflow_config_file, run_mode):
    """
    Given 3 parameters : Workflow Struct, configuration file and run mode.
    If given workflow_struct is empty, which means no correct workflow is provided, give error information and return.
    :param workflow_struct:
    :param workflow_config_file:
    :param run_mode:
    :return:
    """
    if not workflow_struct:
        no_workflow_error = "Error: No correct workflow is provided."
        print no_workflow_error
        return [no_workflow_error]

    # output variable
    results = []

    # Iterate over all workflows provided
    for wk in range(1, len(workflow_struct)):
        # Parameters Declaration
        inp_files = []
        aligner_arr = []
        output_dict = {}
        file_basecount_dict = {}
        file_split_struct = []
        cmd_str_arr = []
        postprocess_cmd_arr = []
        preprocess_cmd_arr = []
        fastqc_job_status = ''
        contaminant_dict = {}
        barcode_dict = {}
        fastqc_file_split_arr = []
        status_check = "healthy"
        status_arr = []
        preprocess_errorlist = []
        aligner_errorlist = []
        postprocess_errorlist = []
        parser_errorlist = []
        config_mismatch = []
        warning_list = []
        incompatibility_error_list = []
        cont_check_error_list = []
        conflict_validator = None
        barcode_dict = {'no_barcode_specified': ''}
        inp_files_list = []
        aligner_cmd_arr = []
        eqp_warning = ''
        # Set default values for workflow
        workflow_config_dict = workflow_struct[wk]
	YAP_HOME= str(os.getenv("YAP_HOME"))
        yap_src = YAP_HOME + "/bin"
        yap_version = "YAP-2.3"<commit_msg>Update yap_check.py<commit_after>#!/usr/bin/env python
"""
Copyright 2014 Novartis Institutes for Biomedical Research

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.
"""

import os
import numpy
import time
import glob
import sys
import math
import re
import random
from yap_tools import *
from yap_file_io import *
from yap_preprocess import *
from yap_conflict_check import *
from yap_regroup_check import *
from yap_cuffdiff_check import *
from yap_cuff_merge_compare_check import *
from yap_printer import *
from yap_path_checks import *

def workflow_validator(workflow_struct, workflow_config_file, run_mode):
    """
    Given 3 parameters : Workflow Struct, configuration file and run mode.
    If given workflow_struct is empty, which means no correct workflow is provided, give error information and return.
    :param workflow_struct:
    :param workflow_config_file:
    :param run_mode:
    :return:
    """
    if not workflow_struct:
        no_workflow_error = "Error: No correct workflow is provided."
        print no_workflow_error
        return [no_workflow_error]

    # output variable
    results = []

    # Iterate over all workflows provided
    for wk in range(1, len(workflow_struct)):
        # Parameters Declaration
        inp_files = []
        aligner_arr = []
        output_dict = {}
        file_basecount_dict = {}
        file_split_struct = []
        cmd_str_arr = []
        postprocess_cmd_arr = []
        preprocess_cmd_arr = []
        fastqc_job_status = ''
        contaminant_dict = {}
        barcode_dict = {}
        fastqc_file_split_arr = []
        status_check = "healthy"
        status_arr = []
        preprocess_errorlist = []
        aligner_errorlist = []
        postprocess_errorlist = []
        parser_errorlist = []
        config_mismatch = []
        warning_list = []
        incompatibility_error_list = []
        cont_check_error_list = []
        conflict_validator = None
        barcode_dict = {'no_barcode_specified': ''}
        inp_files_list = []
        aligner_cmd_arr = []
        eqp_warning = ''
        # Set default values for workflow
        workflow_config_dict = workflow_struct[wk]
	YAP_HOME= str(os.getenv("YAP_HOME"))
        yap_src = YAP_HOME + "/bin"
        yap_version = "YAP-1.0"
{'fraction_non_alphanumeric': 0.07210316018888485, 'fraction_numerical': 0.004358881220486742, 'mean_word_length': 3.022644265887509, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3048748', 'n_tokens_mistral': 1639, 'n_tokens_neox': 1574, 'n_words': 482}