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
76 changes: 76 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Test

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: setup-conda
uses: s-weigand/setup-conda@v1.0.7
with:
# Additional channels like 'conda-forge' which can be used to install packages
conda-channels: '' # optional, default is 'defaults conda-forge'
# Additional packages which should be installed

- name: Install dependencies
run: |
conda create -n qiime2 --file environment.yml
conda run -n qiime2 pip install git+https://github.com/PennChopMicrobiomeProgram/dnabc.git
git clone https://github.com/Ulthran/q2-unassigner.git
cd q2-unassigner
conda run -n qiime2 make install

- name: Write configs
run: |
echo "cores: 4" > test/config.yaml
echo "printshellcmds: True" >> test/config.yaml
echo "nolock: True" >> test/config.yaml
echo "verbose: True" >> test/config.yaml
echo "configfile: ${PWD}/test/qiime2_config.yml" >> test/config.yaml

echo "all:" > test/qiime2_config.yml
echo " project_dir: ${PWD}/test" >> test/qiime2_config.yml
echo " mux_dir: 'multiplexed_fastq'" >> test/qiime2_config.yml
echo " mapping: 'test_mapping_file.tsv'" >> test/qiime2_config.yml
echo " admin_email: 'userid@email'" >> test/qiime2_config.yml
echo "demux:" >> test/qiime2_config.yml
echo " mismatch: 0" >> test/qiime2_config.yml
echo " revcomp: false" >> test/qiime2_config.yml
echo "denoise:" >> test/qiime2_config.yml
echo " trim_left_f: 0" >> test/qiime2_config.yml
echo " trunc_len_f: 240" >> test/qiime2_config.yml
echo " trim_left_r: 0" >> test/qiime2_config.yml
echo " trunc_len_r: 240" >> test/qiime2_config.yml
echo "taxonomy:" >> test/qiime2_config.yml
echo " classifier_fp: ${PWD}/test/data/test_classifier_species.qza" >> test/qiime2_config.yml
echo "diversity:" >> test/qiime2_config.yml
echo " sampling_depth: 100" >> test/qiime2_config.yml
echo "unassign:" >> test/qiime2_config.yml
echo " unassigner_species_fp: ${PWD}/test/data/unassigner_species.fasta" >> test/qiime2_config.yml
echo "dada2:" >> test/qiime2_config.yml
echo " rscript: ${PWD}/scripts/dada2.R" >> test/qiime2_config.yml
echo " species_training_set: ''" >> test/qiime2_config.yml
echo "vsearch:" >> test/qiime2_config.yml
echo " db: ''" >> test/qiime2_config.yml
echo " min_id: 0.97" >> test/qiime2_config.yml
echo " weak_id: 0.97" >> test/qiime2_config.yml
echo " userfields: 'query+target+id2+alnlen+mism+gaps+qilo+qihi+tilo+tihi+qs+ts+qrow+trow'" >> test/qiime2_config.yml
echo " iddef: 2" >> test/qiime2_config.yml
echo " fasta_width: 0" >> test/qiime2_config.yml
echo " maxaccepts: 1" >> test/qiime2_config.yml

cat test/qiime2_config.yml
cat test/config.yaml

- name: Dryrun
run: conda run -n qiime2 snakemake -n --profile test

