From 36521d8e99475e079b185c7924258d7a74a28130 Mon Sep 17 00:00:00 2001 From: Jay Hesselberth Date: Fri, 10 Jan 2025 12:03:10 -0700 Subject: [PATCH] Process files for squigualiser --- cluster/config.yaml | 3 +++ environment.yml | 8 +++++--- workflow/Snakefile | 1 + workflow/rules/common.smk | 9 +++++---- workflow/rules/squigualiser.smk | 33 +++++++++++++++++++++++++++++++++ 5 files changed, 47 insertions(+), 7 deletions(-) create mode 100644 workflow/rules/squigualiser.smk diff --git a/cluster/config.yaml b/cluster/config.yaml index ace6d5f..4cb91f6 100644 --- a/cluster/config.yaml +++ b/cluster/config.yaml @@ -32,6 +32,9 @@ set-resources: - cca_classify:queue="gpu" - cca_classify:gpu_opts="-gpu num=1:j_exclusive=yes" - cca_classify:ngpu=1 + - resquiggle:queue="gpu" + - resquiggle:gpu_opts="-gpu num=1:j_exclusive=yes" + - resquiggle:ngpu=1 printshellcmds: True diff --git a/environment.yml b/environment.yml index 708ef0b..20f2087 100644 --- a/environment.yml +++ b/environment.yml @@ -1,4 +1,4 @@ -name: aatrnaseqpipe +name: aa-trna-seq-pipeline channels: - conda-forge @@ -17,10 +17,12 @@ dependencies: - gitpython - pip - dorado >= 0.7.2 + - f5c + - squigualiser - pip: - pod5 - ont-remora >= 3.2 - snakemake-executor-plugin-lsf - snakemake-executor-plugin-slurm - - snakemake-executor-plugin-cluster-generic - - GPUtil + - snakemake-executor-plugin-cluster-generic + - blue-crab diff --git a/workflow/Snakefile b/workflow/Snakefile index fbc6dc2..7aa409c 100644 --- a/workflow/Snakefile +++ b/workflow/Snakefile @@ -14,6 +14,7 @@ PIPELINE_DIR = os.path.dirname(SNAKEFILE_DIR) include: "rules/common.smk" include: "rules/aatrnaseq.smk" +include: "rules/squigualiser.smk" report_metadata() diff --git a/workflow/rules/common.smk b/workflow/rules/common.smk index a5a12c5..ceb98dc 100644 --- a/workflow/rules/common.smk +++ b/workflow/rules/common.smk @@ -127,6 +127,11 @@ def pipeline_outputs(): values=["cpm", "counts"], ) + outs += expand( + os.path.join(outdir, "squigualizer", "{sample}", "{sample}.tsv"), + sample=samples.keys(), + ) + if ( "remora_kmer_table" in config and config["remora_kmer_table"] != "" @@ -137,10 +142,6 @@ def pipeline_outputs(): sample=samples.keys(), ) - # if "trna_table" in config and config["trna_table"] != "" and config["trna_table"] is not None: - # outs += expand(os.path.join(outdir, "tables", "{sample}", "{sample}.charging_status.tsv"), - # sample = samples.keys()) - return outs diff --git a/workflow/rules/squigualiser.smk b/workflow/rules/squigualiser.smk new file mode 100644 index 0000000..c84092c --- /dev/null +++ b/workflow/rules/squigualiser.smk @@ -0,0 +1,33 @@ + +rule blue_crab: + input: + rules.merge_pods.output, + output: + os.path.join(outdir, "squigualizer", "{sample}", "{sample}.blow5"), + log: + os.path.join(outdir, "logs", "blue_crab", "{sample}"), + shell: + """ + blue-crab p2s {input} -o {output} + """ + + +rule resquiggle: + input: + fastq=rules.ubam_to_fq.output, + signal=rules.blue_crab.output, + output: + os.path.join(outdir, "squigualizer", "{sample}", "{sample}.tsv"), + log: + os.path.join(outdir, "logs", "resquiggle", "{sample}"), + shell: + """ + f5c_x86_64_linux_cuda \ + resquiggle \ + # XXX -B depends on memory available + -B 10 \ + --rna \ + -c {input.fastq} \ + {input.signal} \ + -o {output} + """