Exemple #1
0
 def get_command(self, cfg):
     return [commands_parser.Command(STAGE=self.STAGE_NAME,
                                     path="true",
                                     args=[],
                                     short_name=self.short_name + "_start")] + \
            [x for stage in self.stages for x in stage.get_command(self.cfg)] + \
            [commands_parser.Command(STAGE=self.STAGE_NAME,
                                     path="true",
                                     args=[],
                                     short_name=self.short_name + "_finish")]
 def get_command(self, cfg):
     return [commands_parser.Command(STAGE=self.STAGE_NAME,
                                     path="true",
                                     args=[],
                                     short_name=self.short_name + "_start")] + \
            [x for stage in self.stages for x in stage.get_command(cfg)] + \
            [commands_parser.Command(STAGE=self.STAGE_NAME,
                                     path="true",
                                     args=[],
                                     short_name=self.short_name + "_finish",
                                     del_after=[os.path.relpath(self.tmp_dir, options_storage.args.output_dir)])]
Exemple #3
0
    def get_command(self, cfg):
        dst_configs = os.path.join(cfg.output_dir, "configs")
        if cfg.iontorrent:
            cfg_file_name = os.path.join(dst_configs, "ionhammer.cfg")
        else:
            cfg_file_name = os.path.join(dst_configs, "config.info")

        if cfg.iontorrent:
            binary_name = "spades-ionhammer"
        else:
            binary_name = "spades-hammer"

        command = [
            commands_parser.Command(
                STAGE="Read error correction",
                path=os.path.join(self.bin_home, binary_name),
                args=[os.path.abspath(cfg_file_name)],
                config_dir=os.path.relpath(cfg.output_dir,
                                           options_storage.args.output_dir),
                short_name=self.short_name,
                del_after=[cfg.tmp_dir],
                output_files=[
                    self.output_files["corrected_dataset_yaml_filename"]
                ])
        ]
        return command
    def get_command(self, cfg):
        args = [
            os.path.join(self.python_modules_home, "spades_pipeline",
                         "scripts", "check_test_script.py")
        ]
        if options_storage.args.truseq_mode:
            args += [
                "--mode", "truseq", "--truseq_long_reads_file",
                self.output_files["truseq_long_reads_file"]
            ]
        elif options_storage.args.rna:
            args += [
                "--mode", "rna", "--result_transcripts_filename",
                self.output_files["result_transcripts_filename"]
            ]
        else:
            if options_storage.args.plasmid:
                args += ["--mode", "plasmid"]
            else:
                args += ["--mode", "common"]

            args += [
                "--result_contigs_filename",
                self.output_files["result_contigs_filename"],
                "--result_scaffolds_filename",
                self.output_files["result_scaffolds_filename"]
            ]

        return [
            commands_parser.Command(STAGE=self.STAGE_NAME,
                                    path=sys.executable,
                                    args=args,
                                    short_name=self.short_name)
        ]
Exemple #5
0
    def get_command(self, cfg):
        args = [
            os.path.join(self.python_modules_home, "spades_pipeline",
                         "scripts", "correction_iteration_script.py"),
            "--corrected", self.corrected, "--assembled", self.assembled,
            "--assembly_type", self.assembly_type, "--output_dir",
            cfg["common"].output_dir, "--bin_home", self.bin_home
        ]

        return [
            commands_parser.Command(
                STAGE=self.STAGE_NAME,
                path=sys.executable,
                args=args,
                config_dir=os.path.relpath(self.cfg.output_dir,
                                           options_storage.args.output_dir),
                short_name=self.short_name,
                del_after=[
                    os.path.join(
                        os.path.relpath(self.cfg.output_dir,
                                        options_storage.args.output_dir),
                        "tmp"),
                    os.path.relpath(self.cfg.tmp_dir,
                                    options_storage.args.output_dir)
                ])
        ]
