How to split Bam or Sam based on Pos and Strand parameters
1
0
Entering edit mode
8.8 years ago
ron.geller • 0

Hi,

I would like to split a bam file into 3 separate files according to the following criteria:

  1. Pos of 1251 and strand +
  2. Pos of 1268 and stand -
  3. and all the rest not matching above criteria.

This is because I need to specifically mask the first several or last several bases for conditions 1 and 2 above (they are PCR primers that need to be masked but not clipped as I need read length to stay consistent). I will then combine the bam again for downstream processing.

Any held would be appreciated.

Ron

ngs bam sam next-gen • 1.6k views
ADD COMMENT
3
Entering edit mode
8.8 years ago

I wrote this tool PcrClipReads "Soft clip BAM files based on PCR target regions. See also Limiting variant calls to amplicon target regions?

ADD COMMENT
0
Entering edit mode

Thanks Pierre. I have overlapping PCR fragments. They overlap by 150 bases. Will this still work? My end goal is to soft clip the primer sequences, but only when the start position matches the primer (to not lose information from the overlap that is not the primer).

ADD REPLY
0
Entering edit mode

No my tool doesn't allow overlapping PCR fragments: (https://github.com/lindenb/jvarkit/blob/master/src/main/java/com/github/lindenb/jvarkit/tools/pcr/PcrClipReads.java#L89) but may be could run a loop over all the amplified regions?

ADD REPLY

Login before adding your answer.

Traffic: 3030 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6