Skip to content

Commit

Permalink
Merge pull request #3 from mirpedrol/dev2
Browse files Browse the repository at this point in the history
Dev2
  • Loading branch information
LaurenceKuhl authored Nov 13, 2023
2 parents c8ad5a2 + ea081e0 commit 43ce6cd
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 8 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
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
"""
}
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
"""
}
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')
2 changes: 2 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 @@ -25,3 +26,4 @@

with open("versions.yml", "w") as f:
f.write('"${task.process}":\\n')
f.write(f' biopython: "{Bio.__version__}"\\n')
10 changes: 4 additions & 6 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 @@ -50,10 +51,7 @@
f"quality-filtered-reads, {trimmed_reads_count} ({round(trimmed_reads_count * 100 / assembled_reads_count,1)}%)\\n"
)

# Output version information
#version = pd.__version__
#matplotlib_version = plt.matplotlib.__version__
# alas, no `pyyaml` pre-installed in the cellranger container
with open("versions.yml", "w") as f:
f.write('"${task.process}":\\n')

with open("versions.yml", "w") as f:
f.write('"${task.process}":\\n')
f.write(f' biopython: "{Bio.__version__}"\\n')
3 changes: 3 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 @@ -663,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 Expand Up @@ -705,6 +707,7 @@ workflow CRISPRSEQ_TARGETED {
}
}
.set { ch_template_bam }
ch_versions = ch_versions.mix(MINIMAP2_ALIGN_TEMPLATE.out.versions)

ch_mapped_bam
.join(SAMTOOLS_INDEX.out.bai)
Expand Down

0 comments on commit 43ce6cd

Please sign in to comment.