Exemple #6
0
 def get_command(self, cfg):
     self.cfg = cfg
     self.set_output_files()
     args = [
         os.path.join(self.python_modules_home, "spades_pipeline",
                      "scripts", "copy_files.py")
     ]
     for outputfile in self.output:
         if outputfile.need_to_copy(outputfile, self.latest, self.cfg):
             filename = os.path.join(self.latest, outputfile.tmp_file)
             args.append(filename)
             args.append(outputfile.output_file)
     bin_reads_dir = os.path.join(self.cfg.output_dir, ".bin_reads")
     command = [
         commands_parser.Command(
             STAGE=self.STAGE_NAME,
             path=sys.executable,
             args=args,
             short_name=self.short_name,
             del_after=[
                 os.path.relpath(bin_reads_dir,
                                 options_storage.args.output_dir),
                 os.path.relpath(self.cfg.tmp_dir,
                                 options_storage.args.output_dir)
             ])
     ]
     return command
Exemple #7
0
 def get_command(self, cfg):
     return [
         commands_parser.Command(STAGE=self.STAGE_NAME,
                                 path="true",
                                 args=[],
                                 short_name=self.short_name,
                                 del_after=self.tmp_files)
     ]
    def get_command(self, cfg):
        args = [os.path.join(self.python_modules_home, "spades_pipeline", "scripts", "breaking_scaffolds_script.py"),
                "--result_scaffolds_filename", self.output_files["result_scaffolds_filename"],
                "--misc_dir", self.output_files["misc_dir"],
                "--threshold_for_breaking_scaffolds", str(options_storage.THRESHOLD_FOR_BREAKING_SCAFFOLDS)]

        return [commands_parser.Command(STAGE=self.STAGE_NAME,
                                        path=sys.executable,
                                        args=args,
                                        short_name=self.short_name)]
Exemple #9
0
    def get_command(self, cfg):
        del_after = []
        if not cfg["common"].developer_mode:
            del_after.append(self.tmp_configs_dir)

        return [
            commands_parser.Command(STAGE=self.STAGE_NAME,
                                    path="true",
                                    args=[],
                                    short_name=self.short_name,
                                    del_after=del_after)
        ]