- name: Run
run: conda run -n qiime2 snakemake --profile test
8 changes: 5 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@EXPLICIT
https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2
https://conda.anaconda.org/conda-forge/noarch/_r-mutex-1.0.1-anacondar_1.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/ca-certificates-2022.12.7-ha878542_0.conda
https://conda.anaconda.org/conda-forge/linux-64/ca-certificates-2025.1.31-hbcca054_0.conda
https://conda.anaconda.org/conda-forge/noarch/font-ttf-dejavu-sans-mono-2.37-hab24e00_0.tar.bz2
https://conda.anaconda.org/conda-forge/noarch/font-ttf-inconsolata-3.000-h77eed37_0.tar.bz2
https://conda.anaconda.org/conda-forge/noarch/font-ttf-source-code-pro-2.038-h77eed37_0.tar.bz2
Expand Down Expand Up @@ -72,7 +72,7 @@ https://conda.anaconda.org/conda-forge/linux-64/mpg123-1.31.2-hcb278e6_0.conda
https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.3-h27087fc_1.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/nspr-4.35-h27087fc_0.conda
https://conda.anaconda.org/conda-forge/linux-64/oniguruma-6.9.8-h166bdaf_0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/openssl-1.1.1t-h0b41bf4_0.conda
https://conda.anaconda.org/conda-forge/linux-64/openssl-1.1.1w-hd590300_0.conda
https://conda.anaconda.org/conda-forge/linux-64/pcre-8.45-h9c3ff4c_0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/pixman-0.40.0-h36c2ea0_0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/pthread-stubs-0.4-h36c2ea0_1001.tar.bz2
Expand Down Expand Up @@ -177,7 +177,7 @@ https://conda.anaconda.org/conda-forge/noarch/backports-1.0-pyhd8ed1ab_3.conda
https://conda.anaconda.org/conda-forge/linux-64/brotli-1.0.9-h166bdaf_8.tar.bz2
https://conda.anaconda.org/conda-forge/noarch/cached_property-1.5.2-pyha770c72_1.tar.bz2
https://conda.anaconda.org/conda-forge/noarch/cachetools-5.3.0-pyhd8ed1ab_0.conda
https://conda.anaconda.org/conda-forge/noarch/certifi-2022.12.7-pyhd8ed1ab_0.conda
https://conda.anaconda.org/conda-forge/noarch/certifi-2024.8.30-pyhd8ed1ab_0.conda
https://conda.anaconda.org/conda-forge/noarch/charset-normalizer-2.1.1-pyhd8ed1ab_0.tar.bz2
https://conda.anaconda.org/conda-forge/noarch/click-8.1.3-unix_pyhd8ed1ab_2.tar.bz2
https://conda.anaconda.org/conda-forge/noarch/colorama-0.4.6-pyhd8ed1ab_0.tar.bz2
Expand Down Expand Up @@ -310,6 +310,7 @@ https://conda.anaconda.org/conda-forge/noarch/asttokens-2.2.1-pyhd8ed1ab_0.conda
https://conda.anaconda.org/conda-forge/noarch/backports.functools_lru_cache-1.6.4-pyhd8ed1ab_0.tar.bz2
https://conda.anaconda.org/conda-forge/noarch/beautifulsoup4-4.11.2-pyha770c72_0.conda
https://conda.anaconda.org/conda-forge/noarch/bibtexparser-1.4.0-pyhd8ed1ab_0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/biopython-1.83-py38h01eb140_0.conda
https://conda.anaconda.org/conda-forge/noarch/bleach-6.0.0-pyhd8ed1ab_0.conda
https://conda.anaconda.org/bioconda/linux-64/bowtie2-2.5.1-py38h77f66f0_0.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/cairo-1.16.0-ha61ee94_1014.tar.bz2
Expand Down Expand Up @@ -396,6 +397,7 @@ https://conda.anaconda.org/conda-forge/noarch/rich-13.3.1-pyhd8ed1ab_1.conda
https://conda.anaconda.org/bioconda/linux-64/samtools-1.16.1-h6899075_1.tar.bz2
https://conda.anaconda.org/conda-forge/linux-64/scikit-learn-0.24.1-py38h658cfdd_0.tar.bz2
https://conda.anaconda.org/conda-forge/noarch/stack_data-0.6.2-pyhd8ed1ab_0.conda
https://conda.anaconda.org/bioconda/noarch/unassigner-1.1.0-pyh7e72e81_0.tar.bz2
https://conda.anaconda.org/bioconda/linux-64/unifrac-binaries-1.1.1-h15a0faf_4.tar.bz2
https://conda.anaconda.org/conda-forge/noarch/veracitools-0.1.3-py_0.tar.bz2
https://conda.anaconda.org/conda-forge/noarch/wcwidth-0.2.6-pyhd8ed1ab_0.conda
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
4 changes: 1 addition & 3 deletions rules/targets/targets.rules
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,5 @@ TARGET_ALL = (
TARGET_TAXONOMY +
TARGET_TREE +
TARGET_DIVERSITY +
TARGET_UNASSIGN +
TARGET_DADA2SP +
TARGET_VSEARCH
TARGET_UNASSIGN
)
40 changes: 28 additions & 12 deletions rules/unassign/unassign.rules
Original file line number Diff line number Diff line change
@@ -1,25 +1,41 @@




