Skip to content

Commit

Permalink
Merge pull request #233 from UPHL-BioNGS/update-2023-09-26
Browse files Browse the repository at this point in the history
Update 2023 09 26
  • Loading branch information
erinyoung authored Sep 27, 2023
2 parents a2596b3 + b0b88db commit 4f80ab8
Show file tree
Hide file tree
Showing 19 changed files with 452 additions and 318 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/github_actions.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
includeConfig '/home/runner/work/Cecret/Cecret/configs/cecret_config_template.config'
params.vadr = false

process {
withName:ivar_consensus{
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test_primers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ jobs:
'ncov_V4',
'ncov_V4.1',
'ncov_V5.3.2',
'mpx_primalseq',
'mpx_idt'
'mpx_primalseq'
]

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_profile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Run Cecret
run: |
nextflow run . -profile docker,test -c .github/workflows/github_actions.config --maxcpus 2 --medcpus 2 --cleaner 'fastp' --aligner 'minimap2' --mpileup_depth 200 --vadr false
nextflow run . -profile docker,test -c .github/workflows/github_actions.config --maxcpus 2 --medcpus 2 --cleaner 'fastp' --aligner 'minimap2' --mpileup_depth 200 --vadr false --aci false --freyja false
ls cecret*
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_profile1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Run Cecret
run: |
nextflow run . -profile docker,test1 -c .github/workflows/github_actions.config --maxcpus 2 --medcpus 2 --cleaner 'fastp' --aligner 'minimap2' --mpileup_depth 200 --vadr false
nextflow run . -profile docker,test1 -c .github/workflows/github_actions.config --maxcpus 2 --medcpus 2 --cleaner 'fastp' --aligner 'minimap2' --mpileup_depth 200 --vadr false --aci false --freyja false
ls cecret*
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_profile2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Run Cecret
run: |
nextflow run . -profile docker,test2 -c .github/workflows/github_actions.config --maxcpus 2 --medcpus 2 --cleaner 'fastp' --aligner 'minimap2' --mpileup_depth 200 --vadr false
nextflow run . -profile docker,test2 -c .github/workflows/github_actions.config --maxcpus 2 --medcpus 2 --cleaner 'fastp' --aligner 'minimap2' --mpileup_depth 200 --vadr false --aci false --freyja false
ls cecret*
Expand Down
99 changes: 0 additions & 99 deletions bin/.tests.notower.sh

This file was deleted.

80 changes: 80 additions & 0 deletions bin/.tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# nextflow run ~/sandbox/Cecret -profile singularity,mpx --reads /home/eriny/sandbox/test_files/cecret/mpx --outdir tests --cleaner 'fastp' -with-tower -resume
# nextflow run ~/sandbox/Cecret -profile singularity --nanopore /home/eriny/sandbox/test_files/cecret/nanopore --outdir tests -with-tower -resume

echo "usage : bash .test.sh {small,primers,else}"

test=$1

if [ -z "$test" ]; then test="small" ; fi
Expand Down Expand Up @@ -36,6 +38,7 @@ then
-profile singularity,artic_V3 \
--$option /home/eriny/sandbox/test_files/cecret/$option \
--outdir singularity_defaults_$option \
-resume \
-with-tower

# removed test for bamsnap and rename because of lack of interest
Expand Down Expand Up @@ -96,6 +99,83 @@ then
--outdir empty \
-with-tower

elif [ "$test" == "primers" ]
then

nanopore_primers=("midnight_idt_V1" "midnight_ont_V1" "midnight_ont_V2" "midnight_ont_V3")
for primer in ${nanopore_primers[@]}
do
nextflow run ~/sandbox/Cecret \
-profile singularity \
--nanopore /home/eriny/sandbox/test_files/cecret/nanopore \
--outdir primer_${primer}_artic \
--primer_set $primer \
--bcftools_variants false \
--fastqc false \
--ivar_variants false \
--samtools_stats false \
--samtools_coverage false \
--samtools_depth false \
--nextclade false \
--pangolin false \
--freyja false \
--vadr false \
-resume \
-with-tower
done

trimmers=("samtools" "ivar")
for trimmer in ${trimmers[@]}
do
illumina_primers=("ncov_V3" "ncov_V4" "ncov_V4.1" "ncov_V5.3.2")
for primer in ${illumina_primers[@]}
do
nextflow run ~/sandbox/Cecret \
-profile singularity \
--reads /home/eriny/sandbox/test_files/cecret/reads \
--outdir primer_${primer}_${trimmer} \
--trimmer $trimmer \
--cleaner 'fastp' \
--primer_set $primer \
--bcftools_variants false \
--fastqc false \
--ivar_variants false \
--samtools_stats false \
--samtools_coverage false \
--samtools_depth false \
--nextclade false \
--pangolin false \
--freyja false \
--vadr false \
-resume \
-with-tower
done

mpx_primers=("mpx_primalseq" "mpx_idt")
for primer in ${mpx_primers[@]}
do
nextflow run ~/sandbox/Cecret \
-profile singularity \
--reads /home/eriny/sandbox/test_files/cecret/mpx_idt \
--outdir primer_${primer}_${trimmer} \
--trimmer $trimmer \
--cleaner 'fastp' \
--primer_set $primer \
--bcftools_variants false \
--fastqc false \
--ivar_variants false \
--samtools_stats false \
--samtools_coverage false \
--samtools_depth false \
--nextclade false \
--pangolin false \
--freyja false \
--vadr false \
-with-tower \
-resume
done
done

else
# CDC's test data with relatedness
nextflow run ~/sandbox/Cecret \
Expand Down
82 changes: 82 additions & 0 deletions bin/params.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#!/bin/bash

##### ##### ##### ##### ##### ##### ##### ##### #####
# It's like nf-core's version, but jankier #####
##### ##### ##### ##### ##### ##### ##### ##### #####

# this
# 1. finds all the params
# 2. checks that they are in nextflow_schema.json
# 3. checks that their default value is in nextflow_schema.json
# 4. checks that every param and its default value is in the config file
# 5. checks that every process with its default values are in the config file

##### ##### ##### ##### ##### ##### ##### ##### #####
# finding all the params #####
##### ##### ##### ##### ##### ##### ##### ##### #####

params=$(grep param main.nf | awk '{ ( $1=$1 ) ; print $0 }' | grep ^param | awk '{print $1}' | sort | uniq | cut -f 2 -d '.')

for param in ${params[@]}
do
echo "evaluating params.$param"

# default value
default="$(grep -w params.$param main.nf | grep "=" | head -n 1 | sed 's/.*=//g' | awk '{ ( $1=$1 ) ; print $0 }' ) "
echo -e "default:\t$default"

# 2. checks that they are in nextflow_schema.json
schema_check=$(grep "\"$param\":" nextflow_schema.json | head -n 1)
if [ -n "$schema_check" ]
then
# 3. checks that their default value is in nextflow_schema.json
schema_default="$(grep "\"$param\":" -A 10 nextflow_schema.json | grep "}" -B 10 -m 1 | grep "default" | head -n 1 | sed 's/.*://g' | awk '{ ( $1=$1 ) ; print $0 }' )"
echo -e "schema:\t\t$schema_default"

