This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Extract tview / view / mpileup as CSV / TVS files, where each read is organized by columns and rows (one readout nucleotide per cell)

Hi,

I'm looking to extract reads from a .cram file to a .csv/.tvs such that the data is organized just as a tview command or in the IGV. The problem is that mpileup flattens the reads, so it is hard to "rebuild" or know which readout is associated with it's specific read strand.

Here you see the mpileup, where column 5 has the flattened reads aligned to the left of the cell. Therefore it is difficult to know which read strand that "c" at the bottom is associated with.

In IGV or Samtools tview, however, the data is formated with individual nucleotide reads organized by each read strand. this is how we would like to export the data to be formatted, where each nucleotide read out is given it's own cell, and properly organized with its associated "read string".

Example of mpileup reads - data not organized as we'd like Example IGV data organization - data organized as we'd like Example tview data organization - data organized as we'd like

Thanks!

sequencing samtools export

1 answer

I wrote sam2tsv : http://lindenb.github.io/jvarkit/Sam2Tsv.html

Amazing thank you - I will try it now!

Log in to answer this question.