Question: Parsing reads from SAM file by Fwd-Fwd orientation
0
gravatar for ThePresident
2.9 years ago by
ThePresident140
ThePresident140 wrote:

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 R flag • 779 views
ADD COMMENTlink modified 2.9 years ago by Pierre Lindenbaum127k • written 2.9 years ago by ThePresident140
0
gravatar for Pierre Lindenbaum
2.9 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum127k wrote:

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 COMMENTlink written 2.9 years ago by Pierre Lindenbaum127k

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

ADD REPLYlink written 2.9 years ago by ThePresident140
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: 1771 users visited in the last hour