当前位置: 首页>>代码示例>>Python>>正文


Python multiparser.Multiparser类代码示例

本文整理汇总了Python中annogesiclib.multiparser.Multiparser的典型用法代码示例。如果您正苦于以下问题:Python Multiparser类的具体用法?Python Multiparser怎么用?Python Multiparser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Multiparser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: TargetFasta

class TargetFasta(object):

    def __init__(self, tar_folder, ref_folder):
        self.multiparser = Multiparser()
        self.seq_editer = SeqEditer()
        self.helper = Helper()
        self.folders = {"tmp_tar": os.path.join(tar_folder, "tmp"),
                        "tmp_ref": os.path.join(ref_folder, "tmp")}

    def get_target_fasta(self, mut_table, tar_folder, ref_folder, output):
        self.multiparser.parser_fasta(ref_folder)
        if "tmp" in os.listdir(tar_folder):
            shutil.rmtree(self.folders["tmp_tar"])
        os.mkdir(self.folders["tmp_tar"])
        self.seq_editer.modify_seq(self.folders["tmp_ref"], mut_table,
                                   self.folders["tmp_tar"])
        print("transfer to target fasta...")
        if output is not None:
            for file_ in output:
                first = True
                datas = file_.split(":")
                filename = datas[0]
                strains = datas[1].split("_and_")
                out = open(os.path.join(tar_folder, filename + ".fa"), "w")
                for strain in strains:
                    if strain + ".fa" in os.listdir(self.folders["tmp_tar"]):
                        if first:
                            first = False
                        else:
                            out.write("\n")
                        with open(os.path.join(
                                  self.folders["tmp_tar"],
                                  strain + ".fa")) as f_h:
                            for line in f_h:
                                out.write(line)
                    else:
                        print("Error:no fasta information of {0}.fa".format(
                              strain))
                out.close()
        else:
            self.helper.move_all_content(self.folders["tmp_tar"],
                                         tar_folder, [".fa"])
        shutil.rmtree(self.folders["tmp_tar"])
        shutil.rmtree(self.folders["tmp_ref"])
        self.helper.remove_all_content(ref_folder, "_folder", "dir")
        print("please use the new fasta file to remapping again.")
        print("Then copy BAMs and wigs back to input/align_results/BAMs "
              "and input/align_results/wigs")
开发者ID:malvikasharan,项目名称:ANNOgesic,代码行数:48,代码来源:get_target_fasta.py

示例2: __init__

 def __init__(self, args_snp):
     self.multiparser = Multiparser()
     self.seq_editer = SeqEditer()
     self.helper = Helper()
     if args_snp.types == "reference":
         file_type = "compare_reference"
     else:
         file_type = "validate_target"
     self.seq_path = os.path.join(args_snp.out_folder, file_type, "seqs")
     self.stat_path = os.path.join(args_snp.out_folder, file_type,
                                   "statistics")
     self.fasta_path = os.path.join(args_snp.fastas, "tmp")
     self.outputs = {"table": os.path.join(
                     args_snp.out_folder, file_type, "SNP_table"),
                     "raw": os.path.join(
                     args_snp.out_folder, file_type, "SNP_raw_outputs"),
                     "tmp": os.path.join(args_snp.out_folder, "tmp_bcf")}
     if "whole_reads.bam" in os.listdir(args_snp.out_folder):
         self.helper.remove_all_content(args_snp.out_folder,
                                        "whole_read", "file")
     self.bams = {"whole": os.path.join(args_snp.out_folder,
                                        "whole_reads.bam"),
                  "sort": os.path.join(args_snp.out_folder,
                                       "whole_reads_sorted.bam")}
     self.header = os.path.join(args_snp.out_folder, "header")
     self.baqs = {"with": "with_BAQ", "without": "without_BAQ",
                  "extend": "extend_BAQ"}
开发者ID:malvikasharan,项目名称:ANNOgesic,代码行数:27,代码来源:snp.py

示例3: __init__

 def __init__(self, args_ribo):
     self.multiparser = Multiparser()
     self.helper = Helper()
     self.gff_parser = Gff3Parser()
     self.gff_path = os.path.join(args_ribo.gffs, "tmp")
     if args_ribo.tsss is not None:
         self.tss_path = os.path.join(args_ribo.tsss, "tmp")
     else:
         self.tss_path = None
     self.tran_path = os.path.join(args_ribo.trans, "tmp")
     self.fasta_path = os.path.join(args_ribo.fastas, "tmp")
     if (args_ribo.program == "both") or (
             args_ribo.program == "riboswitch"):
         (self.ribos_stat_folder, self.ribos_gff_outfolder,
          self.ribos_table_folder, self.ribos_scan_folder,
          self.ribos_tmp_files, self.ribos_rfam,
          self.ribos_suffixs) = self._create_out_folders(
             args_ribo.ribos_out_folder, "riboswitch",
             args_ribo.database)
     if (args_ribo.program == "both") or (
             args_ribo.program == "thermometer"):
         (self.thermo_stat_folder, self.thermo_gff_outfolder,
          self.thermo_table_folder, self.thermo_scan_folder,
          self.thermo_tmp_files, self.thermo_rfam,
          self.thermo_suffixs) = self._create_out_folders(
             args_ribo.thermo_out_folder, "RNA_thermometer",
             args_ribo.database)
