Skip to content

Commit

Permalink
Merge pull request #87 from LaurenceKuhl/dev2
Browse files Browse the repository at this point in the history
Add versions to all modules
  • Loading branch information
mirpedrol authored Nov 13, 2023
2 parents cea1e19 + 43ce6cd commit 8a9fe54
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 10 deletions.
1 change: 1 addition & 0 deletions modules/local/alignment_summary.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ process ALIGNMENT_SUMMARY {

output:
tuple val(meta), path("*_alignment_summary.csv"), emit: summary
path "versions.yml", emit: versions

when:
task.ext.when == null || task.ext.when
Expand Down
2 changes: 1 addition & 1 deletion modules/local/bagel2/pr.nf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ process BAGEL2_PR {
def prefix = task.ext.prefix ?: "${meta.id}"

"""
BAGEL.py pr -i $bf -o '${meta.treatment}_vs_${meta.reference}.pr' -e $reference_essentials -n $reference_nonessentials
BAGEL.py pr -i $bf -o '${meta.treatment}_vs_${meta.reference}.pr' -e $reference_essentials -n $reference_nonessentials $args
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
8 changes: 7 additions & 1 deletion modules/local/cigar_parser.nf
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ process CIGAR_PARSER {
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Rscript: \$(Rscript --version)
seqinr: \$(Rscript -e "cat(paste(packageVersion('seqinr'), collapse='.'))")
Rsamtools: \$(Rscript -e "cat(paste(packageVersion('Rsamtools'), collapse='.'))")
dplyr: \$(Rscript -e "cat(paste(packageVersion('dplyr'), collapse='.'))")
ShortRead: \$(Rscript -e "cat(paste(packageVersion('ShortRead'), collapse='.'))")
jsonlite: \$(Rscript -e "cat(paste(packageVersion('jsonlite'), collapse='.'))")
stringr: \$(Rscript -e "cat(paste(packageVersion('stringr'), collapse='.'))")
plotly: \$(Rscript -e "cat(paste(packageVersion('plotly'), collapse='.'))")
END_VERSIONS
"""
}
2 changes: 2 additions & 0 deletions modules/local/clustering_summary.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ process CLUSTERING_SUMMARY {

output:
tuple val(meta), path("*_clustering_summary.csv"), emit: summary
path "versions.yml", emit: versions


when:
task.ext.when == null || task.ext.when
Expand Down
14 changes: 13 additions & 1 deletion modules/local/crisprseq_plotter.nf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,19 @@ process CRISPRSEQ_PLOTTER {
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Rscript: \$(Rscript --version)
ggplot2: \$(Rscript -e "cat(paste(packageVersion('ggplot2'), collapse='.'))")
ShortRead: \$(Rscript -e "cat(paste(packageVersion('ShortRead'), collapse='.'))")
plyr: \$(Rscript -e "cat(paste(packageVersion('plyr'), collapse='.'))")
dplyr: \$(Rscript -e "cat(paste(packageVersion('dplyr'), collapse='.'))")
seqinr: \$(Rscript -e "cat(paste(packageVersion('seqinr'), collapse='.'))")
ggpubr: \$(Rscript -e "cat(paste(packageVersion('ggpubr'), collapse='.'))")
ggmsa: \$(Rscript -e "cat(paste(packageVersion('ggmsa'), collapse='.'))")
seqmagick: \$(Rscript -e "cat(paste(packageVersion('seqmagick'), collapse='.'))")
stringr: \$(Rscript -e "cat(paste(packageVersion('stringr'), collapse='.'))")
tidyr: \$(Rscript -e "cat(paste(packageVersion('tidyr'), collapse='.'))")
ggseqlogo: \$(Rscript -e "cat(paste(packageVersion('ggseqlogo'), collapse='.'))")
plotly: \$(Rscript -e "cat(paste(packageVersion('plotly'), collapse='.'))")
cowplot: \$(Rscript -e "cat(paste(packageVersion('cowplot'), collapse='.'))")
END_VERSIONS
"""
}
2 changes: 1 addition & 1 deletion modules/local/mageck/graphrra.nf
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ process MAGECK_GRAPHRRA {
version_file_path <- "versions.yml"
version_flute <- paste(unlist(packageVersion("MAGeCKFlute")), collapse = ".")
version_ggplot <- paste(unlist(packageVersion("MAGeCKFlute")), collapse = ".")
version_ggplot <- paste(unlist(packageVersion("ggplot2")), collapse = ".")
f <- file(version_file_path, "w")
writeLines('"${task.process}":', f)
Expand Down
2 changes: 2 additions & 0 deletions modules/local/preprocessing_summary.nf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ process PREPROCESSING_SUMMARY {

output:
tuple val(meta), path("*_preprocessing_summary.csv"), emit: summary
path "versions.yml", emit: versions


when:
task.ext.when == null || task.ext.when
Expand Down
9 changes: 4 additions & 5 deletions modules/nf-core/mageck/count/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions templates/alignment_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@
add_line = False
if add_line:
output_file.write(f"aligned-reads, {mapped_reads_count} ({round(mapped_reads_percentage, 1)}%)\\n")

with open("versions.yml", "w") as f:
f.write('"${task.process}":\\n')
f.write(f' pysam: "{pysam.__version__}"\\n')
5 changes: 5 additions & 0 deletions templates/clustering_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import gzip
import sys

import Bio
from Bio import SeqIO

with gzip.open("$reads", "rt") as handle:
Expand All @@ -22,3 +23,7 @@
add_line = False
if add_line:
output_file.write(f"clustered-reads, {clusters_count}\\n")

with open("versions.yml", "w") as f:
f.write('"${task.process}":\\n')
f.write(f' biopython: "{Bio.__version__}"\\n')
6 changes: 6 additions & 0 deletions templates/preprocessing_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import gzip

import Bio
from Bio import SeqIO

with gzip.open("${raw_reads[0]}", "rt") as handle:
Expand Down Expand Up @@ -49,3 +50,8 @@
output_file.write(
f"quality-filtered-reads, {trimmed_reads_count} ({round(trimmed_reads_count * 100 / assembled_reads_count,1)}%)\\n"
)


with open("versions.yml", "w") as f:
f.write('"${task.process}":\\n')
f.write(f' biopython: "{Bio.__version__}"\\n')
4 changes: 3 additions & 1 deletion workflows/crisprseq_screening.nf
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ workflow CRISPRSEQ_SCREENING {

ch_versions = ch_versions.mix(MAGECK_COUNT.out.versions.first())


MAGECK_COUNT.out.count.map {
it -> it[1]
}.set { ch_counts }
Expand Down Expand Up @@ -209,6 +208,9 @@ workflow CRISPRSEQ_SCREENING {
BAGEL2_GRAPH (
BAGEL2_PR.out.pr
)

ch_versions = ch_versions.mix(BAGEL2_GRAPH.out.versions)

}

if(params.mle_design_matrix) {
Expand Down
5 changes: 5 additions & 0 deletions workflows/crisprseq_targeted.nf
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ workflow CRISPRSEQ_TARGETED {
PREPROCESSING_SUMMARY {
ch_preprocessing_summary_data
}
ch_versions = ch_versions.mix(PREPROCESSING_SUMMARY.out.versions)


if (params.umi_clustering) {
Expand Down Expand Up @@ -601,6 +602,9 @@ workflow CRISPRSEQ_TARGETED {
.join(PREPROCESSING_SUMMARY.out.summary)
)

ch_versions = ch_versions.mix(CLUSTERING_SUMMARY.out.versions)



//
// MODULE: Mapping with Minimap2
Expand Down Expand Up @@ -660,6 +664,7 @@ workflow CRISPRSEQ_TARGETED {
ch_mapped_bam
.join(CLUSTERING_SUMMARY.out.summary)
)
ch_versions = ch_versions.mix(ALIGNMENT_SUMMARY.out.versions)


//
Expand Down

0 comments on commit 8a9fe54

Please sign in to comment.