Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pinki999
    Member
    • Oct 2010
    • 37

    #1

    SAM/BAM format to wiggle format

    Hi,

    Can anyone tell me how to convert SAM/BAM format to wiggle format?


    Regards,
    Pinki
  • shurjo
    Senior Member
    • Jan 2009
    • 132

    #2
    You could try the rsem-bam2wig utility from RSEM(http://deweylab.biostat.wisc.edu/rsem/docs.html).

    Comment

    • dawe
      Senior Member
      • Apr 2009
      • 258

      #3
      Originally posted by pinki999 View Post
      Hi,

      Can anyone tell me how to convert SAM/BAM format to wiggle format?
      Take a look here, examples 2 and 3.

      d

      Comment

      • ETHANol
        Senior Member
        • Feb 2010
        • 308

        #4
        If you are doing ChIP-seq, MACS writes you wig files as part of its output and is really simple to use. Some other software chip-seq software packages do the same.
        --------------
        Ethan

        Comment

        • mgogol
          Senior Member
          • Mar 2008
          • 197

          #5
          You can use bedtools to get a bedgraph:

          samtools sort sample.bam sample.sorted

          genomeCoverageBed -bg -ibam sample.sorted.bam -g chromsizes.txt > sample.bedgraph

          #on second look, dawe already said this, but the page was down for me.

          Comment

          • Thomas Doktor
            Senior Member
            • Apr 2009
            • 105

            #6
            Yet another way if you have a raw SAM file:
            TopHat has an undocumented tool, Wiggles, which will compute coverage of a SAM file and produce a bedgraph file (usage will tell you that it outputs a .wig file, but it really is a bedgraph file).

            Note that the Wiggles tool will probably be removed from the source of TopHat as it is no longer used by the TopHat pipeline.

            Comment

            • pinki999
              Member
              • Oct 2010
              • 37

              #7
              Hello Friends,

              Thank you for your valuable information.

              Comment

              • seq_GA
                Senior Member
                • Feb 2009
                • 124

                #8
                HiI tried using RSEM and I get segmentation fault. I tried using sorted bam file but still I get segmentation fault. Any clue on this? Thanks.

                Comment

                • seq_GA
                  Senior Member
                  • Feb 2009
                  • 124

                  #9
                  I also tried using bedtools as mentioned above.
                  Take a look here, examples 2 and 3.
                  Code:
                  Example 3
                  Summary:    A slightly different way (than ex. 2) to create BigWig files from BAM
                  Contributor: Assaf Gordon
                  Date:             09-July-2010
                  Tools used:  samtools, genomeCoverageBed, bedGraphToBigWig
                  More Information : http://cancan.cshl.edu/labmembers/gordon/files/viz2.pdf
                  ============================================================
                  Workflow:
                  # 1. Convert SAM to BAM
                  samtools view -S -b -o sample.bam sample.sam
                  # 2. Sort the BAM file
                  samtools sort sample.bam sample.sorted
                  # 3. Create BedGraph coverage file
                  genomeCoverageBed -bg -ibam sample.sorted.bam -g chromsizes.txt > sample.bedgraph
                  # 4. Convert the BedGraph file to BigWig
                  bedGraphToBigWig sample.bedgraph chromsizes.txt sample.bw
                  But the output sample.bw is not a human readable file. But I have ot tried uploading them into ucsc yet. Why is it so? Anyone has tried above steps? Thanks.

                  Comment

                  • adamdeluca
                    Member
                    • Jul 2010
                    • 95

                    #10
                    Originally posted by seq_GA View Post
                    But the output sample.bw is not a human readable file. But I have ot tried uploading them into ucsc yet. Why is it so? Anyone has tried above steps? Thanks.
                    bigwig is a binary format. UCSC has utilities for reading the file format, bigWigSummary bigWigToBedGraph etc.

                    Comment

                    • seq_GA
                      Senior Member
                      • Feb 2009
                      • 124

                      #11
                      Originally posted by adamdeluca View Post
                      bigwig is a binary format. UCSC has utilities for reading the file format, bigWigSummary bigWigToBedGraph etc.

                      Thanks for your response. I tried uploading into ucsc but i get the following error:

                      Code:
                      [COLOR="Red"][I][B]Error[/B][/I][/COLOR] [B]Can't read file: output.bw[/B]
                      I have uploaded the zipped test output.
                      Attached Files

                      Comment

                      • adamdeluca
                        Member
                        • Jul 2010
                        • 95

                        #12


                        bigWig files are to be linked from your ftp/http server. That way you don't need to transfer the whole file to UCSC, just what is needed for a given view. I don't think you can upload them to ucsc. bigWigInfo can parse the file you uploaded so it appears valid. You should be able to upload the bedGraph file from step 3.

                        Comment

                        • seq_GA
                          Senior Member
                          • Feb 2009
                          • 124

                          #13
                          Hi adamdeluca,
                          Thanks for your response. I have a bedgraph as below:
                          Code:
                          chr10   68271   68272   44
                          chr10   68272   68274   43
                          chr10   68274   68275   46
                          chr10   68275   68282   50
                          chr10   68282   68283   52
                          chr10   68283   68284   55
                          chr10   68284   68285   54
                          chr10   68285   68287   59
                          chr10   68287   68289   62
                          chr10   68289   68291   54
                          Is there any procedure to upload them into tracks. Because I want to see the density graph like. Thanks.

                          Comment

                          • repinementer
                            Member
                            • Dec 2009
                            • 80

                            #14
                            shouldn't you go for normalized reads visualization instead of raw reads(SAM/BAM) ?

                            Comment

                            • liguow
                              Member
                              • Apr 2009
                              • 12

                              #15
                              Originally posted by pinki999 View Post
                              Hi,

                              Can anyone tell me how to convert SAM/BAM format to wiggle format?


                              Regards,
                              Pinki
                              Surprisingly to find that this problem is still not well resolved.

                              I write a python program "bam2wig.py" that is specially designed for RNA-seq, so it works fine for spliced read, for both single-end and pair-end, for both strand-specific and non-strand specific RNA-seq data.

                              The input BAM file should be sorted and indexed using SamTools before hand.



                              Best,

                              Comment

                              Latest Articles

                              Collapse

                              • SEQadmin2
                                Beyond CRISPR/Cas9: Understand, Choose, and Use the Right Genome Editing Tool
                                by SEQadmin2



                                CRISPR/Cas9 sparked the gene editing revolution for both research and therapeutics.1 But this system still showed severe issues that limited its applications. The most prominent were the heavy reliance on PAM sequences, delivery limitations, double-stranded breaks that prompt unintended edits and cell death, and editing inefficiency (both in targeting and in knock-in reliability).

                                Despite this, “CRISPR helped turn genome editing from a specialized technique into
                                ...
                                07-31-2026, 11:01 AM
                              • SEQadmin2
                                Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
                                by SEQadmin2


                                Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

                                The systematic characterization of the human proteome has
                                ...
                                07-20-2026, 11:48 AM
                              • SEQadmin2
                                Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
                                by SEQadmin2



                                Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
                                ...
                                07-09-2026, 11:10 AM

                              ad_right_rmr

                              Collapse

                              News

                              Collapse

                              Topics Statistics Last Post
                              Started by SEQadmin2, 07-31-2026, 02:55 AM
                              0 responses
                              19 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 07-24-2026, 12:17 PM
                              0 responses
                              16 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 07-23-2026, 11:41 AM
                              0 responses
                              16 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 07-20-2026, 11:10 AM
                              0 responses
                              26 views
                              0 reactions
                              Last Post SEQadmin2  
                              Working...