From 75febcce798cd2d0e59a46152d25a0c80105c6ea Mon Sep 17 00:00:00 2001 From: "Scott G. Daniel" Date: Fri, 17 May 2024 16:12:34 -0400 Subject: [PATCH 1/3] fixed a little error --- dryrun_snakemake.bash | 2 +- run_snakemake.bash | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dryrun_snakemake.bash b/dryrun_snakemake.bash index 8ab609d..31cfbfa 100644 --- a/dryrun_snakemake.bash +++ b/dryrun_snakemake.bash @@ -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 diff --git a/run_snakemake.bash b/run_snakemake.bash index f24ea95..fe8d979 100755 --- a/run_snakemake.bash +++ b/run_snakemake.bash @@ -3,8 +3,8 @@ #SBATCH --mem=2G #SBATCH -n 1 #SBATCH --export=ALL -#SBATCH --mail-user=userid@email -#SBATCH --mail-type=BEGIN,END,FAIL +#SBATCH --mail-user=$USER@chop.edu +#SBATCH --mail-type=END,FAIL #SBATCH --no-requeue #SBATCH -t 72:00:00 #SBATCH --output=slurm_%x_%j.out From 8e0a332ef3e6e200c04aec019077cd0c2f9ce727 Mon Sep 17 00:00:00 2001 From: "Scott G. Daniel" Date: Fri, 17 May 2024 16:16:59 -0400 Subject: [PATCH 2/3] filtering taxa --- qiime2_config.yml | 10 +++++----- rules/denoise/denoise.rules | 28 +++++++++++++++++++++++++--- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/qiime2_config.yml b/qiime2_config.yml index 8b8e7e8..dbf1a06 100644 --- a/qiime2_config.yml +++ b/qiime2_config.yml @@ -1,13 +1,12 @@ 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: @@ -15,13 +14,14 @@ denoise: 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: diff --git a/rules/denoise/denoise.rules b/rules/denoise/denoise.rules index d07d795..1a3fc89 100644 --- a/rules/denoise/denoise.rules +++ b/rules/denoise/denoise.rules @@ -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: @@ -78,9 +78,9 @@ 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 \ @@ -88,3 +88,25 @@ rule filter_empty: --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} + """) \ No newline at end of file From f351d5663aaadb48309111b4c2b77bdf21215836 Mon Sep 17 00:00:00 2001 From: "Scott G. Daniel" Date: Tue, 24 Sep 2024 13:46:08 -0400 Subject: [PATCH 3/3] updated for more recent dnabc --- rules/demux/dnabc.rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rules/demux/dnabc.rules b/rules/demux/dnabc.rules index 878c9c1..11f4a82 100644 --- a/rules/demux/dnabc.rules +++ b/rules/demux/dnabc.rules @@ -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} \ @@ -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} \