Skip to content

Commit

Permalink
reconnect to the overall workflow [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
abhi18av committed Jun 23, 2024
1 parent 4a2a04a commit fd2082c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bin/fastq_cohort_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
magma_analysis_dict[k]["fastqs_approved"] = False

with open('magma_analysis.json', 'w') as f:
json.dump(magma_analysis_dict, f, indent=4)
json.dump(magma_analysis_dict, f, indent=4, ensure_ascii= False)

# ============================================
# Parse the validation reports for exact sample names which passed/failed
Expand Down
8 changes: 4 additions & 4 deletions modules/fastq_utils/validator.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ process FASTQ_VALIDATOR {
val ready

output:
tuple val(meta), path("*.check.*csv")
tuple val(magmaName), path("*.check.*csv")
path("*.check.*csv") , emit: check_result
path("*.fastq_report.csv") , emit: fastq_report
tuple val(meta), path(sampleRead) , emit: reads
tuple val(magmaName), path(sampleRead) , emit: reads

shell:

Expand Down Expand Up @@ -56,7 +56,7 @@ process FASTQ_VALIDATOR {
VALIDATED=1
STATUS="passed"
echo -e "file,magma_name,fastq_utils_check" > !{sampleRead.simpleName}.check.${STATUS}.csv
echo -e "!{sampleRead},!{meta.id},${STATUS}" >> !{sampleRead.simpleName}.check.${STATUS}.csv
echo -e "!{sampleRead},!{magmaName},${STATUS}" >> !{sampleRead.simpleName}.check.${STATUS}.csv
csvtk join -f file !{sampleRead.simpleName}.fastq_statistics.csv !{sampleRead.simpleName}.check.${STATUS}.csv > !{sampleRead.simpleName}.fastq_report.csv
Expand All @@ -69,7 +69,7 @@ process FASTQ_VALIDATOR {
VALIDATED=0
STATUS="failed"
echo -e "file,magma_name,fastq_utils_check" > !{sampleRead.simpleName}.check.${STATUS}.csv
echo -e "!{sampleRead},!{meta.id},${STATUS}" >> !{sampleRead.simpleName}.check.${STATUS}.csv
echo -e "!{sampleRead},!{magmaName},${STATUS}" >> !{sampleRead.simpleName}.check.${STATUS}.csv
csvtk join -f file !{sampleRead.simpleName}.fastq_statistics.csv !{sampleRead.simpleName}.check.${STATUS}.csv > !{sampleRead.simpleName}.fastq_report.csv
Expand Down
4 changes: 2 additions & 2 deletions workflows/validate_fastqs_wf.nf
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ workflow VALIDATE_FASTQS_WF {
//Accomodate single/multi reads
if (read1 && read2) {

return [[id: magma_sample_name, paired: true, bam_rg_string:magma_bam_rg_string ], [file(read1, checkIfExists: true), file(read2, checkIfExists: true)]]
return [ magma_sample_name, [file(read1, checkIfExists: true), file(read2, checkIfExists: true)]]

} else {

return [[id: magma_sample_name, paired: true, bam_rg_string:magma_bam_rg_string ], [file(read1, checkIfExists: true)]]
return [magma_sample_name, [file(read1, checkIfExists: true)]]

}
}
Expand Down

0 comments on commit fd2082c

Please sign in to comment.