Primer and primer-dimer trimming
Primer trimming
A primer is identified when the configured fraction of the primer overlaps the aligned part of a read.
For paired-end reads, the primers identified for read 1 and read 2 must belong to the same target-region primer pair. Otherwise, both reads are removed from the mapping.
Primers are unaligned only when they occur at a read end, including when the primer region is already partly unaligned. Primer positions are evaluated strictly: if additional bases are present between a primer and the read end, the region is not identified as primer sequence.
Primer-dimer trimming
Primer-dimer artifacts are identified and unaligned as follows:
- Each primer is compared with all other primers to identify pairs with a sufficiently long overlap of complementary bases that may dimerize.
- When a primer has been unaligned from a read, the remaining mapped part of the read is compared with primers predicted to dimerize with it. If the mapped part starts with the sequence of one of these primers, that sequence is considered a primer-dimer artifact and is unaligned. A read consisting only of primer-dimer sequence is removed from the mapping.
A limited number of ambiguous nucleotides in each reference region covered by a primer is supported. Each ambiguous nucleotide is evaluated as the unambiguous nucleotides it can represent. Primers covering regions that exceed the supported limit are not evaluated for primer-dimer artifacts and are listed in the log.
Trimming primers from amplicon fragments
The Trim primers of amplicon fragments option enables unaligning of both forward and reverse primers from both ends of reads, regardless of read orientation. This is useful for reads originating from short fragments, where a read may extend into the primer at the opposite end of the amplicon.
When primer annotations overlap, the innermost primer determines how much of the read is unaligned, regardless of read orientation and expected primer pairing. Primer IDs are not considered. This allows primers to be unaligned when a read ends in a region containing multiple overlapping primer annotations and it cannot be determined which primer generated the read.
For read pairs mapping in the forward orientation, primers are unaligned when:
- The 5' end of read 1 starts within a forward primer annotation.
- The 5' end of read 2 starts within a reverse primer annotation.
- The 3' end of read 2 ends within a forward primer annotation.
- The 3' end of read 1 ends within a reverse primer annotation.
- The 5' end of read 2 starts within a forward primer annotation.
- The 5' end of read 1 starts within a reverse primer annotation.
- The 3' end of read 1 ends within a forward primer annotation.
- The 3' end of read 2 ends within a reverse primer annotation.
