snakemake

Snakemake - rule that downloads data

让人想犯罪 __ 提交于 2021-01-27 19:21:33
问题 I am having some trouble implementing a pipeline in which the first step is downloading the data from some server. As far as I understand, all rules must have inputs which are files. However, in my case the "input" is an ID string given to a script which accesses the server and downloads the data. I am aware of the remote files option in snakemake, but the server I am downloading from (ENA) is not on that list. Moreover, I am using a script which calls aspera in order to improve download

Snakemake - Problem trying to use global_wildcards (TypeError: expected str, got list)

感情迁移 提交于 2021-01-27 18:30:03
问题 I'm a newbie using Snakemake and not an expert in Python neither so the answer might be quite obvious. Everything in my workflow worked fine in my tests until I tried to use glob_wildcards in order to turn all of my fastq.gz files from one directory (FASTQDIR) into fastqc files . The samples names in the SAMPLES list are okay but I have an error saying that a string is expected instead of a list (I assume this is my SAMPLES list) and I don't really know where to act in my Snakefile in order

R Draws Plots with Rectangles Instead of Text

时光怂恿深爱的人放手 提交于 2021-01-27 07:00:40
问题 I'm building a pipeline with snakemake and using conda and singularity environments to ensure reproducibility. I run into an error where the text on my plots is replaced by rectangles After experimenting with the pipeline on Linux and Mac systems and disabling the singularity container, it appears the issue stems from a missing font library as the text is drawn normally when I only run the pipeline using only conda ( --use-conda ) on my Mac. The singularity container is built from this

R Draws Plots with Rectangles Instead of Text

こ雲淡風輕ζ 提交于 2021-01-27 07:00:28
问题 I'm building a pipeline with snakemake and using conda and singularity environments to ensure reproducibility. I run into an error where the text on my plots is replaced by rectangles After experimenting with the pipeline on Linux and Mac systems and disabling the singularity container, it appears the issue stems from a missing font library as the text is drawn normally when I only run the pipeline using only conda ( --use-conda ) on my Mac. The singularity container is built from this

What are the conditions for snakemake to execute a job?

大兔子大兔子 提交于 2021-01-03 08:05:33
问题 I would like to know all necessary criteria required for snakemake to decide that a job needs to be executed, but I couldn't find them in their documentation. The best source I have found is in snakemake author's slides from 2016, which says: A job is executed if and only if - output file is target and does not exist - output file needed by another executed job and does not exist - input file newer than output file - input file will be updated by other job - execution is enforced However it

Best practices for (bio)conda versions in Snakemake wrappers?

醉酒当歌 提交于 2020-12-31 15:14:43
问题 What would be best environment.yml practices for specifying packages in Snakemake wrappers using conda? I understand that the channels should be: channels: - conda-forge - bioconda - base However, what is a good choice for specifying packages? Do I specify no version? Full versions? Using full versions has led to using infinite/super long conda environment resoultion problems before. However, not pinning versions gives the risk of implicitely upgrading to an incompatible version of a package.

Best practices for (bio)conda versions in Snakemake wrappers?

六眼飞鱼酱① 提交于 2020-12-31 15:04:55
问题 What would be best environment.yml practices for specifying packages in Snakemake wrappers using conda? I understand that the channels should be: channels: - conda-forge - bioconda - base However, what is a good choice for specifying packages? Do I specify no version? Full versions? Using full versions has led to using infinite/super long conda environment resoultion problems before. However, not pinning versions gives the risk of implicitely upgrading to an incompatible version of a package.

Snakemake exit a rule during execution

こ雲淡風輕ζ 提交于 2020-12-15 06:17:28
问题 Is there a way to print a helpful message and allow Snakemake to exit the workflow without giving an error? I have this example workflow: def readFile(file): with open(file) as f: line = f.readline() return(line.strip()) def isFileEmpty(file): with open(file) as f: line = f.readline() if line.strip() != '': return True else: return False rule all: input: "output/final.txt" rule step1: input: "input.txt" output: "out.txt" run: if readFile(input[0]) == 'a': shell("echo 'a' > out.txt") else:

Snakemake - How do I use each line of a file as an input?

左心房为你撑大大i 提交于 2020-12-12 04:02:40
问题 I need to use each line of the file tissuesused.txt as an input for a parallelized rule in snakemake. I think there are about 48 jobs I would like to call in total. for line in $(cat tissuesused.txt) do echo "Sorting $line.phen_fastqtl.bed to $line/$line.pheno.bed..." bedtools sort -header -i $line/$line.phen_fastqtl.bed > $line/$line.pheno.bed echo "bgzipping $line/$line.pheno.bed..." bgzip -f $line/$line.pheno.bed #figure out where tabix outputs echo "Indexing $line/$line.pheno.bed.gz..."

Snakemake - How do I use each line of a file as an input?

我的梦境 提交于 2020-12-12 04:02:36
问题 I need to use each line of the file tissuesused.txt as an input for a parallelized rule in snakemake. I think there are about 48 jobs I would like to call in total. for line in $(cat tissuesused.txt) do echo "Sorting $line.phen_fastqtl.bed to $line/$line.pheno.bed..." bedtools sort -header -i $line/$line.phen_fastqtl.bed > $line/$line.pheno.bed echo "bgzipping $line/$line.pheno.bed..." bgzip -f $line/$line.pheno.bed #figure out where tabix outputs echo "Indexing $line/$line.pheno.bed.gz..."