Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if flowcell id matches for paired samples #1664

Merged
merged 6 commits into from
Oct 30, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions workflows/sarek/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -944,11 +944,16 @@ workflow SAREK {
// Add readgroup to meta and remove lane
def addReadgroupToMeta(meta, files) {
def CN = params.seq_center ? "CN:${params.seq_center}\\t" : ''

def flowcell = flowcellLaneFromFastq(files[0])

// Check if flowcell ID matches for paired samples
pmoris marked this conversation as resolved.
Show resolved Hide resolved
if ( !flowcell && flowcell != flowcellLaneFromFastq(files[1]) ){
error("Flowcell ID does not match for paired reads of sample ${meta.id} - ${files}")
}

// Here we're assuming that fastq_1 and fastq_2 are from the same flowcell:
// If we cannot read the flowcell ID from the fastq file, then we don't use it
def sample_lane_id = flowcellLaneFromFastq(files[0]) ? "${flowcell}.${meta.sample}.${meta.lane}" : "${meta.sample}.${meta.lane}"
// TO-DO: Would it perhaps be better to also call flowcellLaneFromFastq(files[1]) and check that we get the same flowcell-id?

// Don't use a random element for ID, it breaks resuming
def read_group = "\"@RG\\tID:${sample_lane_id}\\t${CN}PU:${meta.lane}\\tSM:${meta.patient}_${meta.sample}\\tLB:${meta.sample}\\tDS:${params.fasta}\\tPL:${params.seq_platform}\""
Expand Down
Loading