rule all_unassign:
input:
TARGET_UNASSIGN


rule run_unassign:
input:
DENOISE_DIR + "/representative_seq_fasta/dna-sequences.fasta"
DENOISE_DIR + "/representative-seqs.qza"
params:
unassigner_species_fp = config["unassign"]["unassigner_species_fp"],
outdir = DENOISE_DIR + "/representative_seq_fasta/unassigned"
unassigner_species_fp=config["unassign"]["unassigner_species_fp"],
output:
DENOISE_DIR + "/representative_seq_fasta/unassigned/unassigner_output.tsv"
DENOISE_DIR + "/representative_seq_fasta/unassigned.qza"
shell:
"""
if [[ -f {params.unassigner_species_fp} ]]; then
unassign \
--type_strain_fasta {params.unassigner_species_fp} \
--output_dir {params.outdir} \
{input}
qiime unassigner unassign \
--p-type-strain-fasta {params.unassigner_species_fp} \
--o-unassigned {output} \
--i-seqs {input}
else
unassign \
--output_dir {params.outdir} \
{input}
fi
qiime unassigner unassign \
--o-unassigned {output} \
--i-seqs {input}
fi
"""


rule export_unassigner:
input:
DENOISE_DIR + "/representative_seq_fasta/unassigned.qza"
output:
DENOISE_DIR + "/representative_seq_fasta/unassigned/unassigner_output.tsv"
shell:
"""
qiime tools export \
--input-path {input} \
--output-path $(dirname {output}) """
5 changes: 5 additions & 0 deletions test/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cores: 4
printshellcmds: True
nolock: True
verbose: True
configfile: "test/qiime2_config.yml"
Binary file added test/data/test_classifier_species.qza
Binary file not shown.
46 changes: 46 additions & 0 deletions test/qiime2_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
all:
project_dir: "/home/ctbus/Penn/16S_QIIME2/test"
mux_dir: "multiplexed_fastq"
mapping: "test_mapping_file.tsv"
admin_email: "userid@email"

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

#~240 for V1V2, ~280 for V3V4
denoise:
trim_left_f: 0
trunc_len_f: 240
trim_left_r: 0
trunc_len_r: 240
#threads are now specificed in config.yaml

taxonomy:
classifier_fp: "/home/ctbus/Penn/16S_QIIME2/test/data/test_classifier_species.qza"

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

unassign:
unassigner_species_fp: "/home/ctbus/Penn/16S_QIIME2/test/data/unassigner_species.fasta"

dada2:
rscript: "/mnt/isilon/microbiome/analysis/biodata/dada2/dada2.R"
species_training_set: "/mnt/isilon/microbiome/analysis/biodata/dada2/rdp_species_assignment_18.fa.gz"
#if you want to use SILVA:
#species_training_set: "/mnt/isilon/microbiome/analysis/biodata/dada2/silva_species_assignment_v138.1.fa.gz"

vsearch:
db: "/mnt/isilon/microbiome/analysis/biodata/green_genes/current_gg16S.fasta"
min_id: 0.97 #minimum identity for query-target match
weak_id: 0.97 #set lower than min-id and you will get some weaker matches too
userfields: "query+target+id2+alnlen+mism+gaps+qilo+qihi+tilo+tihi+qs+ts+qrow+trow" #fields for results file, see vsearch documentation for details
iddef: 2 #the way "identity" is calculated, see vsearch docs for details (it's equal to (matching columns) / (alignment length) excluding terminal gaps)
fasta_width: 0 #Width of alignment lines in fasta output, set to 0 to eliminate wrapping
maxaccepts: 1 #Maximum number of hits to accept before stopping the search Default is 1

# picrust:
# threads: 8