Exemple #10
0
    def get_command(self, cfg):
        data_dir = os.path.join(cfg.output_dir, "K%d" % self.K)
        dst_configs = os.path.join(data_dir, "configs")
        cfg_fn = os.path.join(dst_configs, "config.info")
        args = [cfg_fn]
        add_configs(args, dst_configs)

        command = [commands_parser.Command(
            STAGE="K%d" % self.K,
            path=os.path.join(self.bin_home, "spades-core"),
            args=args,
            config_dir=os.path.relpath(data_dir, options_storage.args.output_dir),
            short_name=self.short_name)]
        return command
    def get_command(self, cfg):
        del_after = []
        if not cfg["common"].developer_mode:
            del_after.append(
                os.path.relpath(self.tmp_configs_dir,
                                options_storage.args.output_dir))

        return [
            commands_parser.Command(STAGE=self.STAGE_NAME,
                                    path="true",
                                    args=[],
                                    short_name=self.short_name,
                                    del_after=del_after)
        ]
 def get_command(self, cfg):
     command = [
         commands_parser.Command(
             STAGE=self.STAGE_NAME,
             path=sys.executable,
             args=[
                 os.path.join(self.python_modules_home, "spades_pipeline",
                              "scripts", "preprocess_interlaced_reads.py"),
                 "--args_filename",
                 os.path.join(self.tmp_dir, "interlaced"), "--dst", self.dst
             ],
             short_name=self.short_name)
     ]
     return command
 def get_command(self, cfg):
     self.cfg = cfg
     args = [
         os.path.join(self.python_modules_home, "spades_pipeline",
                      "scripts", "plasmid_glue.py")
     ]
     args.append(self.latest)
     command = [
         commands_parser.Command(
             STAGE=self.STAGE_NAME,
             path=sys.executable,
             args=args,
             short_name=self.short_name,
         )
     ]
     return command
 def get_command(self, cfg):
     command = [
         commands_parser.Command(
             STAGE=self.STAGE_NAME,
             path=sys.executable,
             args=[
                 os.path.join(self.python_modules_home, "spades_pipeline",
                              "scripts", "preprocess_nxmate_reads.py"),
                 "--args_filename",
                 os.path.join(self.tmp_dir,
                              "nxmate"), "--dst", self.dst, "--threads",
                 str(options_storage.args.threads)
             ],
             short_name=self.short_name)
     ]
     return command
 def get_command(self, cfg):
     command = [
         commands_parser.Command(
             STAGE=self.STAGE_NAME,
             path=sys.executable,
             args=[
                 os.path.join(self.python_modules_home, "spades_pipeline",
                              "scripts", "preprocess_contigs.py"),
                 "--args_filename",
                 os.path.join(self.tmp_dir, "contigs"), "--dst", self.dst,
                 "--threshold_for_breaking_additional_contigs",
                 str(options_storage.
                     THRESHOLD_FOR_BREAKING_ADDITIONAL_CONTIGS)
             ],
             short_name=self.short_name)
     ]
     return command
    def get_command(self, cfg):
        K = options_storage.SCC_K
        data_dir = os.path.join(cfg.output_dir, "SCC", "K%d" % K)
        dst_configs = os.path.join(data_dir, "configs")
        cfg_file_name = os.path.join(dst_configs, "config.info")

        args = [cfg_file_name]
        add_configs(args, dst_configs)
        command = [
            commands_parser.Command(
                STAGE="SCC",
                path=os.path.join(self.bin_home,
                                  "spades-truseq-scfcorrection"),
                args=args,
                config_dir=os.path.relpath(data_dir,
                                           options_storage.args.output_dir),
                short_name=self.short_name)
        ]
        return command
Exemple #17
0
    def get_command(self, cfg):
        args = [
            os.path.join(self.python_modules_home, "spades_pipeline",
                         "scripts", "compress_all.py"), "--input_file",
            self.output_files["corrected_dataset_yaml_filename"],
            "--ext_python_modules_home", self.ext_python_modules_home,
            "--max_threads",
            str(cfg.max_threads), "--output_dir", cfg.output_dir
        ]
        if cfg.not_used_dataset_yaml_filename != "":
            args += [
                "--not_used_yaml_file", cfg.not_used_dataset_yaml_filename
            ]
        if cfg.gzip_output:
            args.append("--gzip_output")

        command = [
            commands_parser.Command(STAGE="corrected reads compression",
                                    path=sys.executable,
                                    args=args,
                                    short_name=self.short_name)
        ]
        return command
Exemple #18
0
    def get_command(self, cfg):
        # args: result_scaffolds_filename, assembled_scaffolds_filename, bin_home, ext_python_modules_home, output_dir, truseq_long_reads_file_base, dataset_yaml_file
        args = [
            os.path.join(self.python_modules_home, "spades_pipeline",
                         "scripts", "postprocessing_script.py"),
            "--result_scaffolds_filename",
            self.output_files["result_scaffolds_filename"],
            "--assembled_scaffolds_filename",
            self.output_files["assembled_scaffolds_filename"], "--bin_home",
            self.bin_home, "--ext_python_modules_home",
            self.ext_python_modules_home, "--output_dir",
            cfg["common"].output_dir, "--truseq_long_reads_file_base",
            self.output_files["truseq_long_reads_file_base"],
            "--dataset_yaml_file", options_storage.args.dataset_yaml_filename,
            "--threads",
            str(options_storage.args.threads)
        ]

        return [
            commands_parser.Command(STAGE=self.STAGE_NAME,
                                    path=sys.executable,
                                    args=args,
                                    short_name=self.short_name)
        ]