Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • kayleighepps
    Junior Member
    • Nov 2013
    • 6

    BedGraphtoBigWig - UCSC

    Hi

    Would anybody be able to kindly provide step-by-step instructions for using the UCSC pre-compiled utilities such as the bedGraphtoBigWig tool? I am utilising Mac OS 10.9. I am not familiar much with terminal nor running such things and do not have any idea where to begin. Thank you very much!

    - Kayleigh
  • GenoMax
    Senior Member
    • Feb 2008
    • 7142

    #2
    Here is a simple guide to Mac Terminal (there are probably others): http://blog.teamtreehouse.com/introd...x-command-line

    If you have not done this then that would be the first thing to do: http://seqanswers.com/forums/showthread.php?t=33389

    Look at the second step to see how to run the program: http://www.biostars.org/p/42844/

    Comment

    • Hparker
      Member
      • Dec 2014
      • 42

      #3
      I am also using the bedGraphToBigWig tool: I am trying to create files I can upload to IGV to view the level of methylaiton. But when I carry out this command I get an error:

      error: Expecting number field 2 line 1 of sample_CO115.bedGraph, got "start"

      This is the code I used in R:

      sample_CO115 <- read.table("sample_CO115.cov")
      col <- c("chr", "start", "end", "meth_perc", "m", "u")
      colnames(sample_CO115) <- col
      sample_CO115$m <- NULL
      sample_CO115$u <- NULL
      write.table(mm2, file = "sample_CO115.bedGraph")

      $ bedGraphToBigWig sample_CO115.bedGraph hg19.chrom.sizes CO115.bw

      I removed the column headings but this did not work...

      Please advise if you know how I can solve this!
      Last edited by Hparker; 07-01-2015, 01:03 AM.

      Comment

      • GenoMax
        Senior Member
        • Feb 2008
        • 7142

        #4
        BedGraph format files should look like: http://genome.ucsc.edu/goldenpath/help/bedgraph.html

        Can you post 10 lines from your BedGraph file?

        Code:
        $ head -10 sample_CO115.bedGraph

        Comment

        • Hparker
          Member
          • Dec 2014
          • 42

          #5
          BedGraph file:

          "V1" "V2" "V3" "V4"
          "1" "chr11" " 104895" " 104895" "100.00000000"
          "2" "chr11" " 123115" " 123115" " 0.00000000"
          "3" "chr11" " 125931" " 125931" "100.00000000"
          "4" "chr11" " 128336" " 128336" "100.00000000"
          "5" "chr11" " 128338" " 128338" "100.00000000"
          "6" "chr11" " 128379" " 128379" " 0.00000000"
          "7" "chr11" " 128385" " 128385" "100.00000000"
          "8" "chr11" " 128404" " 128404" "100.00000000"
          "9" "chr11" " 128430" " 128430" "100.00000000"

          Comment

          • Hparker
            Member
            • Dec 2014
            • 42

            #6
            I tired removing the column headings which is why now they are labelled as V1, V2...

            Comment

            • Michael.Ante
              Senior Member
              • Oct 2011
              • 127

              #7
              Hi Hparker,
              you can modify your output from R:
              Code:
              write.table(mm2, file = "sample_CO115.bedGraph", [COLOR="Red"]row.names=F, col.names=F, quote=F, seq="\t"[/COLOR])
              BTW, why do you call mm2? Shouldn't it be "sample_CO115"?
              Cheers,
              Michael
              Last edited by Michael.Ante; 07-01-2015, 04:50 AM.

              Comment

              • GenoMax
                Senior Member
                • Feb 2008
                • 7142

                #8
                Also "track type=bedGraph" declaration is minimally required for bedGraph files. Your file seems to lack that and would likely need to be added.
                Last edited by GenoMax; 07-06-2015, 03:48 AM. Reason: amended the type declaration

                Comment

                • Hparker
                  Member
                  • Dec 2014
                  • 42

                  #9
                  Thank you for your replies.

                  Yes it should be sample_CO115, but I had used the code for something else.

                  I have used:

                  write.table(sample_CO115, file = "sample_CO115.bedGraph", type=bedGraph,
                  row.names=F, col.names=F, quote=F, seq="\t")

                  ..but I get this error:

                  Error in write.table(sample_CO115, file = "sample_CO115.bedGraph", type = bedGraph, : unused arguments (type = bedGraph, seq = "\t")

                  Comment

                  • Michael.Ante
                    Senior Member
                    • Oct 2011
                    • 127

                    #10
                    Sorry, it has to be sep="\t" (for field-separator).

                    Comment

                    • GenoMax
                      Senior Member
                      • Feb 2008
                      • 7142

                      #11
                      There was a typo in @Michael.Ante's code
                      Code:
                      write.table(sample_CO115, file = "sample_CO115.bedGraph", row.names=F, col.names=F, quote=F, sep="\t")
                      Add the "type=bedGraph" line afterwards along with any additional lines (e.g. browser intervals etc) using an editor.

                      or you could do this

                      Code:
                      cat('track type=bedGraph\n', file='sample_CO115.bedGraph', append=F)
                      write.table(sample_CO115, file = "sample_CO115.bedGraph", append=T, row.names=F, col.names=F, quote=F, sep="\t")
                      Last edited by GenoMax; 07-06-2015, 03:48 AM.

                      Comment

                      • Hparker
                        Member
                        • Dec 2014
                        • 42

                        #12
                        Thank you both for your answers. I managed to write to a bedGraph file however when I now convert to a bigWig:

                        $ bedGraphToBigWig sample_CO115.bedGraph hg19.chrom.sizes CO115.bw

                        I get the following error:
                        type=bedGraphchr7 is not found in chromosome sizes file

                        I downloaded the chrom.sizes file using the following code:

                        $ wget http://hgdownload.cse.ucsc.edu/admin...etchChromSizes
                        $ chmod 777 fetchChromSizes
                        $ ./fetchChromSizes hg19 > hg19.chrom.sizes

                        Comment

                        • GenoMax
                          Senior Member
                          • Feb 2008
                          • 7142

                          #13
                          Can you show us what hg19.chrom.sizes contains?

                          Comment

                          • Hparker
                            Member
                            • Dec 2014
                            • 42

                            #14
                            chr1 249250621
                            chr2 243199373
                            chr3 198022430
                            chr4 191154276
                            chr5 180915260
                            chr6 171115067
                            chr7 159138663
                            chrX 155270560
                            chr8 146364022
                            chr9 141213431
                            chr10 135534747
                            chr11 135006516
                            chr12 133851895
                            chr13 115169878
                            chr14 107349540
                            chr15 102531392
                            chr16 90354753
                            chr17 81195210
                            chr18 78077248
                            chr20 63025520
                            chrY 59373566
                            chr19 59128983
                            chr22 51304566
                            chr21 48129895
                            chr6_ssto_hap7 4928567
                            chr6_mcf_hap5 4833398
                            chr6_cox_hap2 4795371
                            chr6_mann_hap4 4683263
                            chr6_apd_hap1 4622290

                            Comment

                            • GenoMax
                              Senior Member
                              • Feb 2008
                              • 7142

                              #15
                              Is your bedGraph file sorted?

                              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...
                                06-18-2026, 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

                              ad_right_rmr

                              Collapse

                              News

                              Collapse

                              Topics Statistics Last Post
                              Started by SEQadmin2, 06-26-2026, 11:10 AM
                              0 responses
                              15 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 06-17-2026, 06:09 AM
                              0 responses
                              49 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 06-09-2026, 11:58 AM
                              0 responses
                              107 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 06-05-2026, 10:09 AM
                              0 responses
                              125 views
                              0 reactions
                              Last Post SEQadmin2  
                              Working...