Skip to content

Commit

Permalink
add sort step to xengsort
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeWLloyd committed Jul 18, 2024
1 parent 891c52f commit 4f274dd
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions modules/xengsort/xengsort_classify.nf
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ process XENGSORT_CLASSIFY {
tuple val(sampleID), path(trimmed)

output:
tuple val(sampleID), path("fastq-graft.*.fq"), emit: xengsort_human_fastq
tuple val(sampleID), path("fastq-host.*.fq"), emit: xengsort_mouse_fastq
tuple val(sampleID), path("*fastq-graft_sorted.*.fq"), emit: xengsort_human_fastq
tuple val(sampleID), path("*fastq-host_sorted.*.fq"), emit: xengsort_mouse_fastq
tuple val(sampleID), path("*.txt"), emit: xengsort_log

script:
Expand All @@ -42,6 +42,9 @@ process XENGSORT_CLASSIFY {
--chunksize 32.0 \
--compression none &> ${sampleID}_xengsort_log.txt
cat fastq-host.1.fq | paste - - - - | sort -k1,1 -t " " | tr "\t" "\n" > ${sampleID}_fastq-host_sorted.1.fq
cat fastq-graft.1.fq | paste - - - - | sort -k1,1 -t " " | tr "\t" "\n" > ${sampleID}_fastq-graft_sorted.1.fq
"""

else if (params.read_type == "PE")
Expand All @@ -59,6 +62,12 @@ process XENGSORT_CLASSIFY {
--chunksize 32.0 \
--compression none &> ${sampleID}_xengsort_log.txt
cat fastq-host.1.fq | paste - - - - | sort -k1,1 -t " " | tr "\\t" "\\n" > ${sampleID}_fastq-host_sorted.1.fq
cat fastq-host.2.fq | paste - - - - | sort -k1,1 -t " " | tr "\\t" "\\n" > ${sampleID}_fastq-host_sorted.2.fq
cat fastq-graft.1.fq | paste - - - - | sort -k1,1 -t " " | tr "\\t" "\\n" > ${sampleID}_fastq-graft_sorted.1.fq
cat fastq-graft.2.fq | paste - - - - | sort -k1,1 -t " " | tr "\\t" "\\n" > ${sampleID}_fastq-graft_sorted.2.fq
"""

else error "${params.read_type} is invalid, specify either SE or PE"
Expand Down

0 comments on commit 4f274dd

Please sign in to comment.