Skip to content
Snippets Groups Projects
Commit 05453696 authored by Jakob Rien's avatar Jakob Rien
Browse files

Replace new_exe.py

parent 1c09b7c6
No related branches found
No related tags found
No related merge requests found
### Called Packages ###
import argparse import argparse
import transcript_extractor as te import transcript_extractor as te
import exon_length_filter as elf import exon_length_filter as elf
import representative as rtcl import representative as rtcl
import poisson_sampling as ps import poisson_sampling as ps
import writegtf as gt import writegtf as gt
import match_reprtranscript_expressionlevel as ma import match_reprtranscript_expressionlevel as ma
python_version = "3.7.13"
module_list =[argparse]
modul_name_list = ["argparse"]
### Functions ###
def exe(input_file, csv, gtf, input_csv, transcript_nr,input_free = True): def exe(input_file, csv, gtf, input_csv, transcript_nr,input_free = True):
file_name,source_pathway_name_2,deposit_pathway_name_2 = te.extract_transcript(input_file, Input_free = input_free) file_name,source_pathway_name_2,deposit_pathway_name_2 = te.extract_transcript(input_file, Input_free = input_free)
inter_mediate_file_directory = file_name +"_intermediate_file.txt" inter_mediate_file_directory = file_name +"_intermediate_file.txt"
print("Transcripts are filtered based on transcript score. Please wait...") print("Transcripts are filtered based on transcript score. Please wait...")
pre_filter_representative_transcripts_dict = rtcl.find_repr_by_SupportLevel(inter_mediate_file_directory) pre_filter_representative_transcripts_dict = rtcl.find_repr_by_SupportLevel(inter_mediate_file_directory)
print("Transcripts filtered\n") print("Transcripts filtered\n")
dictionary1 = elf.exon_length_filter(file_name,gen_dict= pre_filter_representative_transcripts_dict, Input_free = input_free) dictionary1 = elf.exon_length_filter(file_name,gen_dict= pre_filter_representative_transcripts_dict)
print(dictionary1) df_repr = ma.match_reprTranscript_expressionLevel(dict_reprTrans=dictionary1, exprTrans=input_csv, intermediate_file= inter_mediate_file_directory,)
print("Finiding match between representative transcripts and expression level file")
tsv_input = ma.match_reprTranscript_expressionLevel(input_csv, dictionary1, inter_mediate_file_directory)
print("Poisson sampling of transcripts") print("Poisson sampling of transcripts")
ps.transcript_sampling(transcript_nr, tsv_input, csv) ps.transcript_sampling(transcript_nr, df_repr, csv)
print("output csv file ready") print("output csv file ready")
print("writing output gtf file") print("writing output gtf file")
gt.gtf_file_writer(input_file, csv, gtf) gt.gtf_file_writer(input_file, csv, gtf)
if __name__ == '__main__': if __name__ == '__main__':
#te.version_control(module_list,modul_name_list,python_version)
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
description="transcript sampler", description="transcript sampler",
formatter_class=argparse.ArgumentDefaultsHelpFormatter formatter_class=argparse.ArgumentDefaultsHelpFormatter
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment