def srna_detection(self): """sRNA_detection.""" print("Running sRNA prediction...") self.check_folder([self._args.annotation_folder, self._args.transcript_assembly_folder]) self.check_no_require_folder([ self._args.fasta_folder, self._args.sORF, self._args.terminator_folder, self._args.tex_wig_folder, self._args.frag_wig_folder, self._args.processing_site_folder]) self.check_file([self._args.promoter_table], ["--promoter_table"], False) if self._args.UTR_derived_sRNA: self.check_folder([self._args.TSS_folder]) else: self.check_no_require_folder([self._args.TSS_folder]) project_creator.create_subfolders(self._paths.required_folders("srna")) args_srna = self.args_container.container_srna( self._args.Vienna_folder, self._args.Vienna_utils, self._args.blast_plus_folder, self._args.ps2pdf14_path, self._paths.srna_folder, self._args.UTR_derived_sRNA, self._args.annotation_folder, self._args.TSS_folder, self._args.transcript_assembly_folder, self._args.TSS_intergenic_fuzzy, self._args.TSS_5UTR_fuzzy, self._args.TSS_3UTR_fuzzy, self._args.TSS_interCDS_fuzzy, self._args.filter_info, self._args.tex_wig_folder, self._args.frag_wig_folder, self._args.processing_site_folder, self._args.fasta_folder, self._args.mountain_plot, self._args.nr_format, self._args.srna_format, self._args.sRNA_database_path, self._args.nr_database_path, self._args.cutoff_energy, self._args.run_intergenic_TEX_coverage, self._args.run_intergenic_noTEX_coverage, self._args.run_intergenic_fragmented_coverage, self._args.run_break_transcript, self._args.run_antisense_TEX_coverage, self._args.run_antisense_noTEX_coverage, self._args.run_antisense_fragmented_coverage, self._args.run_utr_TEX_coverage, self._args.run_utr_noTEX_coverage, self._args.run_utr_fragmented_coverage, self._args.max_length, self._args.min_length, self._args.tex_notex_libs, self._args.frag_libs, self._args.replicates_tex, self._args.replicates_frag, self._args.tex_notex, self._args.blast_e_nr, self._args.blast_e_srna, self._args.detect_sRNA_in_CDS, self._args.table_best, self._args.decrease_intergenic_antisense, self._args.decrease_utr, self._args.fuzzy_intergenic_antisense, self._args.fuzzy_utr, self._args.cutoff_nr_hit, self._args.sORF, self._args.overlap_percent_CDS, self._args.terminator_folder, self._args.terminator_fuzzy_in_sRNA, self._args.terminator_fuzzy_out_sRNA, self._args.ignore_hypothetical_protein, self._args.TSS_source, self._args.min_utr_coverage, self._args.promoter_table, self._args.ranking_time_promoter, self._args.promoter_name) srna = sRNADetection(args_srna) srna.run_srna_detection(args_srna)
def setUp(self): self.mock_args = MockClass() self.example = Example() self.mock = Mock_func() self.test_folder = "test_folder" self.gffs = "test_folder/gffs" self.tsss = "test_folder/tsss" self.sorf = "test_folder/sORF" self.out = "test_folder/output" self.trans = "test_folder/trans" self.fastas = "test_folder/fastas" self.tex = "test_folder/tex" self.frag = "test_folder/frag" self.pros = "test_folder/pros" self.terms = "test_folder/terms" if (not os.path.exists(self.test_folder)): os.mkdir(self.test_folder) os.mkdir(self.gffs) os.mkdir(self.tsss) os.mkdir(os.path.join(self.tsss, "tmp")) os.mkdir(self.out) os.mkdir(self.trans) os.mkdir(os.path.join(self.trans, "tmp")) os.mkdir(self.fastas) os.mkdir(os.path.join(self.fastas, "tmp")) os.mkdir(self.tex) os.mkdir(self.frag) os.mkdir(self.pros) os.mkdir(os.path.join(self.pros, "tmp")) os.mkdir(self.sorf) os.mkdir(os.path.join(self.sorf, "tmp")) os.mkdir(self.terms) args = self.mock_args.mock() args.tss_folder = self.tsss args.pro_folder = self.pros args.out_folder = self.out args.sorf_file = self.sorf args.fastas = self.fastas args.trans = self.trans args.terms = self.terms self.srna = sRNADetection(args)
def srna_detection(self): """sRNA_detection.""" print("Running sRNA prediction") self.check_multi_files( [self._args.annotation_files, self._args.transcript_files, self._args.fasta_files, self._args.sorf_files, self._args.terminator_files, self._args.promoter_tables, self._args.processing_site_files], ["--annotation_files", "--transcript_files", "--fasta_files", "--sorf_files", "--terminator_files", "--promoter_tables", "--processing_site_files"]) for info in self._args.filter_info: if "sec_str" == info: if not self._args.compute_sec_structures: print("Error: --compute_sec_structures is not switch on, " "but sec_str is still in --filter_info.") sys.exit() self._check_filter_input( self._args.fasta_files, "fasta file", "sec_str") for prop in ("rnafold_path", "relplot_path", "mountain_path"): setattr(self._args, prop, self.check_execute_file(getattr(self._args, prop))) elif ("blast_nr" == info) or ( "blast_srna"== info): for prop in ("blastn_path", "blastx_path", "makeblastdb_path"): setattr(self._args, prop, self.check_execute_file(getattr(self._args, prop))) if ("blast_nr" == info): self._check_database(self._args.nr_database_path, "--nr_database_path", "blast_nr") if ("blast_srna" == info): self._check_database(self._args.srna_database_path, "--srna_database_path", "blast_srna") elif "sorf" == info: self._check_filter_input( self._args.sorf_files, "sORF", "sorf") elif "term" == info: self._check_filter_input(self._args.terminator_files, "terminator", "term") elif "promoter" == info: self._check_filter_input(self._args.promoter_tables, "Promoter", "promoter") elif "tss" == info: self._check_filter_input(self._args.tss_files, "TSS", "tss") else: if "none" != info.lower(): print("Error: Please check the --filter_info, " "invalid value was assigned!") sys.exit() if self._args.utr_derived_srna: if self._args.tss_files is None: print("Error: The TSS has to be provided " "if you want to compute UTR-derived sRNA!") sys.exit() if self._args.search_poly_u != 0: if self._args.fasta_files is None: print("Error: The fasta files have to be provided " "if you want to extend 3'end of sRNA by " "searching poly U tail!") sys.exit() project_creator.create_subfolders(self._paths.required_folders("srna")) args_srna = self.args_container.container_srna( self._args.rnafold_path, self._args.relplot_path, self._args.mountain_path, self._args.blastn_path, self._args.blastx_path, self._args.makeblastdb_path, self._paths.srna_folder, self._args.utr_derived_srna, self._args.annotation_files, self._args.tss_files, self._args.transcript_files, self._args.tss_intergenic_antisense_tolerance, self._args.tss_5utr_tolerance, self._args.tss_3utr_tolerance, self._args.tss_intercds_tolerance, self._args.filter_info, self._args.processing_site_files, self._args.fasta_files, self._args.mountain_plot, self._args.nr_format, self._args.srna_format, self._args.srna_database_path, self._args.nr_database_path, self._args.cutoff_energy, self._args.parallel_blast, self._args.min_intergenic_tex_coverage, self._args.min_intergenic_notex_coverage, self._args.min_intergenic_fragmented_coverage, self._args.min_complete_5utr_transcript_coverage, self._args.min_antisense_tex_coverage, self._args.min_antisense_notex_coverage, self._args.min_antisense_fragmented_coverage, self._args.min_utr_tex_coverage, self._args.min_utr_notex_coverage, self._args.min_utr_fragmented_coverage, self._args.max_length, self._args.min_length, self._args.tex_notex_libs, self._args.frag_libs, self._args.replicate_tex, self._args.replicate_frag, self._args.tex_notex, self._args.blast_e_nr, self._args.blast_e_srna, self._args.detect_srna_in_cds, self._args.table_best, self._args.decrease_intergenic_antisense, self._args.decrease_utr, self._args.tolerance_intergenic_antisense, self._args.tolerance_utr, self._args.cutoff_nr_hit, self._args.sorf_files, self._args.overlap_percent_cds, self._args.terminator_files, self._args.terminator_tolerance_in_srna, self._args.terminator_tolerance_out_srna, self._args.ignore_hypothetical_protein, self._args.tss_source, self._args.min_all_utr_coverage, self._args.promoter_tables, self._args.ranking_time_promoter, self._args.promoter_names, self._args.compute_sec_structures, self._args.search_poly_u, self._args.min_u_poly_u, self._args.mutation_poly_u) srna = sRNADetection(args_srna) srna.run_srna_detection(args_srna)
def srna_detection(self): """sRNA_detection.""" print("Running sRNA prediction...") self.check_folder([self._args.annotation_folder, self._args.transcript_assembly_folder]) self.check_no_require_folder([self._args.fasta_folder, self._args.sORF, self._args.terminator_folder]) self.check_file([self._args.promoter_table], ["--promoter_table"], False) if self._args.UTR_derived_sRNA: self.check_folder([self._args.TSS_folder, self._args.processing_site_folder]) else: self.check_no_require_folder([self._args.TSS_folder, self._args.processing_site_folder]) project_creator.create_subfolders(self._paths.required_folders("srna")) args_srna = self.args_container.container_srna( self._args.Vienna_folder, self._args.Vienna_utils, self._args.blast_plus_folder, self._args.ps2pdf14_path, self._paths.srna_folder, self._args.UTR_derived_sRNA, self._args.annotation_folder, self._args.TSS_folder, self._args.transcript_assembly_folder, self._args.TSS_intergenic_fuzzy, self._args.TSS_5UTR_fuzzy, self._args.TSS_3UTR_fuzzy, self._args.TSS_interCDS_fuzzy, self._args.import_info, self._args.tex_wig_folder, self._args.frag_wig_folder, self._args.processing_site_folder, self._args.fasta_folder, self._args.mountain_plot, self._args.nr_format, self._args.srna_format, self._args.sRNA_database_path, self._args.nr_database_path, self._args.cutoff_energy, self._args.run_intergenic_TEX_coverage, self._args.run_intergenic_noTEX_coverage, self._args.run_intergenic_fragmented_coverage, self._args.run_antisense_TEX_coverage, self._args.run_antisense_noTEX_coverage, self._args.run_antisense_fragmented_coverage, self._args.intergenic_tolerance, self._args.run_utr_TEX_coverage, self._args.run_utr_noTEX_coverage, self._args.run_utr_fragmented_coverage, self._args.max_length, self._args.min_length, self._args.tex_notex_libs, self._args.frag_libs, self._args.replicates_tex, self._args.replicates_frag, self._args.tex_notex, self._args.blast_e_nr, self._args.blast_e_srna, self._args.detect_sRNA_in_CDS, self._args.table_best, self._args.decrease_intergenic, self._args.decrease_utr, self._args.fuzzy_intergenic, self._args.fuzzy_utr, self._args.cutoff_nr_hit, self._args.sORF, self._args.best_with_all_sRNAhit, self._args.best_without_sORF_candidate, self._args.overlap_percent_CDS, self._args.terminator_folder, self._args.terminator_fuzzy_in_CDS, self._args.terminator_fuzzy_out_CDS, self._args.best_with_terminator, self._args.ignore_hypothetical_protein, self._args.TSS_source, self._args.min_utr_coverage, self._args.promoter_table, self._args.best_with_promoter, self._args.ranking_time_promoter, self._args.promoter_name) srna = sRNADetection(args_srna) srna.run_srna_detection(args_srna)