This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Convert .bam.wig file to .bam file

Hello, I downloaded some files from GSE42880, as you can see from the original GEO data, the data are in .bam.wig.gz format. I am quite confused by this format and try to convert everything to .bam file. I searched online, every question I found are to convert .bam to .wig, and not the reverse way. Could anyone give me some suggestion? Thanks!

rna-seq

trying to convert wig to bam is like creating a cow from a steak

2 answers

If they are in WIG format, you cannot convert them back to BAM. WIG isn't just an alternate format that contains the same information as a BAM file, it's a format for representing the strength of a signal, such as the depth of reads, across the genome. It doesn't contain the information needed to convert back to a BAM file.

To illustrate Colin's point here are typical lines from a WIG file:

chrI 10 20 1.5
chrI 20 30 1.7
chrI 30 40 2.0
chrI 40 50 1.8

And these are typical lines from a BAM file:

ERR458493.552967    16  chrI    140 255 12M61232N37M2S  *   0   CCACTCGTTCACCAGGGCCGGCGGGCTGATCACTTTATCGTGCATCTTGGC BB?HHJJIGHHJIGIIJJIJGIJIJJIIIGHBJJJJJJHHHHFFDDDA1+B NH:i:1  HI:i:1  AS:i:41 nM:i:2
ERR458498.814362    0   chrI    1593    255 11M71474N40M    *   0   TTTCTACAAAGATTCTCTCACTTGTACAGAGGTGTCTTCCCATTCGTTTTC CCCFFFFFHHHHHJJGIJJJIJJIHJJJIJJJHHIJJJJJJJIJJJGIJIG NH:i:1  HI:i:1  AS:i:43 nM:i:2
ERR458496.427513    16  chrI    3782    255 51M *   0   0   CAGTAAAGGCTTGGTAGTAACCATAATATTACCCAGGTACGAAACGCTAAG JJJJIJJJJIJJJJJJJJJIJJJJJJJJGHBJJJJJJJHHHHHFFFFFCCB NH:i:1  HI:i:1  AS:i:50 nM:i:0
ERR458493.243111    0   chrI    3873    255 51M *   0   0   TGAAAATATTCTGAGGTAAAAGCCATTAAGGTCCAGATAACCAAGGGACAA @@<DDDDEH<<<CEFHAEIHHGGCHIGEEGG?@FF@<?ECGGGIIHIIIII NH:i:1  HI:i:1  AS:i:50 nM:i:0
ERR458494.816646    16  chrI    3972    255 51M *   0   0   TAATGAGCTAGTGATCCGGAAAGCTACTTTATGATGTTTCAAGGCCTGAAG @BBEBG;IGFDD@C:BHC<4A?94C<CH<EEEFABBFE<CDCBBD;DD=?1 NH:i:1  HI:i:1  AS:i:50 nM:i:0
ERR458497.736781    16  chrI    3976    255 51M *   0   0   GAGCTAGTGATCCGGAAAGCTACTTTATGATGTTTCAAGGCCTGAAGTTTG IJJJJJJJJJJJJJJJJJJJIIJJJJJJJJJJJJJJJJHHHHHFFFFFCCC NH:i:1  HI:i:1  AS:i:50 nM:i:0

As you can see, the WIG format simply contains some sort of value per (arbitrarily sized) windows of a given genome. These values can be, for example, normalized read coverages. BAM files, however, contain detailed information about every single read including a read's sequence, its alignment score and so on.

Looks like the original fastq files are available. Download, align and make your own BAM files.

Log in to answer this question.