Extraction of partially mapped reads from BAM
1
0
Entering edit mode
3.9 years ago
nkausthu ▴ 30

Hi, It would be great if anyone can give some suggestion on extracting partially mapped reads from bam/sam generated using BWA or articles which describes more about partially mapped reads. Thank you.

BAM Partially mapped reads BWA • 2.3k views
3
Entering edit mode
3.9 years ago

using samjdk: http://lindenb.github.io/jvarkit/SamJdk.html

search for mapped read with clipped read (partial mapping) and other canonical alignments (SA attribute)

java -jar src/jvarkit-git/dist/samjdk.jar -e 'return !record.getReadUnmappedFlag() && record.getCigar().isClipped() && record.getAttribute("SA")!=null;'  in.bam

0
Entering edit mode

Thank you so much and I could retrieve partially mapped reads using samjdk. I have one more query, I want to retrieve the part of the read sequences which are soft-clipped. Any tools are available for this or do I need to write the code for the same.

0
Entering edit mode
0
Entering edit mode

I used samextractclip.jar and converted clipped part of the reads into fastq file. Actually I am trying to figure out the breakpoints for a balanced translocation using these reads. Could you please give some suggestion in this regard.

0
Entering edit mode

Please don't pile up the questions.

This is a new independent question.

validate this one (green tick on the left) if it's been answered ( and it was).

0
Entering edit mode

Hi,

Is there any other way to do it? I tried using your code but it says: Error: Unable to access jarfile src/jvarkit-git/dist/samjdk.jar

0
Entering edit mode

Unable to access jarfile src/jvarkit-git/dist/samjdk.jar

it was , of course, just an example of path.... after compilation it should be in the 'dist' directory.

0
Entering edit mode

I know that was a dumb question to ask but I still can't locate "samjdk.jar". It looks like I have java installed on my server.