开发者ID:Sung-Huan,项目名称:ANNOgesic,代码行数:27,代码来源:ribos.py

示例4: __init__

 def __init__(self, args_circ):
     self.multiparser = Multiparser()
     self.helper = Helper()
     self.converter = Converter()
     self.alignment_path = os.path.join(args_circ.output_folder,
                                        "segemehl_align")
     self.splice_path = os.path.join(args_circ.output_folder,
                                     "segemehl_splice")
     self.candidate_path = os.path.join(args_circ.output_folder,
                                        "circRNA_tables")
     self.gff_folder = os.path.join(args_circ.output_folder, "gffs")
     self.gff_path = os.path.join(args_circ.gffs, "tmp")
     self.splices = {"all_file": "splicesites_all.bed",
                     "file": "splicesites.bed",
                     "all": "splicesites_all", "splice": "splicesites"}
     self.trans = {"all_file": "transrealigned_all.bed",
                   "file": "transrealigned.bed",
                   "all": "transrealigned_all", "trans": "transrealigned"}
     self.bams = {"whole": "whole_reads.bam", "sort": "whole_reads_sort"}
     if args_circ.align:
         if args_circ.fastas is None:
             print("Error: There is no genome fasta file!!!")
             sys.exit()
         else:
             self.fasta_path = os.path.join(args_circ.fastas, "tmp")
     else:
         self.fasta_path = os.path.join(args_circ.fastas, "tmp")
开发者ID:malvikasharan,项目名称:ANNOgesic,代码行数:27,代码来源:circrna.py

示例5: setUp

 def setUp(self):
     self.multiparser = Multiparser()
     self.example = Example()
     self.ref_folder = "ref_folder"
     if (not os.path.exists(self.ref_folder)):
         os.mkdir(self.ref_folder)
     self.tar_folder = "tar_folder"
     if (not os.path.exists(self.tar_folder)):
         os.mkdir(self.tar_folder)
开发者ID:malvikasharan,项目名称:ANNOgesic,代码行数:9,代码来源:test_multiparser.py

示例6: __init__

 def __init__(self, args_utr):
     self.helper = Helper()
     self.multiparser = Multiparser()
     self.tss_path = os.path.join(args_utr.tsss, "tmp")
     self.tran_path = os.path.join(args_utr.trans, "tmp")
     self.utr5_path = os.path.join(args_utr.out_folder, "5UTR")
     self.utr3_path = os.path.join(args_utr.out_folder, "3UTR")
     self.utr5_stat_path = os.path.join(self.utr5_path, "statistics")
     self.utr3_stat_path = os.path.join(self.utr3_path, "statistics")
开发者ID:malvikasharan,项目名称:ANNOgesic,代码行数:9,代码来源:utr.py

示例7: __init__

 def __init__(self, args_op):
     self.multiparser = Multiparser()
     self.helper = Helper()
     self.tss_path = os.path.join(args_op.tsss, "tmp")
     self.tran_path = os.path.join(args_op.trans, "tmp")
     self.utr5_path = os.path.join(args_op.utr5s, "tmp")
     self.utr3_path = os.path.join(args_op.utr3s, "tmp")
     self.table_path = os.path.join(args_op.output_folder, "tables")
     if args_op.terms is not None:
         self._check_gff(args_op.terms, "term")
         self.term_path = os.path.join(args_op.terms, "tmp")
     else:
         self.term_path = None
开发者ID:malvikasharan,项目名称:ANNOgesic,代码行数:13,代码来源:operon.py

示例8: __init__

 def __init__(self, args_tar):
     self.multiparser = Multiparser()
     self.helper = Helper()
     self.fixer = FormatFixer()
     self.gff_parser = Gff3Parser()
     self.target_seq_path = os.path.join(args_tar.out_folder, "target_seqs")
     self.srna_seq_path = os.path.join(args_tar.out_folder, "sRNA_seqs")
     self.rnaplex_path = os.path.join(args_tar.out_folder, "RNAplex")
     self.rnaup_path = os.path.join(args_tar.out_folder, "RNAup")
     self.merge_path = os.path.join(args_tar.out_folder, "merge")
     self.srna_path = os.path.join(args_tar.srnas, "tmp")
     self.fasta_path = os.path.join(args_tar.fastas, "tmp")
     self.gff_path = os.path.join(args_tar.gffs, "tmp")
     self.tmps = {"tmp": "tmp", "rnaup": "tmp_rnaup", "log": "tmp_log",
                  "all_fa": "tmp*.fa", "all_txt": "tmp*.txt"}
