Пример #1
0
 def test_operon(self):
     op.read_gff = Mock_func().mock_read_gff
     out_file = os.path.join(self.test_folder, "test.out")
     op.operon("test_ta", "test_tss", "test_gff", "test_term", 3,
               5, 5, out_file)
     datas = import_data(out_file)
     self.assertEqual(set(datas), set(self.example.out_file.split("\n")))
Пример #2
0
 def test_operon(self):
     op.read_gff = Mock_func().mock_read_gff
     out_file = os.path.join(self.test_folder, "test.out")
     op.operon("test_ta", "test_tss", "test_gff", "test_term", 3, 5, 5,
               out_file)
     datas = import_data(out_file)
     self.assertEqual(set(datas), set(self.example.out_file.split("\n")))
Пример #3
0
 def _detect_operon(self, prefixs, args_op, log):
     log.write("Running detect_operon.py to detect operon.\n")
     log.write("The the following files are generated:\n")
     for prefix in prefixs:
         out_gff = os.path.join(args_op.output_folder, "gffs",
                                 "_".join([prefix, "operon.gff"]))
         out_table = os.path.join(self.table_path,
                                  "_".join([prefix, "operon.csv"]))
         print("Detecting operons of {0}".format(prefix))
         if self.tss_path is None:
             tss = False
         else:
             tss = self.helper.get_correct_file(
                     self.tss_path, "_TSS.gff", prefix, None, None)
         tran = self.helper.get_correct_file(
                 self.tran_path, "_transcript.gff", prefix, None, None)
         gff = self.helper.get_correct_file(
                 args_op.gffs, ".gff", prefix, None, None)
         if self.term_path is None:
             term = False
         else:
             term = self.helper.get_correct_file(
                     self.term_path, "_term.gff", prefix, None, None)
         operon(tran, tss, gff, term, args_op.tss_fuzzy,
                args_op.term_fuzzy, args_op.length, out_table, out_gff)
         log.write("\t" + out_table + "\n")
         log.write("\t" + out_gff + "\n")
Пример #4
0
 def _detect_operon(self, prefixs, args_op, log):
     log.write("Running detect_operon.py to detect operon.\n")
     log.write("The the following files are generated:\n")
     for prefix in prefixs:
         out_gff = os.path.join(args_op.output_folder, "gffs",
                                "_".join([prefix, "operon.gff"]))
         out_table = os.path.join(self.table_path,
                                  "_".join([prefix, "operon.csv"]))
         print("Detecting operons of {0}".format(prefix))
         if self.tss_path is None:
             tss = False
         else:
             tss = self.helper.get_correct_file(self.tss_path, "_TSS.gff",
                                                prefix, None, None)
         tran = self.helper.get_correct_file(self.tran_path,
                                             "_transcript.gff", prefix,
                                             None, None)
         gff = self.helper.get_correct_file(args_op.gffs, ".gff", prefix,
                                            None, None)
         if self.term_path is None:
             term = False
         else:
             term = self.helper.get_correct_file(self.term_path,
                                                 "_term.gff", prefix, None,
                                                 None)
         operon(tran, tss, gff, term, args_op.tss_fuzzy, args_op.term_fuzzy,
                args_op.length, out_table, out_gff)
         log.write("\t" + out_table + "\n")
         log.write("\t" + out_gff + "\n")
Пример #5
0
 def _detect_operon(self, prefixs, args_op):
     for prefix in prefixs:
         out_table = os.path.join(self.table_path,
                                  "_".join(["operon", prefix + ".csv"]))
         print("Detection operons of {0}".format(prefix))
         tss = self.helper.get_correct_file(
                 self.tss_path, "_TSS.gff", prefix, None, None)
         tran = self.helper.get_correct_file(
                 self.tran_path, "_transcript.gff", prefix, None, None)
         gff = self.helper.get_correct_file(
                 args_op.gffs, ".gff", prefix, None, None)
         if self.term_path is None:
             term = False
         else:
             term = self.helper.get_correct_file(
                     self.term_path, "_term.gff", prefix, None, None)
         operon(tran, tss, gff, term, args_op.tss_fuzzy,
                args_op.term_fuzzy, args_op.length, out_table)
Пример #6
0
 def _detect_operon(self, prefixs, args_op):
     for prefix in prefixs:
         out_table = os.path.join(self.table_path,
                                  "_".join(["operon", prefix + ".csv"]))
         print("Detection operons of {0}".format(prefix))
         tss = self.helper.get_correct_file(self.tss_path, "_TSS.gff",
                                            prefix, None, None)
         tran = self.helper.get_correct_file(self.tran_path,
                                             "_transcript.gff", prefix,
                                             None, None)
         gff = self.helper.get_correct_file(args_op.gffs, ".gff", prefix,
                                            None, None)
         if self.term_path is None:
             term = False
         else:
             term = self.helper.get_correct_file(self.term_path,
                                                 "_term.gff", prefix, None,
                                                 None)
         operon(tran, tss, gff, term, args_op.tss_fuzzy, args_op.term_fuzzy,
                args_op.length, out_table)