Clip primer sequences post alignment
See original GitHub issueHello,
we are doing targeted sequencing using a Qiagen Kit. During library prep the dna is fragmented and tagged with UMI and a universal primer sequence at one end of the strand. So for the enrichment only one specific primer per amplicon is needed.
I would like to clip the primer sequences after alignment. fgbio
provides the tools TrimPrimers
and ClipBam
. The first one expect a pair of primers, where the second one clippes a fixed number of bases.
Qiagen provides a file like this:
chr3 178928203 1 AAAAGCTATTATATATACATAAGAGAGAAGGTTTGACTGCC
chr3 178928223 0 TCCATGCTTAGAGTTGGAGTTTGACTGGTTC
chr3 178928286 0 GATTGAAGAGCATGCCAATTGGTCTGTATCC
The first two columns describes the start position of the primer, the third whether the read is a forward (0
) or reverse (1
) primer and in the 5th column the sequence.
What I wish is a tools that takes the bam
and the above tab separated text file as input and clippes (soft and/or hard) the primers from the reads after alignment. It should take care if the opposite strand overlaps the clipped region and clip those bases as well.
Could fgbio
provide such a function?
Thanks!
fin swimmer
FYI: I asked for such a tool before on biostars.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:10 (5 by maintainers)
Top GitHub Comments
I understand now. Let me see what I can do. It may be a little while as I have to prioritize client work but it shouldn’t be that hard.
@nh13 Sure thing, very understandable!
We are using
TrimPrimers
as recommended by your friends at Paragon Genomics. The current implementation works for our needs and for that kit without any modification.This thread caught my attention as I can imagine such a flag being useful to extend the tool to remove primers for example from long, partially overlapping amplicons broken down with Nextera. In that case, only the two ends of each amplicon would require trimming, whereas all other “internal” fragments should not be trimmed.
Very ok for me to put this in back-burner. Thanks!