Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIDORI #69

Merged
merged 8 commits into from
Apr 19, 2024
Merged
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
29 changes: 29 additions & 0 deletions ressources/create_MIDORI_blastdb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Get MIDORI Fasta and reformat header
wget -S -P ./source/ https://www.reference-midori.info/forceDownload.php?fName=download/Databases/GenBank259_2023-12-17/BLAST/uniq/fasta/MIDORI2_UNIQ_NUC_GB259_lrRNA_BLAST.fasta.zip \
&& gunzip -c ./source/MIDORI2_UNIQ_NUC_GB259_lrRNA_BLAST.fasta.zip > ./source/MIDORI2_UNIQ_NUC_GB259_lrRNA_BLAST.fasta \
&& cut -d '#' -f1 ./source/MIDORI2_UNIQ_NUC_GB259_lrRNA_BLAST.fasta \
| tr -d '<' \
| sed 's/^>/@/' \
| tr -d '>' \
| tr '@' '>' \
| cut -d ',' -f1,2 \
| tr ',' '_' \
> MIDORI2_UNIQ_NUC_GB259_lrRNA_BLAST.fasta

# taxdb
wget -S -P ./source/ https://ftp.ncbi.nlm.nih.gov/blast/db/taxdb.tar.gz \
&& tar -xzvf ./source/taxdb.tar.gz

# taxdump
wget -S -P ./source/ https://ftp.ncbi.nlm.nih.gov/pub/taxonomy/new_taxdump/new_taxdump.tar.gz \
&& tar -xzvf ./source/new_taxdump.tar.gz

# taxid file
# Get taxid from fasta headers
paste \
<(cat ./source/MIDORI2_UNIQ_NUC_GB259_lrRNA_BLAST.fasta | grep '^>' | cut -d '#' -f1 | tr -d '<' | tr -d '>' | cut -d ',' -f1,2 | tr ',' '_') \
<(cat ./source/MIDORI2_UNIQ_NUC_GB259_lrRNA_BLAST.fasta | grep '^>' | rev | cut -d '_' -f1 | rev) \
> ids2taxid

# Make db
makeblastdb -in MIDORI2_UNIQ_NUC_GB259_lrRNA_BLAST.fasta -parse_seqids -blastdb_version 5 -taxid_map ids2taxid -dbtype nucl
14 changes: 13 additions & 1 deletion workflow/paramspace
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ workdir: config["workdir"]
paramspace = Paramspace(pd.read_csv(config['paramspace'], sep="\t"))


# Snakemake 8 compatibility ----------------------------------------------------


def get_conda_prefix(wildcards):
try:
# snakemake < 8.0
return workflow.conda_prefix
except:
# snakemake > 8
return workflow.deployment_settings.conda_prefix


# Input rule ------------------------------------------------------------------


Expand Down Expand Up @@ -68,7 +80,7 @@ rule run_foodme_benchmark:
workdir=f"foodme_runs/{paramspace.wildcard_pattern}",
snakefile=os.path.join(workflow.basedir, "benchmark"),
cores=workflow.cores,
conda_prefix=workflow.conda_prefix,
conda_prefix=get_conda_prefix,
force_rerun="--forceall" if config["force_rerun"] else ""
log:
f"logs/{paramspace.wildcard_pattern}/snakemake.log"
Expand Down
Loading