Snakemake for demultiplexing 16S sequencing files using QIIME1 on the cluster.

public public 1yr ago 0 bookmarks
  1. Login to HTCF.

  2. Move to your /scratch/ directory.

  3. Clone the repo:

git clone --recurse-submodules git@github.com:RachelRodgers/demux-htcf-snake.git
  1. Make a directory to hold the snakemake profile:
mkdir -p ~/.config/snakemake/slurm_demux
  1. Edit line 2 of the config.yaml file to include your email address:
--mail-user=<yourEmailAddress>
  1. Copy the cluster submit and profile files to the appropriate locations:
cd demux-htcf-snake
cp config/config.yaml ~/.config/snakemake/slurm_demux
cp slurm-submit/*.py ~/.config/snakemake
  1. Create a directory to hold your sequences to be demultiplexed and move your data to that directory.

  2. Create a directory to hold your mapping file and copy your mapping file to that directory.

  3. Edit the ./config/demux_config.yaml file appropriately.

  4. Submit in one of two ways: a. With sbatch script:

    sbatch submit_demux_snake.sbatch
    

    b. Interactively:

    # start an interactive session
    interactive
    # load snakemake 5.10
    ml snakemake/5.10.0-python-3.6.5
    # dry run (prints steps and stops)
    snakemake --profile slurm_demux -np
    # production run:
    snakemake --profile slurm_demux
    
  5. See slurm output files in the logs_slurm/ directory which will generate inside the repository's directory.

Code Snippets

91
92
93
94
95
96
97
shell:
	"""
	cat {input.r1} > {output.r1}
	cat {input.r2} > {output.r2}
	cat {input.i1} > {output.i1}
	cat {input.i2} > {output.i2}
	"""
107
108
109
110
111
shell:
	"""
	ml qiime
	bash ./workflow/scripts/extractCommand.sh
	"""
121
122
123
124
125
126
127
128
129
130
131
132
shell:
	"""
	ml qiime
	split_libraries_fastq.py \
		-i {input.r1} \
		-b {input.bc} \
		-o {params.outdir} \
		-m {MAP} \
		--barcode_type {bc_type} \
		--store_demultiplexed_fastq \
		-r 999 -n 999 -q 0 -p 0.001
	"""
142
143
144
145
146
147
148
149
150
151
152
153
154
shell:
	"""
	ml qiime
	split_libraries_fastq.py \
		-i {input.r2} \
		-b {input.bc} \
		-o {params.outdir} \
		-m {MAP} \
		--barcode_type {bc_type} \
		--store_demultiplexed_fastq \
		--rev_comp \
		-r 999 -n 999 -q 0 -p 0.001
	"""
164
165
166
167
168
169
170
171
shell:
	"""
	ml qiime
	split_sequence_file_on_sample_ids.py \
		-i {input} \
		-o {params} \
		--file_type fastq
	"""
181
182
183
184
185
186
187
188
shell:
	"""
	ml qiime
	split_sequence_file_on_sample_ids.py \
		-i {input} \
		-o {params} \
		--file_type fastq
	"""
197
198
199
200
201
202
shell:
	"""
	rename 's/\.fastq$/_R1.fastq/' ./results/split_samples_R1/*fastq

	rename 's/\.fastq$/_R2.fastq/' ./results/split_samples_R2/*fastq
	"""
211
212
213
214
215
216
shell:
	"""
	cp ./results/split_samples_R1/*.fastq ./results/compressed/
	mv ./results/split_samples_R2/*.fastq ./results/compressed/
	gzip ./results/compressed/*
	"""
ShowHide 7 more snippets with no or duplicated tags.

Login to post a comment if you would like to share your experience with this workflow.

Do you know this workflow well? If so, you can request seller status , and start supporting this workflow.

Free

Created: 1yr ago
Updated: 1yr ago
Maitainers: public
URL: https://github.com/RachelRodgers/demux-htcf-snake
Name: demux-htcf-snake
Version: 1
Badge:
workflow icon

Insert copied code into your website to add a link to this workflow.

Downloaded: 0
Copyright: Public Domain
License: None
  • Future updates

Related Workflows

cellranger-snakemake-gke
snakemake workflow to run cellranger on a given bucket using gke.
A Snakemake workflow for running cellranger on a given bucket using Google Kubernetes Engine. The usage of this workflow ...