Unconfigured Ad

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

    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
                                Nine Things a Sample Prep Scientist Thinks About Before Sequencing
                                by SEQadmin2


                                I’m not a sequencing expert. I’m a purification scientist who uses NGS to evaluate workflows my group develops. With this perspective, we think about the sample first and the NGS workflow second. The sequencer is an exceptionally honest reporter, but it can only report on what you give it, so whether you get clean, interpretable data from an NGS workflow is largely determined before you begin.


                                Here are nine questions we think about, in roughly the order they matter, before...
                                Today, 07:11 AM
                              • SEQadmin2
                                From Collection to Sequencing: Why Sample Preparation and Preservation Define Sequencing Data
                                by SEQadmin2


                                Data variability is still an issue in sequencing technologies despite the advances in reproducibility and accuracy of these platforms. But the problem does not originate in the sequencing itself, but in the previous steps, before the sample reaches the sequencer.


                                The first step is collection, followed by preservation and sample preparation for analysis. Most scientists overlook those steps, but not being careful might just be skewing the experiment’s results.
                                ...
                                06-02-2026, 10:05 AM
                              • SEQadmin2
                                Single-Cell Sequencing at an Inflection Point: Early Impacts of New Platforms and Emerging Trends
                                by SEQadmin2


                                With the launch of new single-cell sequencing platforms in 2026, the field stands at an exciting inflection point. This article surveys the most impactful advances in the field and discusses how they’re reshaping research in cancer, immunology, and beyond.


                                Introduction

                                Single-cell sequencing technologies have undergone remarkable advances over the past decade, transitioning from low-throughput experimental approaches to highly scalable platforms capable of...
                                05-22-2026, 06:42 AM

                              ad_right_rmr

                              Collapse

                              News

                              Collapse

                              Topics Statistics Last Post
                              Started by SEQadmin2, Yesterday, 06:09 AM
                              0 responses
                              16 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 06-09-2026, 11:58 AM
                              0 responses
                              37 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 06-05-2026, 10:09 AM
                              0 responses
                              43 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 06-04-2026, 08:59 AM
                              0 responses
                              49 views
                              0 reactions
                              Last Post SEQadmin2  
                              Working...