Skip to content

Commit

Permalink
r package and standard .yml version reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
Riley-Grindle committed Sep 10, 2024
1 parent 4884a99 commit 5049e74
Show file tree
Hide file tree
Showing 9 changed files with 106 additions and 20 deletions.
15 changes: 13 additions & 2 deletions modules/local/doubletfinder.nf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ process FIND_DOUBLETS {
tuple val(meta), path ("*_DoubletsRmSO.rds"), emit: rds
tuple val(meta), path("*Validation.log"), emit: log
path("*.pdf")
//path ("versions.yml"), emit: versions
path ("*FinalVersions.log"), emit: r_versions
path("versions.yml"), emit: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -39,13 +40,23 @@ process FIND_DOUBLETS {
$scale_method \\
${args}
grep -i -E "R version " 02_${meta.id}_InitialVersions.log | perl -pe 's/ version /: "/g;s/ \(.*/"/g' >> 02_${meta.id}_FinalVersions.log
perl -ne 'print if /other attached packages:/ .. /^$/' 02_${meta.id}_InitialVersions.log | grep -v "other" | perl -pe 's/\[.*]\s+//g;s/\s+/\n/g' | grep -v "^$" | perl -pe 's/_/: "/g;s/$/"/' >> 02_${meta.id}_FinalVersions.log
cat <<-END_VERSIONS > versions.yml
"${task.process}":
R: \$(echo \$(R --version| head -n 1| grep -Eo "[0-9]+[^ ]*"| head -n 1) )
END_VERSIONS
"""

stub:
"""
touch 02_${meta.id}_InitialVersions.log
touch 02_${meta.id}_FinalVersions.log
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Seurat: \$(echo \$(Seurat --version) | sed "s/Seurat, version //g" )
R: \$(echo \$(R --version| head -n 1| grep -Eo "[0-9]+[^ ]*"| head -n 1) )
END_VERSIONS
"""

Expand Down
19 changes: 16 additions & 3 deletions modules/local/find_NN_clusters.nf
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ process FIND_NN_CLUSTER {

output:
tuple val(meta), path ("*_ClusterSO.rds"), emit: rds
tuple val(meta), path("*Validation.log"), emit: log
tuple val(meta), path("*Validation.log"), emit: log
path("markers")
path("*.pdf")
//path ("versions.yml"), emit: versions
path ("*FinalVersions.log"), emit: r_versions
path('versions.yml'), emit: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -44,13 +45,25 @@ process FIND_NN_CLUSTER {
${meta.group} \\
$scale_method \\
${args}
grep -i -E "R version " 07_${meta}_InitialVersions.log | perl -pe 's/ version /: "/g;s/ \(.*/"/g' >> 07_${meta}_FinalVersions.log
perl -ne 'print if /other attached packages:/ .. /^$/' 07_${meta}_InitialVersions.log | grep -v "other" | perl -pe 's/\[.*]\s+//g;s/\s+/\n/g' | grep -v "^$" | perl -pe 's/_/: "/g;s/$/"/' >> 07_${meta}_FinalVersions.log
cat <<-END_VERSIONS > versions.yml
"${task.process}":
R: \$(echo \$(R --version| head -n 1| grep -Eo "[0-9]+[^ ]*"| head -n 1) )
END_VERSIONS
"""

stub:
"""
touch 07_${meta}_InitialVersions.log
touch 07_${meta}_FinalVersions.log
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Seurat: \$(echo \$(Seurat --version) | sed "s/Seurat, version //g" )
R: \$(echo \$(R --version| head -n 1| grep -Eo "[0-9]+[^ ]*"| head -n 1) )
END_VERSIONS
"""

Expand Down
3 changes: 2 additions & 1 deletion modules/local/gzip.nf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ process GZIP {

output:
tuple val(meta), path (sample_files), emit: zip
path("versions.yml"), emit: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -27,7 +28,7 @@ process GZIP {
cat <<-END_VERSIONS > versions.yml
"${task.process}":
GZIP: \$(echo \$(gzip --version) )
GZIP: \$(echo \$(gzip --version| head -n 1| sed 's/gzip //) )
END_VERSIONS
"""

Expand Down
15 changes: 13 additions & 2 deletions modules/local/integration.nf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ process INTEGRATION {
output:
tuple val(meta), path ("*_IntegrateSO.rds"), emit: rds
tuple val(meta), path("*Validation.log"), emit: log
//path ("versions.yml"), emit: versions
path ("*FinalVersions.log"), emit: r_versions
path("versions.yml"), emit: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -31,13 +32,23 @@ process INTEGRATION {
$scale_method \\
${args}
grep -i -E "R version " 06_${meta}_InitialVersions.log | perl -pe 's/ version /: "/g;s/ \(.*/"/g' >> 06_${meta}_FinalVersions.log
perl -ne 'print if /other attached packages:/ .. /^$/' 06_${meta}_InitialVersions.log | grep -v "other" | perl -pe 's/\[.*]\s+//g;s/\s+/\n/g' | grep -v "^$" | perl -pe 's/_/: "/g;s/$/"/' >> 06_${meta}_FinalVersions.log
cat <<-END_VERSIONS > versions.yml
"${task.process}":
R: \$(echo \$(R --version| head -n 1| grep -Eo "[0-9]+[^ ]*"| head -n 1) )
END_VERSIONS
"""

stub:
"""
touch 06_${meta}_InitialVersions.log
touch 06_${meta}_FinalVersions.log
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Seurat: \$(echo \$(Seurat --version) | sed "s/Seurat, version //g" )
R: \$(echo \$(R --version| head -n 1| grep -Eo "[0-9]+[^ ]*"| head -n 1) )
END_VERSIONS
"""

Expand Down
13 changes: 10 additions & 3 deletions modules/local/makeseurat.nf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ process MAKE_SEURAT {
output:
tuple val(meta), path ("*SO.rds"), emit: rds
tuple val(meta), path("*Validation.log"), emit: log
path ("versions.yml"), emit: versions
path ("*FinalVersions.log"), emit: r_versions
path ('versions.yml'), emit: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -41,17 +42,23 @@ process MAKE_SEURAT {
perl -i -pe 's/"//g;s/\\[\\d\\d?\\d?\\] //g' fileName.log *_Validation.log
grep -i -E "R version " 00_${meta.id}_InitialVersions.log | perl -pe 's/ version /: "/g;s/ \(.*/"/g' >> 00_${meta.id}_FinalVersions.log
perl -ne 'print if /other attached packages:/ .. /^$/' 00_${meta.id}_InitialVersions.log | grep -v "other" | perl -pe 's/\[.*]\s+//g;s/\s+/\n/g' | grep -v "^$" | perl -pe 's/_/: "/g;s/$/"/' >> 00_${meta.id}_FinalVersions.log
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Seurat: \$(echo \$( version) | sed "s/, version //g" )
R: \$(echo \$(R --version| head -n 1| grep -Eo "[0-9]+[^ ]*"| head -n 1) )
END_VERSIONS
"""

stub:
"""
touch 00_${meta.id}_InitialVersions.log
touch 00_${meta.id}_FinalVersions.log
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Seurat: \$(Rscript -e "packageVersion('Seurat')")
R: \$(echo \$(R --version| head -n 1| grep -Eo "[0-9]+[^ ]*"| head -n 1) )
END_VERSIONS
"""

Expand Down
15 changes: 13 additions & 2 deletions modules/local/merge.nf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ process MERGE_SO {
tuple val(meta), path ("*_MergedSO.rds"), emit: rds
path("*Validation.log"), emit: log
path("*.pdf")
//path ("versions.yml"), emit: versions
path ("*FinalVersions.log"), emit: r_versions
path("versions.yml"), emit: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -33,13 +34,23 @@ process MERGE_SO {
$scale_method \\
${args}
grep -i -E "R version " 04_${meta}_InitialVersions.log | perl -pe 's/ version /: "/g;s/ \(.*/"/g' >> 04_${meta}_FinalVersions.log
perl -ne 'print if /other attached packages:/ .. /^$/' 04_${meta}_InitialVersions.log | grep -v "other" | perl -pe 's/\[.*]\s+//g;s/\s+/\n/g' | grep -v "^$" | perl -pe 's/_/: "/g;s/$/"/' >> 04_${meta.id}_FinalVersions.log
cat <<-END_VERSIONS > versions.yml
"${task.process}":
R: \$(echo \$(R --version| head -n 1| grep -Eo "[0-9]+[^ ]*"| head -n 1) )
END_VERSIONS
"""

stub:
"""
touch 04_${meta}_InitialVersions.log
touch 04_${meta}_FinalVersions.log
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Seurat: \$(echo \$(Seurat --version) | sed "s/Seurat, version //g" )
R: \$(echo \$(R --version| head -n 1| grep -Eo "[0-9]+[^ ]*"| head -n 1) )
END_VERSIONS
"""

Expand Down
16 changes: 13 additions & 3 deletions modules/local/normalize_qc.nf
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ process NORMALIZE_QC {
tuple val(meta), path ("*_NormQCSO.rds"), emit: rds
tuple val(meta), path("*Validation.log"), emit: log
path("*.pdf")
//path ("versions.yml"), emit: versions

path ("*FinalVersions.log"), emit: r_versions
path("versions.yml"), emit: versions
when:
task.ext.when == null || task.ext.when

Expand Down Expand Up @@ -55,13 +55,23 @@ process NORMALIZE_QC {
$run_cc_score \\
${args}
grep -i -E "R version " 01_${meta.id}_InitialVersions.log | perl -pe 's/ version /: "/g;s/ \(.*/"/g' >> 01_${meta.id}_FinalVersions.log
perl -ne 'print if /other attached packages:/ .. /^$/' 01_${meta.id}_InitialVersions.log | grep -v "other" | perl -pe 's/\[.*]\s+//g;s/\s+/\n/g' | grep -v "^$" | perl -pe 's/_/: "/g;s/$/"/' >> 01_${meta.id}_FinalVersions.log
cat <<-END_VERSIONS > versions.yml
"${task.process}":
R: \$(echo \$(R --version| head -n 1| grep -Eo "[0-9]+[^ ]*"| head -n 1) )
END_VERSIONS
"""

stub:
"""
touch 01_${meta.id}_InitialVersions.log
touch 01_${meta.id}_FinalVersions.log
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Seurat: \$(echo \$(Seurat --version) | sed "s/Seurat, version //g" )
R: \$(echo \$(R --version| head -n 1| grep -Eo "[0-9]+[^ ]*"| head -n 1) )
END_VERSIONS
"""

Expand Down
15 changes: 13 additions & 2 deletions modules/local/plotting.nf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ process DISPLAY_REDUCTION {
path("*Validation.log"), emit: log
path("*.cloupe")
path("*.pdf")
//path ("versions.yml"), emit: versions
path ("*FinalVersions.log"), emit: r_versions
path('versions.yml'), emit: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -49,13 +50,23 @@ process DISPLAY_REDUCTION {
$eula_agreement \
${args}
grep -i -E "R version " 08_${meta}_InitialVersions.log | perl -pe 's/ version /: "/g;s/ \(.*/"/g' >> 08_${meta}_FinalVersions.log
perl -ne 'print if /other attached packages:/ .. /^$/' 08_${meta}_InitialVersions.log | grep -v "other" | perl -pe 's/\[.*]\s+//g;s/\s+/\n/g' | grep -v "^$" | perl -pe 's/_/: "/g;s/$/"/' >> 08_${meta}_FinalVersions.log
cat <<-END_VERSIONS > versions.yml
"${task.process}":
R: \$(echo \$(R --version| head -n 1| grep -Eo "[0-9]+[^ ]*"| head -n 1) )
END_VERSIONS
"""

stub:
"""
touch 08_${meta}_InitialVersions.log
touch 08_${meta}_FinalVersions.log
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Seurat: \$(echo \$(Seurat --version) | sed "s/Seurat, version //g" )
R: \$(echo \$(R --version| head -n 1| grep -Eo "[0-9]+[^ ]*"| head -n 1) )
END_VERSIONS
"""

Expand Down
15 changes: 13 additions & 2 deletions modules/local/runpca.nf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ process RUN_PCA {
tuple val(meta), path ("*_PCASO.rds"), emit: rds
tuple val(meta), path("*Validation.log"), emit: log
path("*.pdf")
//path ("versions.yml"), emit: versions
path ("*FinalVersions.log"), emit: r_versions
path("versions.yml"), emit: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -30,13 +31,23 @@ process RUN_PCA {
${meta} \\
${args}
grep -i -E "R version " 05_${meta}_InitialVersions.log | perl -pe 's/ version /: "/g;s/ \(.*/"/g' >> 05_${meta}_FinalVersions.log
perl -ne 'print if /other attached packages:/ .. /^$/' 05_${meta}_InitialVersions.log | grep -v "other" | perl -pe 's/\[.*]\s+//g;s/\s+/\n/g' | grep -v "^$" | perl -pe 's/_/: "/g;s/$/"/' >> 05_${meta.id}_FinalVersions.log
cat <<-END_VERSIONS > versions.yml
"${task.process}":
R: \$(echo \$(R --version| head -n 1| grep -Eo "[0-9]+[^ ]*"| head -n 1) )
END_VERSIONS
"""

stub:
"""
touch 05_${meta}_InitialVersions.log
touch 05_${meta}_FinalVersions.log
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Seurat: \$(echo \$(Seurat --version) | sed "s/Seurat, version //g" )
R: \$(echo \$(R --version| head -n 1| grep -Eo "[0-9]+[^ ]*"| head -n 1) )
END_VERSIONS
"""

Expand Down

0 comments on commit 5049e74

Please sign in to comment.