Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
SilasK committed Mar 23, 2023
2 parents 05a1a6c + 5bc7c50 commit 7b88913
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 13 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
#
# You can adjust the behavior by modifying this file.
# For more information, see:
# https://github.com/actions/stale
name: Mark stale issues and pull requests

on:
schedule:
- cron: '16 13 * * *'

jobs:
stale:

runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write

steps:
- uses: actions/stale@v7
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: |
There was no activity since some time. I hope your issue is solved in the mean time.
This issue will automatically close soon if no further activity occurs.
Thank you for your contributions.
stale-pr-message: |
This PR is stale because it has not had any recent activity.
This PR will automatically close soon if no further activity occurs.
Thank you for your contributions.
days-before-stale: 60
days-before-close: 15
stale-issue-label: stale
stale-pr-label: stale
exempt-issue-labels: 'keep,enhancement,bug,documentation,Feature-request,Known-issue'
exempt-pr-labels: ''
days-before-pr-stale: 1000
exempt-assignees: silask
2 changes: 1 addition & 1 deletion atlas/workflow/envs/gtdbtk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ channels:
- bioconda
- defaults
dependencies:
- gtdbtk >=2.1.1, < 3
- gtdbtk =2.2
1 change: 0 additions & 1 deletion atlas/workflow/envs/tree.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ channels:
- defaults
dependencies:
- ete3=3.1.2
- fasttree=2.1.8
3 changes: 1 addition & 2 deletions atlas/workflow/rules/download.smk
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,7 @@ rule extract_gtdb:
"logs/download/gtdbtk_untar.log",
shell:
'tar -xzvf {input} -C "{GTDBTK_DATA_PATH}" --strip 1 2> {log}; '
'echo "Set the GTDBTK_DATA_PATH environment variable to {GTDBTK_DATA_PATH} " >> {log}; '
"conda env config vars set GTDBTK_DATA_PATH={GTDBTK_DATA_PATH} "



rule checkm2_download_db:
Expand Down
28 changes: 19 additions & 9 deletions atlas/workflow/rules/gtdbtk.smk
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ rule identify:
extension="faa",
gene_dir=lambda wc, input: os.path.abspath(os.path.dirname(input.genes_flag)),
shell:
'export GTDBTK_DATA_PATH="{GTDBTK_DATA_PATH}" ; '
"gtdbtk identify "
"--genes --genome_dir {params.gene_dir} "
" --out_dir {params.outdir} "
Expand All @@ -39,6 +40,7 @@ checkpoint align:
params:
outdir=gtdb_dir,
shell:
'export GTDBTK_DATA_PATH="{GTDBTK_DATA_PATH}" ; '
"gtdbtk align --identify_dir {params.outdir} --out_dir {params.outdir} "
"--cpus {threads} &> {log[0]}"

Expand All @@ -63,6 +65,7 @@ rule classify:
extension="fasta",
mashdir = Path(GTDBTK_DATA_PATH)/"mash_db"
shell:
'export GTDBTK_DATA_PATH="{GTDBTK_DATA_PATH}" ; '
"gtdbtk classify --genome_dir {input.genome_dir} --align_dir {params.outdir} "
" --mash_db {params.mashdir} "
"--out_dir {params.outdir} "
Expand All @@ -83,20 +86,27 @@ rule combine_taxonomy:
"../scripts/combine_taxonomy.py"


rule fasttree:

rule build_tree:
input:
f"{gtdb_dir}/align/{{msa}}.user_msa.fasta.gz",
output:
temp("genomes/tree/{msa}.unrooted.nwk"),
temp("genomes/taxonomy/gtdb/{msa}.unrooted.tree"),
log:
"logs/genomes/tree/FastTree_{msa}.log",
"logs/genomes/tree/{msa}.log",
"logs/genomes/tree/{msa}.err"
threads: max(config["threads"], 3)
params:
outdir = lambda wc, output: Path(output[0]).parent
conda:
"%s/tree.yaml" % CONDAENV
"../envs/gtdbtk.yaml"
shell:
"export OMP_NUM_THREADS={threads}; "
"gunzip -c {input} | "
" FastTree > {output} 2> {log} "
'export GTDBTK_DATA_PATH="{GTDBTK_DATA_PATH}" ; '
"gtdbtk infer --msa_file {input} "
" --out_dir {params.outdir} "
" --prefix {wildcards.msa} "
" --cpus {threads} "
"--tmpdir {resources.tmpdir} > {log[0]} 2> {log[1]}"


localrules:
Expand All @@ -105,13 +115,13 @@ localrules:

rule root_tree:
input:
tree="genomes/tree/{msa}.unrooted.nwk",
tree= rules.build_tree.output[0],
wildcard_constraints:
msa="((?!unrooted).)*",
output:
tree="genomes/tree/{msa}.nwk",
conda:
"%s/tree.yaml" % CONDAENV
"../envs/tree.yaml"
threads: 1
resources:
mem=config["simplejob_mem"],
Expand Down

0 comments on commit 7b88913

Please sign in to comment.