else
echo "$param was not included in nextflow_schema.json file!!!"
fi

config_check=$(grep "params.$param =" configs/cecret_config_template.config | head -n 1)
if [ -n "$config_check" ]
then
# 4. checks that every param and its default value is in the config file
config_default="$(grep -w params.$param configs/cecret_config_template.config | grep -v "#" | head -n 1 | sed 's/.*=//g' | awk '{ ( $1=$1 ) ; print $0 }' )"
echo -e "config:\t\t$config_default"

else
echo "$param was not included in configs/cecret_config_template.config file!!!"
fi

echo ""

done

echo "##### ##### ##### ##### #####"
echo "# Now for the processes #####"
echo "##### ##### ##### ##### #####"


processes=$(grep ^process -h modules/*nf | awk '{print $2}' | sort | uniq )
echo ${processes[@]}

for process in ${processes[@]}
do
#echo "getting information for $process"
#grep "process $process {" -h modules/*nf -A 200 | grep -e "when:" -e "input:" -B 200 -m 1 | grep -v "#UPHLICA" | grep -v "when:" | grep -v "input:" | grep -v "tag"

echo -e "//\twithName:$process{"
while read line
do
key=$(echo $line | awk '{print $1}' | grep -v process )
if [ -n "$key" ]
then
value=$(echo $line | sed "s|$key||g" | awk '{ ( $1=$1 ) ; print $0 }' | sed 's/\"${params.outdir}\"/cecret/g')
echo -e "//\t\t$key = \"$value\""
fi
done < <(grep "process $process {" -h modules/*nf -A 200 | grep -e "when:" -e "input:" -B 200 -m 1 | grep -v "#UPHLICA" | grep -v "when:" | grep -v "input:" | grep -v "tag")
echo -e "//\t}"

#echo ""
#grep "// withName:$process{" -A 20 configs/cecret_config_template.config | grep -m 1 "}" -B 20
done
Loading

0 comments on commit 4f80ab8

Please sign in to comment.