开发者ID:malvikasharan,项目名称:ANNOgesic,代码行数:15,代码来源:srna_target.py

示例9: __init__

 def __init__(self, args_tss):
     self.multiparser = Multiparser()
     self.helper = Helper()
     self.converter = Converter()
     self.master = os.path.join(args_tss.out_folder, "MasterTables")
     self.tmps = {"tss": "tmp_TSS", "ta_tss": "tmp_ta_tss", "tss_ta":
                  "tmp_tss", "tmp": "tmp"}
     if args_tss.ta_files is not None:
         self.tmps["ta"] = os.path.join(args_tss.ta_files, "tmp")
     else:
         self.tmps["ta"] = None
     self.gff_path = os.path.join(args_tss.gffs, "tmp")
     self.wig_path = os.path.join(args_tss.wig_folder, "tmp")
     self.fasta_path = os.path.join(args_tss.fastas, "tmp")
     self.stat_outfolder = os.path.join(args_tss.out_folder, "statistics")
     self.gff_outfolder = os.path.join(args_tss.out_folder, "gffs")
开发者ID:malvikasharan,项目名称:ANNOgesic,代码行数:16,代码来源:tsspredator.py

示例10: __init__

 def __init__(self, args_go):
     self.multiparser = Multiparser()
     self.helper = Helper()
     self.out_all = os.path.join(args_go.out_folder, "all_CDSs")
     self.out_express = os.path.join(args_go.out_folder, "expressed_CDSs")
     self.result_all_path = os.path.join(self.out_all, "GO_term_results")
     self.result_express_path = os.path.join(self.out_express,
                                             "GO_term_results")
     self.gff_path = os.path.join(args_go.gffs, "tmp")
     if args_go.trans is not None:
         self.tran_path = os.path.join(args_go.trans, "tmp")
     else:
         self.tran_path = None
     self.stat_all_path = os.path.join(self.out_all, "statistics")
     self.stat_express_path = os.path.join(self.out_express,
                                           "statistics")
     self.all_strain = "all_genomes_uniprot.csv"
开发者ID:Sung-Huan,项目名称:ANNOgesic,代码行数:17,代码来源:goterm.py

示例11: __init__

 def __init__(self, args_sorf):
     self.multiparser = Multiparser()
     self.helper = Helper()
     if args_sorf.tsss is not None:
         self.tss_path = os.path.join(args_sorf.tsss, "tmp")
     else:
         self.tss_path = None
     if args_sorf.srnas is not None:
         self.srna_path = os.path.join(args_sorf.srnas, "tmp")
     else:
         self.srna_path = None
     self.gff_output = os.path.join(args_sorf.out_folder, "gffs")
     self.table_output = os.path.join(args_sorf.out_folder, "tables")
     self.tran_path = os.path.join(args_sorf.trans, "tmp")
     self.fasta_path = os.path.join(args_sorf.fastas, "tmp")
     self.all_cand = "all_candidates"
     self.best = "best_candidates"
开发者ID:Sung-Huan,项目名称:ANNOgesic,代码行数:17,代码来源:sorf.py

示例12: __init__

 def __init__(self, args_circ):
     self.multiparser = Multiparser()
     self.helper = Helper()
     self.converter = Converter()
     self.alignment_path = os.path.join(args_circ.output_folder,
                                        "segemehl_alignment_files")
     self.splice_path = os.path.join(args_circ.output_folder,
                                     "segemehl_splice_results")
     self.candidate_path = os.path.join(args_circ.output_folder,
                                        "circRNA_tables")
     self.gff_folder = os.path.join(args_circ.output_folder, "gffs")
     self.gff_path = os.path.join(args_circ.gffs, "tmp")
     self.splices = {"file": "splicesites.bed",
                     "splice": "splicesites"}
     self.trans = {"file": "transrealigned.bed",
                   "trans": "transrealigned"}
     self.fasta_path = os.path.join(args_circ.fastas, "tmp")
开发者ID:Sung-Huan,项目名称:ANNOgesic,代码行数:17,代码来源:circrna.py

