Skip to content
Snippets Groups Projects
Verified Commit d671e35f authored by Laurent Modolo's avatar Laurent Modolo
Browse files

split.nf: change detection of file truncation

parent 79b0bfad
Branches
No related tags found
No related merge requests found
...@@ -17,11 +17,17 @@ process SPLIT { ...@@ -17,11 +17,17 @@ process SPLIT {
zcat ${fastq} | split -l 4000000 - ${fastq.simpleName}_ zcat ${fastq} | split -l 4000000 - ${fastq.simpleName}_
ls -l ${fastq.simpleName}_* | \\ ls -l ${fastq.simpleName}_* | \\
awk '{system("if [\$(wc -l "\$9") -ne 4000000]; then exit 1; fi")}' awk '{system("if [\$(wc -l "\$9") -ne 4000000]; then echo "1" > error.txt; fi")}'
ls -l ${fastq.simpleName}_* | \\ ls -l ${fastq.simpleName}_* | \\
awk '{system("gzip -c "\$9" > "\$9".fastq.gz && rm "\$9)}' awk '{system("gzip -c "\$9" > "\$9".fastq.gz && rm "\$9)}'
if [ -e "error.txt" ]
then
echo "file truncation detected" >&2
exit 1
fi
cat <<-END_VERSIONS > versions.yml cat <<-END_VERSIONS > versions.yml
"${task.process}": "${task.process}":
split: v1.35.0 split: v1.35.0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment