This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Basic Paired-End Sam Questions

I can't seem to find answers to 2 very basic questions.

For a paired-end sam, is there a separate sam line for mate1's and mate2's? If so, how do find the mate of a given sam line?

Thanks

sam paired-end

2 answers

Yes there will be two separate lines for each of the pairs. the mates will most likely have the same name in column 1 of the sam file (this is dependant on the data type and the aligner but this assumptions holds true for illumina data using aligners such as BWA or bowtie). You can use the flag field (column 2) to determine whether it is the first or the second in the pair.

You can, and often do, align mate data at the same time. That means pair1 and pair2 are in the same file.

If you want to get the pairs out, you can sort by mate pairs using samtools sort -n. Then the pairs will be in sequential order (assuming you didn't throw out any reads.).

Log in to answer this question.