Skip to content

Commit

Permalink
modularised creation of sample file to report in a separate block
Browse files Browse the repository at this point in the history
  • Loading branch information
Davide Bagordo committed Nov 13, 2024
1 parent 2de9129 commit 9687dd3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
12 changes: 2 additions & 10 deletions modules/local/report/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ process REPORT {
path(clustersummaries)
path(cdr3histograms)
path(cdr3tables)
val (metadata)
path(reportsamples)

output:
path '*.RData', emit: rdata
Expand All @@ -24,13 +24,6 @@ process REPORT {

script:
def args = task.ext.args ?: ''
def sampleData = new File("${workDir}/sampledata.tsv")
sampleData.append('ID\tindividual\timmunisation\tboost\n')

// Popola il file sampledata.tsv con i dati dalla mappa metadata
metadata.each() { map ->
sampleData.append("${map.sampleID}\t${map.individualID}\t${map.immunisation}\t${map.boost}\n")
}

// Concatena le liste dei file in stringhe separate da virgola
clusterList = clustersummaries.join(',')
Expand All @@ -41,13 +34,12 @@ process REPORT {

"""
ln -s '$moduleDir/nibsc_report.css' .
ln -s '${workDir}/sampledata.tsv' .
quarto render analysis_report.qmd \\
-P clusterList:\"$clusterList\" \\
-P histoList:\"$histoList\" \\
-P tableList:\"$tableList\" \\
-P sampleData:\"sampledata.tsv\" \\
-P sampleData:\"$reportsamples\" \\
-P sizeThreshold:\"${params.cluster_size_threshold}\" \\
-P loopFile:\"loop_tree.qmd" \\
-P calcTree:\"${params.calculate_tree}\" \\
Expand Down
7 changes: 6 additions & 1 deletion workflows/nanorepertoire.nf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ include { softwareVersionsToYAML } from '../subworkflows/nf-core/utils_nfcore_pi
include { methodsDescriptionText } from '../subworkflows/local/utils_nfcore_nanorepertoire_pipeline'
include { FASTQ_TO_FASTA } from '../subworkflows/local/fastq_to_fasta'
include { FASTA_CLUSTERING } from '../subworkflows/local/fasta_clustering'
include { REPORTSAMPLES } from '../modules/local/reportsamples'
include { REPORT } from '../modules/local/report'

/*
Expand Down Expand Up @@ -47,13 +48,17 @@ workflow NANOREPERTOIRE {
FASTQ_TO_FASTA.out.translated
)

REPORTSAMPLES(
FASTA_CLUSTERING.out.cdrmeta.collect()
)

REPORT(
file("${projectDir}/assets/analysis_report.qmd"),
file("${projectDir}/assets/loop_tree.qmd"),
FASTA_CLUSTERING.out.clusteread.collect(),
FASTA_CLUSTERING.out.cdrhistograms.collect(),
FASTA_CLUSTERING.out.cdrtsv.collect(),
FASTA_CLUSTERING.out.cdrmeta.collect()
REPORTSAMPLES.out.reportsamples
)

//
Expand Down

0 comments on commit 9687dd3

Please sign in to comment.