Skip to content

Commit 3380a05

Browse files
fix: Fixing workflow for single-end sequencing (#70)
* Correcting path for `cutadapt_se` and params for cutadapt wrapper. * fix formatting * better error message in gene2symbol.R * apply dirty fix in biomart.yaml the same fix as applied here: snakemake-workflows/rna-seq-kallisto-sleuth@5bf0c52 original solution can be found here: https://stackoverflow.com/a/77370920 --------- Co-authored-by: David Laehnemann <david.laehnemann@hhu.de>
1 parent 846693f commit 3380a05

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

workflow/envs/biomart.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ channels:
55
dependencies:
66
- bioconductor-biomart =2.56
77
- r-tidyverse =2.0
8+
# remove once we can update to bioconductor-biomart of the 3.18 release, which will
9+
# include this proper fix for the underlying compatibility issue:
10+
# https://github.com/Bioconductor/BiocFileCache/pull/50
11+
- r-dbplyr=2.3.4

workflow/rules/common.smk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ def get_fq(wildcards):
119119
)
120120
)
121121
# single end sample
122-
return {"fq1": "trimmed/{sample}_{unit}_single.fastq.gz".format(**wildcards)}
122+
return {
123+
"fq1": "results/trimmed/{sample}_{unit}_single.fastq.gz".format(**wildcards)
124+
}
123125
else:
124126
# no trimming, use raw reads
125127
u = units.loc[(wildcards.sample, wildcards.unit)]

workflow/rules/trim.smk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ rule cutadapt_se:
4949
"logs/cutadapt/{sample}_{unit}.log",
5050
params:
5151
extra=config["params"]["cutadapt-se"],
52-
adapters_r1=lambda w: str(units.loc[w.sample].loc[w.unit, "adapters"]),
52+
adapters=lambda w: str(units.loc[w.sample].loc[w.unit, "adapters"]),
5353
threads: 8
5454
wrapper:
5555
"v1.21.4/bio/cutadapt/se"

workflow/scripts/gene2symbol.R

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
library(biomaRt)
22
library(tidyverse)
3+
# useful error messages upon aborting
4+
library("cli")
35

46
# this variable holds a mirror name until
57
# useEnsembl succeeds ("www" is last, because
@@ -24,7 +26,14 @@ while ( class(mart)[[1]] != "Mart" ) {
2426
# change or make configurable if you want more or
2527
# less rounds of tries of all the mirrors
2628
if (rounds >= 3) {
27-
stop(
29+
cli_abort(
30+
str_c(
31+
"Have tried all 4 available Ensembl biomaRt mirrors ",
32+
rounds,
33+
" times. You might have a connection problem, or no mirror is responsive.\n",
34+
"The last error message was:\n",
35+
message(e)
36+
)
2837
)
2938
}
3039
# hop to next mirror

0 commit comments

Comments
 (0)