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

remove bash integer convertion

parent fb49a425
No related branches found
No related tags found
No related merge requests found
......@@ -120,15 +120,15 @@ process SAMPLE_READS {
error "SEQTK/SAMPLE must have a sample_size value included"
}
"""
SAMPLE_SIZE=\$((cat $sample_size | tr -d '\\n'))
CURRENT_READ_NUMBER=\$((cat $read_number | tr -d '\\n'))
SAMPLE_SIZE=\$(cat $sample_size | tr -d '\\n')
CURRENT_READ_NUMBER=\$(cat $read_number | tr -d '\\n')
if [\$SAMPLE_SIZE -eq \$CURRENT_READ_NUMBER]; then
ln -s ${reads} sample_${reads}
READ_NUMBER=\$((cat $sample_size | tr -d '\\n'))
READ_NUMBER=\$(cat $sample_size | tr -d '\\n')
else
zcat ${reads} | head -n \$((cat $sample_size | tr -d '\\n')) | gzip -c > sample_${reads}
READ_NUMBER=\$((zcat sample_${reads} | wc -l))
zcat ${reads} | head -n \$(cat $sample_size | tr -d '\\n') | gzip -c > sample_${reads}
READ_NUMBER=\$(zcat sample_${reads} | wc -l)
fi
if [\$SAMPLE_SIZE -ne \$READ_NUMBER]; then
exit 1
......
......@@ -17,7 +17,7 @@ process SPLIT {
zcat ${fastq} | split -l 4000000 - ${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 exit 1; fi")}'
ls -l ${fastq.simpleName}_* | \\
awk '{system("gzip -c "\$9" > "\$9".fastq.gz && rm "\$9)}'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment