예제 #1
0
 def test_optimize_tss(self):
     opt.Helper = Mock_helper
     opt.Multiparser = Mock_multiparser
     opt.optimization = Mock_func().mock_optimization
     gen_file(os.path.join(self.gffs, "tmp", "test.gff"), "test")
     gen_file(os.path.join(self.fastas, "tmp", "test.fa"), "test")
     args = self.mock_args.mock()
     args.fastas = self.fastas
     args.gffs = self.gffs
     args.wigs = self.wigs
     args.tsspredator_path = "test"
     args.manuals = self.manuals
     gen_file(os.path.join(self.manuals, "tmp", "test.gff"), "test")
     args.output_folder = self.test_folder
     args.project_strain = "test"
     args.height = 9
     args.height_reduction = 9
     args.factor = 9
     args.factor_reduction = 9
     args.base_height = 9
     args.enrichment = 9
     args.processing = 9
     args.utr = 200
     args.libs = "test"
     args.replicate_name = "test"
     args.cluster = 2
     args.strain_lengths = {"test": 100}
     args.cores = 4
     args.program = "TSS"
     args.replicate = 2
     args.steps = 2000
     opt.optimize_tss(args)
     self.assertTrue(
         os.path.exists(os.path.join(self.test_folder, "test.csv")))
예제 #2
0
 def optimize(self):
     """opimize TSSpredator"""
     self.check_folder([
         self._args.wig_folder, self._args.fasta_file,
         self._args.annotation_file
     ])
     self.check_file([self._args.manual], ["--manual"], True)
     self.check_parameter(
         [self._args.strain_name, self._args.lib, self._args.output_prefix],
         ["--strain_name", "--lib", "--output_prefix"])
     if self._args.program.lower() == "tss":
         print("Running optimization of TSS prediction...")
         project_creator.create_subfolders(
             self._paths.required_folders("TSS"))
         out_folder = self._paths.tsspredator_folder
     elif self._args.program.lower() == "processing_site":
         print("Running optimization of processing site prediction...")
         out_folder = self._paths.processing_site_folder
         project_creator.create_subfolders(
             self._paths.required_folders("processing"))
     else:
         print("Error:No such program!!!!")
         sys.exit()
     args_ops = self.args_container.container_optimize(
         self._args.TSSpredator_path, self._args.fasta_file,
         self._args.annotation_file, self._args.wig_folder,
         self._args.manual, out_folder, self._args.strain_name,
         self._args.max_height, self._args.max_height_reduction,
         self._args.max_factor, self._args.max_factor_reduction,
         self._args.max_base_height, self._args.max_enrichment_factor,
         self._args.max_processing_factor, self._args.utr_length,
         self._args.lib, self._args.output_prefix, self._args.cluster,
         self._args.length, self._args.core, self._args.program,
         self._args.replicate_match, self._args.steps)
     optimize_tss(args_ops)
예제 #3
0
 def optimize(self):
     """opimize TSSpredator"""
     self.check_multi_files(
             [self._args.fasta_files, self._args.annotation_files,
              self._args.manual_files],
             ["--fasta_files", "--annotation_files", "--manual_files"])
     self._args.tsspredator_path = self.check_execute_file(
             self._args.tsspredator_path)
     self.check_parameter([self._args.tex_notex_libs,
                           self._args.condition_names],
                          ["--tex_notex_lib",
                           "--condition_names"])
     if self._args.program.lower() == "tss":
         print("Running optimization of TSS prediction")
         project_creator.create_subfolders(
             self._paths.required_folders("TSS"))
         out_folder = self._paths.tsspredator_folder
     elif self._args.program.lower() == "ps":
         print("Running optimization of processing site prediction")
         out_folder = self._paths.processing_site_folder
         project_creator.create_subfolders(
             self._paths.required_folders("processing"))
     else:
         print("Error: No such program!")
         sys.exit()
     args_ops = self.args_container.container_optimize(
         self._args.tsspredator_path, self._args.fasta_files,
         self._args.annotation_files,
         self._args.manual_files, out_folder, self._args.max_height,
         self._args.max_height_reduction, self._args.max_factor,
         self._args.max_factor_reduction, self._args.max_base_height,
         self._args.max_enrichment_factor, self._args.max_processing_factor,
         self._args.utr_length, self._args.tex_notex_libs,
         self._args.condition_names, self._args.cluster,
         self._args.curated_sequence_length, self._args.parallels,
         self._args.program, self._args.replicate_tex,
         self._args.steps)
     optimize_tss(args_ops)
예제 #4
0
 def test_optimize_tss(self):
     opt.Helper = Mock_helper
     opt.Multiparser = Mock_multiparser
     opt.optimization = Mock_func().mock_optimization
     gen_file(os.path.join(self.gffs, "tmp", "test.gff"), "test")
     gen_file(os.path.join(self.fastas, "tmp", "test.fa"), "test")
     args = self.mock_args.mock()
     args.fastas = self.fastas
     args.gffs = self.gffs
     args.wigs = self.wigs
     args.tsspredator_path = "test"
     args.manuals = self.manuals
     gen_file(os.path.join(self.manuals, "tmp", "test.gff"), "test")
     args.output_folder = self.test_folder
     args.project_strain = "test"
     args.height = 9
     args.height_reduction = 9
     args.factor = 9
     args.factor_reduction = 9
     args.base_height = 9
     args.enrichment = 9
     args.processing = 9
     args.utr = 200
     args.libs = "test"
     args.replicate_name = "test"
     args.cluster = 2
     args.strain_lengths = {"test": 100}
     args.cores = 4
     args.program = "TSS"
     args.replicate = 2
     args.steps = 2000
     log = open(os.path.join(self.test_folder, "test.log"), "w")
     opt.optimize_tss(args, log)
     self.assertTrue(os.path.exists(os.path.join(
         self.test_folder, "test.csv")))
     log.close()
예제 #5
0
 def optimize(self):
     """opimize TSSpredator"""
     self.check_folder([self._args.wig_folder, self._args.fasta_file,
                        self._args.annotation_file])
     self.check_file([self._args.manual],
                     ["--manual"], True)
     self.check_parameter([self._args.strain_name, self._args.lib,
                           self._args.output_prefix],
                          ["--strain_name", "--lib", "--output_prefix"])
     if self._args.program.lower() == "tss":
         print("Running optimization of TSS prediction...")
         project_creator.create_subfolders(
             self._paths.required_folders("TSS"))
         out_folder = self._paths.tsspredator_folder
     elif self._args.program.lower() == "processing_site":
         print("Running optimization of processing site prediction...")
         out_folder = self._paths.processing_site_folder
         project_creator.create_subfolders(
             self._paths.required_folders("processing"))
     else:
         print("Error:No such program!!!!")
         sys.exit()
     args_ops = self.args_container.container_optimize(
         self._args.TSSpredator_path, self._args.fasta_file,
         self._args.annotation_file, self._args.wig_folder,
         self._args.manual, out_folder,
         self._args.strain_name, self._args.max_height,
         self._args.max_height_reduction, self._args.max_factor,
         self._args.max_factor_reduction, self._args.max_base_height,
         self._args.max_enrichment_factor, self._args.max_processing_factor,
         self._args.utr_length, self._args.lib,
         self._args.output_prefix, self._args.cluster,
         self._args.length, self._args.core,
         self._args.program, self._args.replicate_match,
         self._args.steps)
     optimize_tss(args_ops)