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


Python helper.Helper类代码示例

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


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

示例1: extract_inter_seq

def extract_inter_seq(inter, cds, seq, fuzzy, inters):
    helper = Helper()
    start = inter["start"] - fuzzy
    end = inter["end"] + fuzzy
    if inter["start"] - fuzzy <= 0:
        start = 1
    if inter["end"] + fuzzy >= len(seq[cds.seq_id]):
        end = len(seq)
    if cds.strand == "+":
        inter_seq = helper.extract_gene(seq[cds.seq_id], start,
                                        end, "+")
    else:
        inter_seq = helper.extract_gene(seq[cds.seq_id], start,
                                        end, "-")
    inters.append(import_data(inter_seq, cds, inter["start"], inter["end"]))
开发者ID:malvikasharan,项目名称:ANNOgesic,代码行数:15,代码来源:extract_RBS.py

示例2: 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

示例3: __init__

 def __init__(self):
     self.seq_editer = SeqEditer()
     self.helper = Helper()
     self.tmp_fa = "tmp.fa"
     self.tmp_gff = "tmp.gff"
     self.tmp_wig_forward = "tmp_forward.wig"
     self.tmp_wig_reverse = "tmp_reverse.wig"
开发者ID:malvikasharan,项目名称:ANNOgesic,代码行数:7,代码来源:multiparser.py

示例4: __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

示例5: __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

示例6: __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

示例7: __init__

 def __init__(self, args_snp):
     self.multiparser = Multiparser()
     self.seq_editer = SeqEditer()
     self.helper = Helper()
     if args_snp.types == "related_genome":
         file_type = "compare_related_and_reference_genomes"
     else:
         file_type = "mutations_of_reference_genomes"
     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.fig_path = os.path.join(self.stat_path, "figs")
     self.helper.check_make_folder(self.fig_path)
     self.outputs = {"table": os.path.join(
                     args_snp.out_folder, file_type, "SNP_tables"),
                     "raw": os.path.join(
                     args_snp.out_folder, file_type, "SNP_raw_outputs"),
                     "tmp": os.path.join(args_snp.out_folder, "tmp_bcf"),
                     "depth": os.path.join(args_snp.out_folder, "tmp_depth")}
     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"),
                  "bams": []}
     self.header = os.path.join(args_snp.out_folder, "header")
     self.baqs = {"with": "with_BAQ", "without": "without_BAQ",
                  "extend": "extend_BAQ"}
开发者ID:Sung-Huan,项目名称:ANNOgesic,代码行数:27,代码来源:snp.py

示例8: __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

示例9: __init__

 def __init__(self, args_sc, out_folder):
     self.helper = Helper()
     args_sc.output_folder = out_folder
     filename = args_sc.fasta.split("/")[-1]
     self.strain = ".".join(filename.split(".")[0:-1])
     self.helper.check_make_folder(os.path.join(args_sc.output_folder,
                                                self.strain))
     self.forward_file = os.path.join(args_sc.output_folder,
                                      self.strain, "forward")
     self.reverse_file = os.path.join(args_sc.output_folder,
                                      self.strain, "reverse")
     os.mkdir(self.forward_file)
     os.mkdir(self.reverse_file)
开发者ID:Sung-Huan,项目名称:ANNOgesic,代码行数:13,代码来源:screen.py

示例10: __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

示例11: __init__

 def __init__(self, gffs):
     self.multiparser = Multiparser()
     self.helper = Helper()
     self.out_folder = os.path.join(gffs, "for_libs")
     if os.path.exists(self.out_folder):
         shutil.rmtree(self.out_folder)
     os.mkdir(self.out_folder)
     self.stat = os.path.join(self.out_folder, "statistics")
     os.mkdir(self.stat)
     self.gff_folder = os.path.join(self.out_folder, "gffs")
     os.mkdir(self.gff_folder)
     self.merge_wigs = os.path.join(gffs, "merge_wigs")
     if os.path.exists(self.merge_wigs):
         shutil.rmtree(self.merge_wigs)
开发者ID:Sung-Huan,项目名称:ANNOgesic,代码行数:14,代码来源:expression.py

示例12: setUp

 def setUp(self):
     self.example = ExampleData()
     self.helper = Helper()
     self.gff_out = self.example.gff_out
     self.rev_seq = self.example.rev_seq.replace("\n", "")
     self.test_folder = "test_folder"
     if (not os.path.exists(self.test_folder)):
         os.mkdir(self.test_folder)        
     self.gff_file = os.path.join(self.test_folder, "test.gff")
     with open(self.gff_file, "w") as rh:
         rh.write(self.example.gff_file)        
     self.seq_file = os.path.join(self.test_folder, "test.fa")
     with open(self.seq_file, "w") as rh:
         rh.write(self.example.seq)
开发者ID:Sung-Huan,项目名称:ANNOgesic,代码行数:14,代码来源:test_helper.py

示例13: __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

示例14: __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

示例15: __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


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