Beispiel #1
0
 def test_get_intergenic(self):
     out_file = os.path.join(self.test_folder, "out")
     gff_file = os.path.join(self.test_folder, "anno.gff")
     tran_file = os.path.join(self.test_folder, "tran.gff")
     gen_file(gff_file, self.example.gff_file)
     gen_file(tran_file, self.example.tran_file)
     si.get_intergenic(gff_file, tran_file, out_file, True, False)
     datas = import_data(out_file)
     self.assertEqual("\n".join(datas), self.example.out_file)
 def test_get_intergenic(self):
     out_file = os.path.join(self.test_folder, "out")
     gff_file = os.path.join(self.test_folder, "anno.gff")
     tran_file = os.path.join(self.test_folder, "tran.gff")
     gen_file(gff_file, self.example.gff_file)
     gen_file(tran_file, self.example.tran_file)
     si.get_intergenic(gff_file, tran_file, out_file, True, False)
     datas = import_data(out_file)
     self.assertEqual("\n".join(datas), self.example.out_file)
Beispiel #3
0
 def _compare_tran_cds(self, args_sorf):
     '''compare transcript and CDS to find the intergenic region'''
     prefixs = []
     for gff in os.listdir(args_sorf.gffs):
         if gff.endswith(".gff"):
             prefix = gff.replace(".gff", "")
             prefixs.append(prefix)
             print("Comparing transcript and CDS of {0}".format(prefix))
             get_intergenic(os.path.join(args_sorf.gffs, gff),
                            os.path.join(self.tran_path,
                            "_".join([prefix, "transcript.gff"])),
                            os.path.join(args_sorf.out_folder,
                            "_".join([prefix, "inter.gff"])),
                            args_sorf.utr_detect, args_sorf.hypo)
     return prefixs
Beispiel #4
0
 def _compare_tran_cds(self, args_sorf, log):
     '''compare transcript and CDS to find the intergenic region'''
     prefixs = []
     log.write("Running sORF_intergenic.py to extract the sequences of "
               "potential sORFs\n")
     for gff in os.listdir(args_sorf.gffs):
         if gff.endswith(".gff"):
             prefix = gff.replace(".gff", "")
             prefixs.append(prefix)
             print("Comparing transcripts and CDSs of {0}".format(prefix))
             get_intergenic(os.path.join(args_sorf.gffs, gff),
                            os.path.join(self.tran_path,
                            "_".join([prefix, "transcript.gff"])),
                            os.path.join(args_sorf.out_folder,
                            "_".join([prefix, "inter.gff"])),
                            args_sorf.utr_detect, args_sorf.hypo,
                            args_sorf.extend_5, args_sorf.extend_3)
             log.write("\t" + os.path.join(args_sorf.out_folder,
                       "_".join([prefix, "inter.gff"])) + 
                       " is generated to temporary store the sequences.\n")
     return prefixs
Beispiel #5
0
 def _compare_tran_cds(self, args_sorf, log):
     '''compare transcript and CDS to find the intergenic region'''
     prefixs = []
     log.write("Running sORF_intergenic.py to extract the sequences of "
               "potential sORFs\n")
     for gff in os.listdir(args_sorf.gffs):
         if gff.endswith(".gff"):
             prefix = gff.replace(".gff", "")
             prefixs.append(prefix)
             print("Comparing transcripts and CDSs of {0}".format(prefix))
             get_intergenic(
                 os.path.join(args_sorf.gffs, gff),
                 os.path.join(self.tran_path,
                              "_".join([prefix, "transcript.gff"])),
                 os.path.join(args_sorf.out_folder,
                              "_".join([prefix, "inter.gff"])),
                 args_sorf.utr_detect, args_sorf.hypo, args_sorf.extend_5,
                 args_sorf.extend_3)
             log.write("\t" + os.path.join(args_sorf.out_folder, "_".join(
                 [prefix, "inter.gff"])) +
                       " is generated to temporary store the sequences.\n")
     return prefixs