extract region bam
1
0
Entering edit mode
7.0 years ago
J.F.Jiang ▴ 930

Hi all,

I want to extract bam of specific amplicon to evaluate the according amplicon performance. I used to use samtools view xx.bam chr:start-end to extract the bam, however, if the two amplicon are totally overlapped, this command will return us the whole reads covering the two region.

For example:

first amplicon:

------------------------------------> <----------------------------------------

second amplicon:

           -------------------->

                      <-------------------

I firstly convert the bam to bed using bedtools, and get those reads name that are exactly match with the start position of the first amplicon. Then paired reads that belong the amplicon 1 were then extract from the bam file, as well as amplicon 2.

Is there any convenient method to seperately extract the exact reads belong to the two amplicons?

Thanks, Junfeng

bam region • 1.8k views
ADD COMMENT
0
Entering edit mode
7.0 years ago
h.mon 35k

A couple of suggestions:

1) use seal.sh from BBTools to split the sequencing before mapping. You could try something like:

seal.sh in=amplicons.fq ref=primers.fa pattern=out%.fq k=21 restrictleft=25 \
    nzo=f refstats=refstats.txt

See the discussion starting from post #25 on this SeqAnswers thread.

2) Maybe msa.sh and cutprimers.sh could also do what you want (I am tagging Brian Bushnell and genomax because they can probably clarify this). See discussion starting at post #19 on the same thread as above

ADD COMMENT
0
Entering edit mode

Thanks,

Either seal.sh or cutprimers.sh is spliting the raw sequencing file based on matched primers. However, I still want to begin from bam file.

ADD REPLY

Login before adding your answer.

Traffic: 2508 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