Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dryrun_snakemake.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ conda activate qiime2-2023.2

set -xeuo pipefail

if [[ -f config.yaml ]]; then
if [[ ! -f config.yaml ]]; then
echo "Must have a config.yaml to be able to run"
exit 1
fi
Expand Down
10 changes: 5 additions & 5 deletions qiime2_config.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
all:
project_dir: "/mnt/isilon/microbiome/analysis/userid/16S_QIIME2/test"
project_dir: "/scr1/users/path/to/project"
mux_dir: "multiplexed_fastq"
mapping: "test_mapping_file.tsv"
admin_email: "userid@email"
mapping: "mapping_table.tsv"

#try revcomp if you are getting 0 reads when demultiplexing
demux:
mismatch: 0
revcomp: false
revcomp: true

#~240 for V1V2, ~280 for V3V4
denoise:
trim_left_f: 0
trunc_len_f: 240
trim_left_r: 0
trunc_len_r: 240
filter_taxa: "" # e.g. g__Cutibacterium, g__Anoxybacillus, f__Comamonadaceae, g__Acidovorax, g__Ralstonia
#threads are now specificed in config.yaml

taxonomy:
classifier_fp: "/mnt/isilon/microbiome/analysis/biodata/silva/silva_138/silva-138-99-nb-classifier.qza"

diversity:
sampling_depth: 100
sampling_depth: 1000
#100 is just for testing, recommend change to 1000

unassign:
Expand Down
4 changes: 2 additions & 2 deletions rules/demux/dnabc.rules
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ rule run_dnabc:
shell("""
mkdir -p {params.demux_dir}
touch {output.demux_fastq}
dnabc.py \
dnabc \
--revcomp \
--output-dir {params.demux_dir} \
--mismatches {params.mismatch} \
Expand All @@ -46,7 +46,7 @@ rule run_dnabc:
shell("""
mkdir -p {params.demux_dir}
touch {output.demux_fastq}
dnabc.py \
dnabc \
--output-dir {params.demux_dir} \
--mismatches {params.mismatch} \
--manifest-file {output.manifest_fp} \
Expand Down
28 changes: 25 additions & 3 deletions rules/denoise/denoise.rules
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ rule run_dada2:
QIIME_OUTPUT_DIR + "/demux.qza"
threads: 1 #should be overridden by config.yaml
output:
feature_table = DENOISE_DIR + "/table_main.qza",
feature_table = DENOISE_DIR + "/table_raw.qza",
rep_seq = DENOISE_DIR + "/representative-seqs.qza",
stat = DENOISE_DIR + "/denoise_stats.qza"
shell:
Expand Down Expand Up @@ -78,13 +78,35 @@ rule denoising_stats_export:

rule filter_empty:
input:
DENOISE_DIR + "/table_main.qza"
DENOISE_DIR + "/table_raw.qza"
output:
DENOISE_DIR + "/table.qza"
DENOISE_DIR + "/table_filtered_empty.qza"
shell:
"""
qiime feature-table filter-samples \
--i-table {input} \
--p-min-frequency 1 \
--o-filtered-table "{output}"
"""

rule filter_taxa:
input:
feature_table = DENOISE_DIR + "/table_filtered_empty.qza",
classification_table = DENOISE_DIR + "/taxonomy/classification.qza"
params:
taxa_to_filter = config["denoise"]["filter_taxa"]
output:
DENOISE_DIR + "/table.qza"
run:
if params.taxa_to_filter:
shell("""
qiime taxa filter-table \
--i-table {input.feature_table} \
--i-taxonomy {input.classification_table} \
--p-exclude "{params.taxa_to_filter}" \
--o-filtered-table {output}
""")
else:
shell("""
cp {input.feature_table} {output}
""")
2 changes: 1 addition & 1 deletion run_snakemake.bash
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#SBATCH -n 1
#SBATCH --export=ALL
#SBATCH --mail-user=$USER@chop.edu
#SBATCH --mail-type=BEGIN,END,FAIL
#SBATCH --mail-type=END,FAIL
#SBATCH --no-requeue
#SBATCH -t 72:00:00
#SBATCH --output=slurm_%x_%j.out
Expand Down