Hi friends, I'm getting a weird error when I try t...
# sarek
s
Hi friends, I'm getting a weird error when I try to add more samples to my samplesheet. I have sarek up and running with strelka for 3 samples (one per condition), but when I add an additional rep for all 3, I get this cryptic error:
Copy code
Detected join operation duplicate emission on right channel -- offending element: key=1; value=[patient:1, sample:537_control_R3, sex:NA, status:0, n_fastq:24, data_type:cram, id:537_control_R3],/mnt/scratch/lotrecks/sarek_work/02/73621499019c3734201de8fa91dded/537_control_R3.md.cram,/mnt/scratch/lotrecks/sarek_work/02/73621499019c3734201de8fa91dded/537_control_R3.md.cram.crai


ERROR ~ Pipeline failed. Please refer to troubleshooting docs: https://nf-co.re/docs/usage/troubleshooting

-- Check '.nextflow.log' file for details
[86/54744b] Submitted process > NFCORE_SAREK:SAREK:BAM_MARKDUPLICATES:CRAM_QC_MOSDEPTH_SAMTOOLS:SAMTOOLS_STATS (01M_R1)
But when I look at the log and the workdirs specific in the error message, it doesn't actually look like any steps have failed? It also runs the original samples fine, but not the new ones, they're just missing from the output. I've attached my samplesheet below, I'm sure it's something about how I named the samples or what patient I said they were (I'm looking at a population of haploid algae so the patient option is sort of not relevant)
I messed around with my sample naming because I thought that could be part of the issue, but I'm still getting the same error -- here's the new samplesheet:
nanno_samplesheet_2reps.csv
Well, turns out you just can't have replicates for the control in the same samplesheet. This seems bad to me -- what's the reasoning behind it?
t
Yes, that's what it is (
537controlRep2/3
in this case). The reason for not having two controls for one patient is mostly practical -- if you have a patient with both tumor (
1
) and normal (
0
) samples, they will be analyzed and tumor-normal pairs (i.e. showing how the tumor differs from the normal). If you have two normals, which one should be used for this comparison? Ideally they are both the same, but then you don't need replicates. And if they differ, you don't know which one is "correct" and should be used ... If you are curious if they really differ (maybe even to get a "background noise" estimate for the variant caller), then you can set the status of one of them to
1
and compare them. What I have done in this situation is to assume that they are the same and merge them, by just calling the sample e.g.
537controlRep2-3
, so that sarek basically used all of the FASTQs from your reps in a single sample.
a
I had a similar issue after 24h+ of execution. As a suggestion, it could be captured way earlier in the execution, possibly in the very beginning. For instance, with `awk`:
Copy code
awk -F ',' '{ if ($2 == 0) print $2, $4 }' nanno_samplesheet_2reps.csv | sort | uniq -c
We have two “zeros” (controls) per lane:
Copy code
2 0 L1
   2 0 L2
Let me know if makes sense, I can PR your pipeline with a possible solution 🍻
t
Sorry, I'm not sure what your columns are (there is no standard order, it goes by name). You can have the same sample & patient (& status) twice, and I think the lane has to differ -- in this case they get merged. Otherwise samples have to be distinct, and you can't have two "normals" for the same patient. I thought this was enforced in the sample sheet validation (before the pipeline really starts with processes)? If not, please open an issue on GitHub.
👌 1
a
Ok, I am using the same file as @Serena example to showcase how this could be done
If I got the problem correctly, you can’t have two rows with
status == 0
on the same
lane
. This, unfortunately, is not captured by the schema_input.json file.
t
Technically you can run the same sample with two barcodes/indices on the same lane. In that case the files should be merged (although the "read group" may not be handled appropriately if
lane
is set to the actual lane ID, since
lane
is meant to be a catch-all term for distinguishing characteristics other than
sample
and
patient
). Typically nobody does that, except by accident, since it requires two libraries for the same sample, which is a waste of money.