Skip to content

Commit

Permalink
Merge pull request #172 from UPHL-BioNGS/refactoring
Browse files Browse the repository at this point in the history
Refactoring
  • Loading branch information
erinyoung authored Feb 28, 2024
2 parents 669b7eb + 5f83be9 commit 4e9be63
Show file tree
Hide file tree
Showing 301 changed files with 4,598 additions and 3,823 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/add_fastani_ref.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Test Grandeur workflow with additional fastani references

on: [pull_request, workflow_dispatch]

jobs:

test:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Nextflow
run: |
wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/
nextflow -version
- name: Download fastas
run: |
mkdir fastas
for accession in GCA_019710395.3_ASM1971039v3 GCA_001652385.2_ASM165238v2 GCA_013344545.1_ASM1334454v1
do
all=$(echo $accession | cut -f 2 -d "_")
fir=$(echo $all | cut -c 1-3)
mid=$(echo $all | cut -c 4-6)
end=$(echo $all | cut -c 7-9)
wget https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/$fir/$mid/$end/$accession/${accession}_genomic.fna.gz
gzip -d ${accession}_genomic.fna.gz
mv ${accession}_genomic.fna fastas/.
done
- name: Download fastani refs for list
run: |
mkdir refs
for accession in GCA_000240185.2_ASM24018v2 GCA_003812925.1_ASM381292v1 GCA_901421005.1_39282_A01
do
all=$(echo $accession | cut -f 2 -d "_")
fir=$(echo $all | cut -c 1-3)
mid=$(echo $all | cut -c 4-6)
end=$(echo $all | cut -c 7-9)
wget https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/${fir}/${mid}/${end}/${accession}/${accession}_genomic.fna.gz
mv ${accession}_genomic.fna.gz refs/.
done
ls refs/* > fastani_ref_list.txt
- name: Download fastani refs
run: |
for accession in GCA_009665515.2_ASM966551v2 GCA_009763645.1_ASM976364v1
do
all=$(echo $accession | cut -f 2 -d "_")
fir=$(echo $all | cut -c 1-3)
mid=$(echo $all | cut -c 4-6)
end=$(echo $all | cut -c 7-9)
wget https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/${fir}/${mid}/${end}/${accession}/${accession}_genomic.fna.gz
done
ls refs/* > fastani_ref_list.txt

- name: Run Grandeur with ref list
run: |
nextflow run . -profile docker -c .github/workflows/github_actions.config --fastas fastas --fastani_ref_list fastani_ref_list.txt
cat grandeur/grandeur_summary.tsv
- name: Run Grandeur with refs
run: |
nextflow run . -profile docker -c .github/workflows/github_actions.config --fastas fastas -resume --fastani_ref GCA_009665515.2_ASM966551v2_genomic.fna.gz,GCA_009763645.1_ASM976364v1_genomic.fna.gz --outdir grandeur2
cat grandeur2/grandeur_summary.tsv

- name: Run Grandeur with refs and ref list
run: |
nextflow run . -profile docker -c .github/workflows/github_actions.config --fastas fastas -resume --fastani_ref_list fastani_ref_list.txt --fastani_ref GCA_009665515.2_ASM966551v2_genomic.fna.gz,GCA_009763645.1_ASM976364v1_genomic.fna.gz --outdir grandeur3
cat grandeur3/grandeur_summary.tsv


11 changes: 4 additions & 7 deletions .github/workflows/current.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
lfs: true

- name: Checkout LFS objects
run: git lfs checkout
uses: actions/checkout@v4

- name: Install Nextflow
run: |
wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/
nextflow -version
- name: Run Grandeur
run: |
Expand All @@ -33,6 +30,6 @@ jobs:
mkdir fastas
mv *fna fastas/.
nextflow run . -profile docker --maxcpus 2 --medcpus 2
nextflow run . -profile docker --current_datasets -c .github/workflows/github_actions.config --fastas fastas
cat grandeur/grandeur_summary.tsv
13 changes: 5 additions & 8 deletions .github/workflows/ecoli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
lfs: true

- name: Checkout LFS objects
run: git lfs checkout
uses: actions/checkout@v4

- name: Install Nextflow
run: |
wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/
nextflow -version
- name: Run Grandeur
run: |
Expand All @@ -36,12 +33,12 @@ jobs:
mv ${accession}_genomic.fna fastas/.
done
nextflow run . -profile docker --maxcpus 2 --medcpus 2
nextflow run . -profile docker -c .github/workflows/github_actions.config --fastas fastas
cat grandeur/grandeur_summary.tsv
- name: Check E. coli file
run: |
for file in grandeur/shigatyper/shigatyper_results.txt grandeur/serotypefinder/serotypefinder_results.txt
for file in grandeur/shigatyper/shigatyper_summary.txt grandeur/shigatyper/shigatyper_hits.txt grandeur/serotypefinder/serotypefinder_results.txt
do
head $file
wc -l $file
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/github_actions.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
process {
maxRetries = 0
maxErrors = '-1'

withLabel:process_single {
cpus = { 1 }
memory = { 6.GB * task.attempt }
time = { 10.m * task.attempt }
}
withLabel:process_low {
cpus = { 2 * task.attempt }
memory = { 12.GB * task.attempt }
time = { 2.h * task.attempt }
}
withLabel:process_medium {
cpus = { 2 * task.attempt }
memory = { 12.GB * task.attempt }
time = { 4.h * task.attempt }
}
withLabel:process_high {
cpus = { 2 * task.attempt }
memory = { 12.GB * task.attempt }
time = { 16.h * task.attempt }
}
withLabel:process_long {
time = { 20.h * task.attempt }
}
withLabel:process_high_memory {
memory = { 12.GB * task.attempt }
}
}
11 changes: 4 additions & 7 deletions .github/workflows/just_msa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
lfs: true

- name: Checkout LFS objects
run: git lfs checkout
uses: actions/checkout@v4

- name: Install Nextflow
run: |
wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/
nextflow -version
- name: Run Grandeur
run: |
Expand All @@ -33,7 +30,7 @@ jobs:
mkdir fastas
mv *fna fastas/.
nextflow run . -profile docker,just_msa --maxcpus 2 --medcpus 2
nextflow run . -profile docker,just_msa -c .github/workflows/github_actions.config --fastas fastas
- name: Check MSA files
run: |
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/klebsiella.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Test Grandeur workflow with Klebsiella

on: [pull_request, workflow_dispatch]

jobs:

test:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Nextflow
run: |
wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/
nextflow -version
- name: Run Grandeur
run: |
docker --version
mkdir fastas
for accession in GCA_000240185.2_ASM24018v2 GCA_003812925.1_ASM381292v1 GCA_901421005.1_39282_A01
do
all=$(echo $accession | cut -f 2 -d "_")
fir=$(echo $all | cut -c 1-3)
mid=$(echo $all | cut -c 4-6)
end=$(echo $all | cut -c 7-9)
wget https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/${fir}/${mid}/${end}/${accession}/${accession}_genomic.fna.gz
gzip -d ${accession}_genomic.fna.gz
mv ${accession}_genomic.fna fastas/.
done
nextflow run . -profile docker -c .github/workflows/github_actions.config --fastas fastas
cat grandeur/grandeur_summary.tsv
- name: Check Klebsiella file
run: |
for file in grandeur/kleborate/kleborate_results.tsv
do
head $file
wc -l $file
done
13 changes: 5 additions & 8 deletions .github/workflows/legionella.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
lfs: true

- name: Checkout LFS objects
run: git lfs checkout
uses: actions/checkout@v4

- name: Install Nextflow
run: |
wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/
nextflow -version
- name: Run Grandeur
run: |
Expand All @@ -36,13 +33,13 @@ jobs:
mv ${accession}_genomic.fna fastas/.
done
nextflow run . -profile docker --maxcpus 2 --medcpus 2
nextflow run . -profile docker -c .github/workflows/github_actions.config --fastas fastas
cat grandeur/grandeur_summary.tsv
- name: Check Legionella file
run: |
for file in grandeur/legsta/legsta_summary.csv
for file in grandeur/elgato/elgato_summary.tsv
do
head $file
wc -l $file
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/myco.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Test Grandeur workflow with Mycobacterium

on: [pull_request, workflow_dispatch]

jobs:

test:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Nextflow
run: |
wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/
nextflow -version
- name: Run Grandeur
run: |
docker --version
mkdir fastas
for accession in GCA_010729105.1_ASM1072910v1 GCA_000195955.2_ASM19595v2
do
all=$(echo $accession | cut -f 2 -d "_")
fir=$(echo $all | cut -c 1-3)
mid=$(echo $all | cut -c 4-6)
end=$(echo $all | cut -c 7-9)
wget https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/${fir}/${mid}/${end}/${accession}/${accession}_genomic.fna.gz
gzip -d ${accession}_genomic.fna.gz
mv ${accession}_genomic.fna fastas/.
done
nextflow run . -profile docker -c .github/workflows/github_actions.config --fastas fastas
cat grandeur/grandeur_summary.tsv
- name: Check Mycobacterium file
run: |
for file in grandeur/drprg/drprg_summary.tsv grandeur/mykrobe/mykrobe_summary.csv
do
head $file
wc -l $file
done
13 changes: 4 additions & 9 deletions .github/workflows/phylogenetic_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
lfs: true
uses: actions/checkout@v4

- name: Checkout LFS objects
run: git lfs checkout

- name: Install Nextflow
run: |
wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/
nextflow -version
- name: Run Grandeur
run: |
Expand All @@ -33,12 +30,10 @@ jobs:
mkdir fastas
mv *fna fastas/.
nextflow run . -profile docker --maxcpus 2 --medcpus 2
nextflow run . -profile docker,msa -c .github/workflows/github_actions.config --fastas fastas
cat grandeur/grandeur_summary.tsv
nextflow run . -profile docker,msa --maxcpus 2 --medcpus 2 -resume
- name: Check MSA files
run: |
for file in grandeur/*/summary_statistics.txt grandeur/iqtree2/iqtree.treefile.nwk grandeur/snp-dists/snp_matrix.txt
Expand Down
Loading

0 comments on commit 4e9be63

Please sign in to comment.