示例13: __init__

 def __init__(self, args_srna):
     self.args_container = ArgsContainer()
     self.helper = Helper()
     self.multiparser = Multiparser()
     self.gff_output = os.path.join(args_srna.out_folder, "gffs")
     self.table_output = os.path.join(args_srna.out_folder, "tables")
     self.stat_path = os.path.join(args_srna.out_folder, "statistics")
     self.tss_path = self._check_folder_exist(args_srna.tss_folder)
     self.pro_path = self._check_folder_exist(args_srna.pro_folder)
     self.sorf_path = self._check_folder_exist(args_srna.sorf_file)
     self.fasta_path = os.path.join(args_srna.fastas, "tmp")
     self.tran_path = os.path.join(args_srna.trans, "tmp")
     self.term_path = self._check_folder_exist(args_srna.terms)
     self.merge_wigs = os.path.join(args_srna.out_folder, "merge_wigs")
     self.prefixs = {"merge": os.path.join(
                         args_srna.out_folder, "tmp_merge"),
                     "utr": os.path.join(
                         args_srna.out_folder, "tmp_utrsrna"),
                     "normal": os.path.join(
                         args_srna.out_folder, "tmp_normal"),
                     "in_cds": os.path.join(
                         args_srna.out_folder, "tmp_incds"),
                     "merge_table": os.path.join(
                         args_srna.out_folder, "tmp_merge_table"),
                     "utr_table": os.path.join(
                         args_srna.out_folder, "tmp_utrsrna_table"),
                     "normal_table": os.path.join(
                         args_srna.out_folder, "tmp_normal_table"),
                     "in_cds_table": os.path.join(
                         args_srna.out_folder, "tmp_incds_table"),
                     "basic": os.path.join(
                         args_srna.out_folder, "tmp_basic"),
                     "energy": os.path.join(
                         args_srna.out_folder, "tmp_energy")}
     self.tmps = {"nr": os.path.join(args_srna.out_folder, "tmp_nr"),
                  "srna": os.path.join(args_srna.out_folder, "tmp_sRNA")}
     self.best_table = os.path.join(self.table_output, "best")
     self.table_output = os.path.join(args_srna.out_folder, "tables")
     self.stat_path = os.path.join(args_srna.out_folder, "statistics")
     self.all_best = {"all_gff": os.path.join(
                          self.gff_output, "all_candidates"),
                      "best_gff": os.path.join(self.gff_output, "best"),
                      "all_table": os.path.join(
                          self.table_output, "all_candidates"),
                      "best_table": os.path.join(self.table_output, "best")}
开发者ID:malvikasharan,项目名称:ANNOgesic,代码行数:45,代码来源:srna.py

示例14: __init__

 def __init__(self, args_tran):
     self.multiparser = Multiparser()
     self.helper = Helper()
     self.converter = Converter()
     self.gff_outfolder = os.path.join(args_tran.out_folder, "gffs")
     self.tran_path = os.path.join(self.gff_outfolder, "tmp")
     self.stat_path = os.path.join(args_tran.out_folder, "statistics")
     self.tmps = {"gff": "tmp.gff", "merge": "tmp_merge",
                  "tran": os.path.join(args_tran.out_folder, "tmp_tran"),
                  "tss_ta": os.path.join(self.gff_outfolder, "tmp_tss_ta"),
                  "ta_tss": os.path.join(self.gff_outfolder, "tmp_ta_tss"),
                  "ta_gff": os.path.join(self.gff_outfolder, "tmp_ta_gff"),
                  "gff_ta": os.path.join(self.gff_outfolder, "tmp_gff_ta"),
                  "uni": os.path.join(self.gff_outfolder, "tmp_uni"),
                  "overlap": os.path.join(
                      self.gff_outfolder, "tmp_overlap")}
     self.frag = "transcript_fragment.gff"
     self.tex = "transcript_tex_notex.gff"
     self.endfix_tran = "transcript.gff"
开发者ID:Sung-Huan,项目名称:ANNOgesic,代码行数:19,代码来源:transcript.py

示例15: __init__

 def __init__(self, args_ratt):
     self.multiparser = Multiparser()
     self.converter = Converter()
     self.format_fixer = FormatFixer()
     self.helper = Helper()
     self.gbk = os.path.join(args_ratt.ref_embls, "gbk_tmp")
     self.gbk_tmp = os.path.join(self.gbk, "tmp")
     self.embl = os.path.join(args_ratt.ref_embls, "embls")
     self.ratt_log = os.path.join(args_ratt.output_path, "ratt_log.txt")
     self.tmp_files = {"tar": os.path.join(args_ratt.tar_fastas, "tmp"),
                       "ref": os.path.join(args_ratt.ref_fastas, "tmp"),
                       "out_gff": os.path.join(args_ratt.gff_outfolder,
                                               "tmp"),
                       "gff": os.path.join(args_ratt.gff_outfolder,
                                           "tmp.gff"),
                       "ptt": os.path.join(args_ratt.gff_outfolder,
                                           "tmp.ptt"),
                       "rnt": os.path.join(args_ratt.gff_outfolder,
                                           "tmp.rnt")}
开发者ID:malvikasharan,项目名称:ANNOgesic,代码行数:19,代码来源:ratt.py


注:本文中的annogesiclib.multiparser.Multiparser类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。