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

new parameter --setup to preload all DBs and ref files, closes #102 #161

Merged
merged 32 commits into from
Feb 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
52d18b9
added buscoGetDB process
fischer-hub Dec 28, 2021
c0bc992
busco download fix
fischer-hub Dec 28, 2021
e3afb65
add busco_db_ch
fischer-hub Dec 28, 2021
c7e69aa
add default value for param --setup
fischer-hub Dec 29, 2021
0a744d5
use tabs to seperate
fischer-hub Jan 3, 2022
256f439
add setup wf
fischer-hub Jan 3, 2022
53a86ee
add setup default val
fischer-hub Jan 3, 2022
5d86abf
remove wrong process labels
fischer-hub Jan 3, 2022
8007198
add containerGet.nf
fischer-hub Jan 3, 2022
cb6c604
remove containerGet(), not working yet
fischer-hub Jan 3, 2022
66446bf
turn core count back up
fischer-hub Jan 3, 2022
7880a41
remove comments, revert containerGet changes
fischer-hub Jan 3, 2022
9b659cd
remove empty input from auto ref calls
fischer-hub Jan 3, 2022
2648c4a
seperate colswith tabs
fischer-hub Jan 6, 2022
c8be049
fix containerGet feature
fischer-hub Jan 6, 2022
22f5cd2
set queue size to 1 for setup runs to prevent parallel container pull
fischer-hub Jan 6, 2022
adacb32
fix docker pull
Jan 6, 2022
b3f9853
remove conda support for setup mode
Jan 6, 2022
4086309
Merge branch 'master' into setup
fischer-hub Jan 29, 2022
81e3a2f
add rattle container
fischer-hub Jan 29, 2022
2141a9b
bypass input.csv and autodownload checks if --setup is set
fischer-hub Jan 29, 2022
cb7a14b
readd set cores to 1 if --setup is seet
fischer-hub Jan 29, 2022
2f85ae0
replace spaces with tabs in rattle container
fischer-hub Jan 29, 2022
1f177b7
fix temp dir issue on hpc nodes
fischer-hub Jan 29, 2022
84c82c4
add documentation for --setup
fischer-hub Jan 29, 2022
ddbe541
Merge branch 'master' into setup
fischer-hub Jan 29, 2022
081e236
remove params.setup
fischer-hub Jan 29, 2022
364bce4
readd setup
fischer-hub Jan 29, 2022
10a0d48
remove max_cores to 1 if setup is set
fischer-hub Jan 29, 2022
fd5c233
replace ':' with '-' in iimage file name
fischer-hub Jan 31, 2022
7d9e902
Merge branch 'master' into setup
fischer-hub Jan 31, 2022
29fc6c4
add misssing bracket
fischer-hub Jan 31, 2022
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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ nextflow run hoelzer-lab/rnaflow -profile test,local,docker
nextflow run hoelzer-lab/rnaflow -profile test,slurm,singularity
```

As a __best practice__ for a local execution, we recommend to run the pipeline with `--cores 1 --max_cores 1` the first time you use `Singularity`, because we experienced issues when generating the `Singularity` images in parallel the first time the pipeline is executed with this engine option.
As a __best practice__ for a local execution, we recommend to run the pipeline with `--cores 1 --max_cores 1` the first time you use `Singularity`, because we experienced issues when generating the `Singularity` images in parallel the first time the pipeline is executed with this engine option. It is also possible to run the pipeline once with `--setup` set. In setup mode all the necessary files (DBs, reference files and images) are being downloaded and set up.

You can customize where `conda` environments are stored using

Expand Down Expand Up @@ -562,6 +562,7 @@ Caching:
--singularityCacheDir Location for storing the singularity images [default: singularity]
--workdir Working directory for all intermediate results [default: null] (DEPRECATED: use `-w your/workdir` instead)
--softlink_results Softlink result files instead of copying.
--setup Download all necessary DB, reference and image files without running the pipeline. [default: false]

Nextflow options:
-with-tower Activate monitoring via Nextflow Tower (needs TOWER_ACCESS_TOKEN set).
Expand Down
35 changes: 18 additions & 17 deletions configs/container.config
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
process {
withLabel: hisat2 { container = 'nanozoo/hisat2:2.1.0--66dae66' }
withLabel: minimap2 { container = 'nanozoo/minimap2:2.22--b178b67' }
withLabel: python3 { container = 'nanozoo/python_rnaseq:3--23823db' }
withLabel: deseq2 { container = 'nanozoo/deseq2:1.28.0--0df1612' }
withLabel: fastp { container = 'nanozoo/fastp:0.23.1--9f2e255' }
withLabel: fastqc { container = 'nanozoo/fastqc:0.11.8--fbfa1d7' }
withLabel: subread { container = 'nanozoo/subread:2.0.1--713a8e7' }
withLabel: multiqc { container = 'nanozoo/multiqc:1.11--9dfdee6' }
withLabel: nanoplot { container = 'nanozoo/nanoplot:1.38.1--e303519' }
withLabel: sortmerna { container = 'nanozoo/sortmerna:2.1b--ceea1a1' }
withLabel: trinity { container = 'trinityrnaseq/trinityrnaseq:2.13.2' }
withLabel: stringtie { container = 'nanozoo/stringtie:2.1.7--420b0db' }
withLabel: busco { container = 'ezlabgva/busco:v5.2.1_cv1' }
withLabel: dammit { container = 'nanozoo/dammit:1.2--b47259e' }
withLabel: dammitDB { container = 'nanozoo/dammit:1.2--b47259e' }
withLabel: basic_tools { container = 'nanozoo/python_rnaseq:3.8--7a7808c' }
withLabel: rattle { container = 'huxleys/rattle:1.0.0--24021329c8b365f21959c56ee1cfb693c768c14e' }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm @fischer-hub , will this remove rattle now from the master branch? I think we don't want this :) Sorry if the re-base to master causes confusion now

withLabel: hisat2 { container = "nanozoo/hisat2:2.1.0--66dae66" }
withLabel: minimap2 { container = "nanozoo/minimap2:2.22--b178b67" }
withLabel: python3 { container = "nanozoo/python_rnaseq:3--23823db" }
withLabel: deseq2 { container = "nanozoo/deseq2:1.28.0--0df1612" }
withLabel: fastp { container = "nanozoo/fastp:0.23.1--9f2e255" }
withLabel: fastqc { container = "nanozoo/fastqc:0.11.8--fbfa1d7" }
withLabel: subread { container = "nanozoo/subread:2.0.1--713a8e7" }
withLabel: multiqc { container = "nanozoo/multiqc:1.11--9dfdee6" }
withLabel: nanoplot { container = "nanozoo/nanoplot:1.38.1--e303519" }
withLabel: sortmerna { container = "nanozoo/sortmerna:2.1b--ceea1a1" }
withLabel: trinity { container = "trinityrnaseq/trinityrnaseq:2.13.2" }
withLabel: stringtie { container = "nanozoo/stringtie:2.1.7--420b0db" }
withLabel: busco { container = "ezlabgva/busco:v5.2.1_cv1" }
withLabel: dammit { container = "nanozoo/dammit:1.2--b47259e" }
withLabel: dammitDB { container = "nanozoo/dammit:1.2--b47259e" }
withLabel: basic_tools { container = "nanozoo/python_rnaseq:3.8--7a7808c" }
withLabel: rattle { container = "huxleys/rattle:1.0.0--24021329c8b365f21959c56ee1cfb693c768c14e" }
}

224 changes: 137 additions & 87 deletions main.nf

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion modules/busco.nf
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ process busco {
Buscos plotting feature does not work in Docker by default.
The "hack" modifies via sed the Rscript that gets generated after generate_plot.py
After changing to pdf (circumventing resolutions) we rerun the script via Rscript. Tadaa... we have a plot
*/
*/
1 change: 1 addition & 0 deletions modules/buscoGetDB.nf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ process buscoGetDB {
maxRetries 2

if (params.cloudProcess) { publishDir "${params.permanentCacheDir}/databases/busco/${params.busco_db}", mode: 'copy', pattern: "${params.busco_db}_odb10.tar.gz" }

else { storeDir "${params.permanentCacheDir}/databases/busco/${params.busco_db}" }

output:
Expand Down
49 changes: 49 additions & 0 deletions modules/containerGet.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
process containerGet {
label 'smallTask'
tag "$tool"

errorStrategy 'retry'
maxRetries 10

if ( workflow.profile.contains('singularity') ) { storeDir "${params.singularityCacheDir}" }
else if ( workflow.profile.contains('conda') ) { storeDir "${params.condaCacheDir}" }

input:
tuple val(tool), val(path)

output:
path("${img_file_name}.img")

script:
img_file_name = path.replace("/", "-").replace(":","-")
if ( workflow.profile.contains('singularity') )
"""
if [ -e ${params.singularityCacheDir}/${img_file_name}.img ]
then
echo "${tool} singularity image file already exists, skipping."
else
singularity pull --name ${img_file_name}.img "docker://${path}"
fi
"""
else if ( workflow.profile.contains('docker') )
"""
if [[ "\$(docker images -q ${path} 2> /dev/null)" == "" ]];
then
docker pull ${path}
touch ${img_file_name}.img
else
echo "${tool} docker image file already exists, skipping."
touch ${img_file_name}.img
fi
"""
else if ( workflow.profile.contains('conda') )
"""
echo "The setup mode currently doesn't support conda environments, skipping."
touch ${img_file_name}.img
"""
else
"""
echo 'unknown container engine, exiting'
exit 1
"""
}
2 changes: 1 addition & 1 deletion modules/dammitGetDB.nf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
process dammitGetDB {
label 'dammit'
label 'basic_tools'
label 'smallTask'

errorStrategy 'retry'
Expand Down
5 changes: 3 additions & 2 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ params {
featurecounts_additional_params = '-t exon -g gene_id' // default values
feature_id_type = 'ensembl_gene_id'
rna = false
setup = false

busco_db = 'euarchontoglires'
dammit_uniref90 = false
Expand Down Expand Up @@ -106,7 +107,7 @@ profiles {
slurm {
executor {
name = "slurm"
queueSize = 100
queueSize = params.setup ? 1 : 100
// exitReadTimeout = "360 sec"
// submitRateLimit = '1 / 2 s'
// pollInterval = '30 sec'
Expand All @@ -119,7 +120,7 @@ profiles {
lsf {
executor {
name = "lsf"
queueSize = 100
queueSize = params.setup ? 1 : 100
// exitReadTimeout = "360 sec"
// submitRateLimit = '1 / 2 s'
// pollInterval = '30 sec'
Expand Down