def test_pipeline_manager(): from sequana.pipelines_common import PipelineManager from sequana.pipelines_common import SequanaManager from sequana.pipelines_common import InputOptions from sequana.pipelines_common import SlurmOptions from sequana.pipelines_common import SnakemakeOptions from sequana.pipelines_common import GeneralOptions from sequana.pipelines_common import CutadaptOptions p = argparse.ArgumentParser() so = GeneralOptions() so.add_options(p) so = InputOptions() so.add_options(p) so = SnakemakeOptions() so.add_options(p) so = SlurmOptions() so.add_options(p) so = CutadaptOptions() so.add_options(p) from tempfile import TemporaryDirectory with TemporaryDirectory() as fout: options = p.parse_args(["--working-directory", fout, "--force"]) pm = SequanaManager(options, "quality_control") from sequana.pipelines_common import get_pipeline_location as getpath sharedir = getpath('quality_control') pm.config.config.input_directory = sharedir pm.config.config.input_readtag = options.input_readtag pm.config.config.input_pattern = options.input_pattern pm.setup() pm.update_config(pm.config.config, options, "cutadapt") pm.teardown() options = p.parse_args([ "--working-directory", fout, "--force", "--run-mode", "local", "--slurm-queue", "common" ]) pm = PipelineManager(options, "quality_control") pm.setup() options = p.parse_args([ "--working-directory", fout, "--force", "--run-mode", "slurm", "--slurm-queue", "common" ]) pm = PipelineManager(options, "quality_control") pm.setup()
import easydev import os import tempfile import subprocess import sys from sequana.pipelines_common import get_pipeline_location as getpath sharedir = getpath('mapper') def test_standalone_subprocess(): directory = tempfile.TemporaryDirectory() cmd = """sequana_pipelines_mapper --input-directory {} --working-directory {} --force""".format(sharedir, directory.name) subprocess.call(cmd.split()) def test_standalone_script(): directory = tempfile.TemporaryDirectory() import sequana_pipelines.mapper.main as m sys.argv = ["test", "--input-directory", sharedir, "--reference-file", sharedir + "/measles.fa", "--working-directory", directory.name, "--force"] m.main() def test_standalone_script_minimap2(): directory = tempfile.TemporaryDirectory() import sequana_pipelines.mapper.main as m sys.argv = ["test", "--input-directory", sharedir, "--reference-file", sharedir + "/measles.fa",
import easydev import os import tempfile import subprocess import sys from sequana.pipelines_common import get_pipeline_location as getpath sharedir = getpath("rnaseq") saccer3 = getpath("rnaseq") + "/Saccer3/" #sequana_path = easydev.get_package_location('sequana_rnaseq') #sharedir = os.sep.join([sequana_path , "sequana", 'data']) def test_standalone_subprocess(): directory = tempfile.TemporaryDirectory() cmd = """sequana_pipelines_rnaseq --input-directory {} --working-directory {} --rnadiff-mode one_factor""".format( sharedir, directory.name) subprocess.call(cmd.split()) def test_standalone_script(): directory = tempfile.TemporaryDirectory() import sequana_pipelines.rnaseq.main as m sys.argv = [ "test", "--input-directory", sharedir, "--genome-directory", saccer3, "--force", "--aligner", "bowtie2", "--rnadiff-mode", "one_factor", "--feature-counts-feature-type", 'gene,tRNA', "--rRNA-feature", "rRNA_gene" ] # ideally should be rRNA but current m.main()
import easydev import os import tempfile import subprocess import sys from sequana.pipelines_common import get_pipeline_location as getpath sharedir = getpath('merge_flowcells') data1 = sharedir + "/flowcell1" data2 = sharedir + "/flowcell2" def test_standalone_subprocess(): directory = tempfile.TemporaryDirectory() cmd = """sequana_pipelines_merge_flowcells --flowcells {} {} --working-directory {} --force""".format(data1, data2, directory.name) subprocess.call(cmd.split()) def test_standalone_script(): directory = tempfile.TemporaryDirectory() import sequana_pipelines.merge_flowcells.main as m sys.argv = [ "test", "--flowcell-paths", data1, data2, "--working-directory", directory.name, "--force" ] m.main() def test_full():
import easydev import os import tempfile import subprocess import sys from sequana.pipelines_common import get_pipeline_location as getpath sharedir = getpath('downsampling') def test_standalone_subprocess(): directory = tempfile.TemporaryDirectory() cmd = """sequana_pipelines_downsampling --input-directory {} --working-directory {} --force""".format(sharedir, directory.name) subprocess.call(cmd.split()) def test_standalone_script(): directory = tempfile.TemporaryDirectory() import sequana_pipelines.downsampling.main as m sys.argv = ["test", "--input-directory", sharedir, "--working-directory", directory.name, "--force"] m.main() def test_full(): with tempfile.TemporaryDirectory() as directory: wk = directory cmd = "sequana_pipelines_downsampling --input-directory {} " cmd += "--working-directory {} --force"