This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Can read count tables be converted to bam format files?

Once again, I consult the Biostars masters knowledge

I was wondering if raw read count tables such as:

chr  start end   readcount
chrX 16635 83737 9999

can be converted to bam file formatting. I know that bam files can be used to obtain read counts per selected features, so I was curious whether the other conversion was possible to use with diverse bioinformatic analysis pipelines.

Thanks!!

alignment bam

1 answer

Yes and no. Yes, you could hold that information in a BAM file. However, really no, since it wouldn't really be useful for anything beyond storing those exact counts (i.e., you couldn't reliably do anything else with the file). Going from alignments to counts is a lossy process, so going backward ends up creating files that only bear the vaguest of resemblances to the originals.

Thanks again Devon. What it's not clear to me is how to even translate read count tables to bam format if you don't have the original fastq or fasta files to produce the alignments. Thanks!

The simplest way would be to make fake reads containing Ns. They would start at the start position (e.g., chrX:16635) and their length would be whatever the regions length was (so about 67kb, in your example). For the line you showed, you'd just make 9999 such fake alignments.

Like I said, you can do it, but it's really not worthwhile. If you need a BAM file later then you should really just keep the BAM file produced in the alignment step.

Again thanks a lot Devon, I now see what you mean, and it is really not worthwhile. Best!

Log in to answer this question.