Found while implementing the barcode SAM tags in #226, which touches this validation block but deliberately did not change it.
What STAR does
ParametersSolo.cpp:145-150: when --soloBarcodeMate puts the barcode inside a cDNA mate, STAR refuses the run unless that mate has clipping configured.
if ( pP->pClip.in[0].N[barcodeRead] == 0 && pP->pClip.in[1].N[barcodeRead] == 0 ){//clipping not specified for the mate with barcodes
exitWithError("EXITING because of fatal PARAMETERS error: --soloBarcodeMate " + to_string(barcodeReadIn) +
" specifies that barcode sequence is a part of the mate " + to_string(barcodeReadIn) +
", which requires clipping the barcode off this mate."
"\nSOLUTION: clip the barcode sequence from 5' or/and 3' with --clip5pNbases or/and --clip3pNbases ."
" The values for mate1 and mate2 have to specified, specify 0 for no clipping.", ...);
};
The rule exists because the barcode region is not cDNA. STAR has no way to know how many bases to drop other than being told.
What rustar-aligner does
Parameters::validate checks --soloBarcodeMate 1 only for the solo type and the read-file count (src/params/mod.rs, the match params.solo_barcode_mate block). Nothing checks --clip5pNbases / --clip3pNbases.
So --soloBarcodeMate 1 without a clip runs to completion, and mate 1 is aligned with its CB+UMI prefix still attached: for 10x v3 geometry that is 28 bases of barcode in front of the cDNA. The read either soft-clips those bases (best case, a shorter effective mate) or drags the alignment start, and the run reports no error at any point.
Suggested fix
Extend the 1 => arm of the solo_barcode_mate match to require a non-zero clip5pNbases or clip3pNbases on the barcode mate, with STAR's message. It is a validation-only change, plus a test asserting that the combination is refused and that it is accepted once a clip is given.
Scope note
--soloBarcodeMate is 0 or 1 here; STAR also accepts 2 and 3, which rustar rejects with its own message. The check above applies to whichever mate is selected.
Found while implementing the barcode SAM tags in #226, which touches this validation block but deliberately did not change it.
What STAR does
ParametersSolo.cpp:145-150: when--soloBarcodeMateputs the barcode inside a cDNA mate, STAR refuses the run unless that mate has clipping configured.The rule exists because the barcode region is not cDNA. STAR has no way to know how many bases to drop other than being told.
What rustar-aligner does
Parameters::validatechecks--soloBarcodeMate 1only for the solo type and the read-file count (src/params/mod.rs, thematch params.solo_barcode_mateblock). Nothing checks--clip5pNbases/--clip3pNbases.So
--soloBarcodeMate 1without a clip runs to completion, and mate 1 is aligned with its CB+UMI prefix still attached: for 10x v3 geometry that is 28 bases of barcode in front of the cDNA. The read either soft-clips those bases (best case, a shorter effective mate) or drags the alignment start, and the run reports no error at any point.Suggested fix
Extend the
1 =>arm of thesolo_barcode_matematch to require a non-zeroclip5pNbasesorclip3pNbaseson the barcode mate, with STAR's message. It is a validation-only change, plus a test asserting that the combination is refused and that it is accepted once a clip is given.Scope note
--soloBarcodeMateis 0 or 1 here; STAR also accepts 2 and 3, which rustar rejects with its own message. The check above applies to whichever mate is selected.