Split SAM file from paired end read into forward and reverse strand

Hi everyone,
How to split sam file from paired end read into forward and reverse strand ? I used hicexplorer to make analysis of hicdata GSE84022, however, in step “hicBuildMatrix”, it need forward and reverse sam files. With GEO SRA files, I can not provide forward and reverse sam files ,I can just give merge forward and reverse files.

   please help me !

     Thanks

Dear @Yuliang_Wang,
You can do this with Samtools view - reformat, filter, or subsample SAM, BAM or CRAM. Select your bam file and then choose under What would you like to look at? the option A filtered/subsampled selection of reads. For your forward reads you choose under Exclude reads with any of the following flags set the option Read is mapped to the reverse strand of the reference. For your reverse reads you choose under Require that these flags are set the same option Read is mapped to the reverse strand of the reference.

Have a good day and best wishes,
Florian

1 Like

Thank you so much! I’ll try it !