Parsing reads from SAM file by Fwd-Fwd orientation
1
0
Entering edit mode
7.0 years ago
ThePresident ▴ 180

I want to extract mate-pairs that mapped on the same strand, i.e. fwd-fwd and/or rev-rev. As I understand it, this information is encoded on the FLAG field in the SAM file. However, I am not sure which values are used to specifies such reads. One previous post suggested that 113+177 values of the FLAG field specifies reads that both mapped on the reverse strand. However, not sure how fwd-fwd would be encoded?

Also, the number of reads bearing 113 and 177 flag values is not identical in my dataset, but it should be, right?

Otherwise, is there another method of doing this?

Thank you, TP

SAM FLAG R • 1.5k views
ADD COMMENT
0
Entering edit mode
7.0 years ago

using samjs: https://github.com/lindenb/jvarkit/wiki/SamJS

 java -jar dist/samjs.jar -e '!record.getReadUnmappedFlag() && record.getReadPairedFlag() && !record.getMateUnmappedFlag() && record.getReferenceName().equals(record.getMateReferenceName()) && record.getReadNegativeStrandFlag()==record.getMateNegativeStrandFlag()'  input.bam
ADD COMMENT
0
Entering edit mode

Thanks for the detailed command line since my java understanding equals 0. I'll give it a shot.

ADD REPLY

Login before adding your answer.

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