def runProgram(Species,Array_type,mir_source,stringency,Force):
    global species; global array_type; global force
    process_microRNA_predictions = 'yes'

    species = Species; array_type = Array_type; force = Force
    
    import_dir = '/AltDatabase/'+species+'/'+array_type
    filedir = import_dir[1:]+'/'
    dir_list = read_directory(import_dir)  #send a sub_directory to a function to identify all files in a directory
    probeset_seq_file=''
    for input_file in dir_list:    #loop through each file in the directory to  results
        if 'critical-exon-seq_updated' in input_file: probeset_seq_file = filedir+input_file
        elif 'critical-exon-seq' in input_file: probeset_seq_file2 = filedir+input_file
    if len(probeset_seq_file)==0: probeset_seq_file=probeset_seq_file2
        
    data_type = 'critical-exons'
    try: splice_event_db = getParametersAndExecute(probeset_seq_file,array_type,species,data_type)
    except UnboundLocalError:
        probeset_seq_file = 'AltDatabase/'+species+'/'+array_type+'/'+array_type+'_critical-exon-seq_updated.txt'
        update.downloadCurrentVersion(probeset_seq_file,array_type,'txt')
        splice_event_db = getParametersAndExecute(probeset_seq_file,array_type,species,data_type)
        
    if process_microRNA_predictions == 'yes':
        print 'stringency:',stringency
        try:
            ensembl_mirna_db = ExonSeqModule.importmiRNATargetPredictionsAdvanced(species)
            ExonSeqModule.alignmiRNAData(array_type,mir_source,species,stringency,ensembl_mirna_db,splice_event_db)
        except Exception: pass
def runProgram(Species, Array_type, mir_source, stringency, Force):
    global species
    global array_type
    global force
    process_microRNA_predictions = 'yes'

    species = Species
    array_type = Array_type
    force = Force

    import_dir = '/AltDatabase/' + species + '/' + array_type
    filedir = import_dir[1:] + '/'
    dir_list = read_directory(
        import_dir
    )  #send a sub_directory to a function to identify all files in a directory
    probeset_seq_file = ''
    for input_file in dir_list:  #loop through each file in the directory to  results
        if 'critical-exon-seq_updated' in input_file:
            probeset_seq_file = filedir + input_file
        elif 'critical-exon-seq' in input_file:
            probeset_seq_file2 = filedir + input_file
    if len(probeset_seq_file) == 0: probeset_seq_file = probeset_seq_file2

    data_type = 'critical-exons'
    try:
        splice_event_db = getParametersAndExecute(probeset_seq_file,
                                                  array_type, species,
                                                  data_type)
    except UnboundLocalError:
        probeset_seq_file = 'AltDatabase/' + species + '/' + array_type + '/' + array_type + '_critical-exon-seq_updated.txt'
        update.downloadCurrentVersion(probeset_seq_file, array_type, 'txt')
        splice_event_db = getParametersAndExecute(probeset_seq_file,
                                                  array_type, species,
                                                  data_type)

    if process_microRNA_predictions == 'yes':
        print 'stringency:', stringency
        try:
            ensembl_mirna_db = ExonSeqModule.importmiRNATargetPredictionsAdvanced(
                species)
            ExonSeqModule.alignmiRNAData(array_type, mir_source, species,
                                         stringency, ensembl_mirna_db,
                                         splice_event_db)
        except Exception:
            pass