Question: extract region bam
0
gravatar for J.F.Jiang
4 days ago by
J.F.Jiang650
China
J.F.Jiang650 wrote:

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 • 106 views
ADD COMMENTlink modified 2 days ago by h.mon9.6k • written 4 days ago by J.F.Jiang650
0
gravatar for h.mon
2 days ago by
h.mon9.6k
Brazil
h.mon9.6k wrote:

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 COMMENTlink written 2 days ago by h.mon9.6k

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 REPLYlink written 23 hours ago by J.F.Jiang650
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1019 users visited in the last hour