MEDIPS: Export rms values as Wiggle for visualization in UCSC
2
0
Entering edit mode
malbert1 • 0
@malbert1-6922
Last seen 9.1 years ago
Australia

Dear..

I would like to view pDensity, RPKM and rms values  in the UCSC genome browser. For generation of RPKM and pDensity Wiggle files I followed the 7.2 "Export Wiggle Files" workflow as described in the MEDIPS tutorial, which woked well. Next, I would like to also add rms values as a costum track, which I do not think is included in the MEDIPS.exportWIG function?:

Instead, I tried the following:

H1 <-  MEDIPS.createSet(file = "H1_Hg18_merged.bam", BSgenome = BSgenome, window_size = ws, extend = extend, shift = shift, uniq = uniq)

CS = MEDIPS.couplingVector(pattern = "CG", refObj = H1)

H1_results = MEDIPS.meth(MSet1 = H1, CSet = CS, CNV = F, MeDIP = T)

rms_H1 <- H1_results$H1_Hg18_merged.bam.rms

cat(rms_H1, sep = "\n", file = "rms_H1_WS200.txt", labels = NULL, append = FALSE)

# Subsequently, I opened up the rms_H1_WS200.txt file in a text editor and added the following (to the top):

track type=wiggle_0 name="H1_rms" description="" visibility=full autoScale=on co
lor=0,0,255 maxHeightPixels=100:50:20 graphType=bar priority=20
fixedStep chrom=chr1 start=1 step=200 span=200

Example:

track type=wiggle_0 name="H1_rms" description="" visibility=full autoScale=on co
lor=0,0,255 maxHeightPixels=100:50:20 graphType=bar priority=20
fixedStep chrom=chr1 start=1 step=200 span=200
0
0
0.2791065
0.06519054
0
0
0

 

# However, when I paste the URL (http://../rms_H1_WS200.wig) into UCSC, I get the following error:Error track load error (track name='ct_H1rms_3997'):
invalid double: NA

Is there a way to generate Wig files from rms values through the MEDIPS.exportWIG function? Or any advice on how to generate the rms Wig file in a similar manner to the RPKM and pDensity Wig files is much appreciated

Kindest,

Maria

 

 

 

 

medips • 1.5k views
ADD COMMENT
1
Entering edit mode
Lukas Chavez ▴ 570
@lukas-chavez-5781
Last seen 6.2 years ago
USA/La Jolla/UCSD
Dear Maria, unfortunately, export of rms values as custom tracks is currently not available in the MEDIPS.exportWIG() function. In the latest major MEDIPS update, we have largely neglected the sample wise CpG density normalization functionality and have focused on the improved differential coverage analysis between groups of samples. However, I will add the export function for rms values as a wiggle file to my ToDo list. The problem with your custom made file is that wiggle files in 'fixedStep' mode require a new 'fixedStep' line whenever data for the next chromosome starts. In your case, you indicate that you start at position 1 of chr1 but you will have to add this line for all other chromosomes as well. In the MEDIPS.exportWig() function I solve this problem by iterating over the chromosomes (please see also the complete code of the function for further details): (...) for(i in 1:length(chr_names)){ cat(paste("Writing data for ", chr_names[i], "...\n", sep="")) chr_header=paste("fixedStep chrom=", chr_names[i]," start=1 step=", window_size, " span=", window_size, sep="") write.table(chr_header, file=file, sep="", quote=F, row.names=F, col.names=F, append=T) temp_data=output_data[genome_chr==chr_names[i]] temp_data=temp_data[-length(temp_data)] write.table(temp_data, file=file, sep="", quote=F, row.names=F, col.names=F, append=T) } (...) Please note, when I create rpkm or CpG density wiggle files, I usually create MEDIPS SETs or COUPLING SETs with much smaller window sizes (usually 50bp) compared to the window size I use when testing for differential coverage (e.g. 300bp windows). All the best, Lukas On Mon, Oct 27, 2014 at 3:39 AM, malbert1 [bioc] <noreply@bioconductor.org> wrote: > Activity on a post you are following on support.bioconductor.org > > User malbert1 <https: support.bioconductor.org="" u="" 6922=""/> wrote Question: > MEDIPS: Export rms values as Wiggle for visualization in UCSC > <https: support.bioconductor.org="" p="" 62285=""/>: > > Dear.. > > I would like to view pDensity, RPKM and rms values in the UCSC genome > browser. For generation of RPKM and pDensity Wiggle files I followed the > 7.2 "Export Wiggle Files" workflow as described in the MEDIPS tutorial, > which woked well. Next, I would like to also add rms values as a costum > track, which I do not think is included in the MEDIPS.exportWIG function?: > > Instead, I tried the following: > > H1 <- MEDIPS.createSet(file = "H1_Hg18_merged.bam", BSgenome = BSgenome, > window_size = ws, extend = extend, shift = shift, uniq = uniq) > > CS = MEDIPS.couplingVector(pattern = "CG", refObj = H1) > > H1_results = MEDIPS.meth(MSet1 = H1, CSet = CS, CNV = F, MeDIP = T) > > rms_H1 <- H1_results$H1_Hg18_merged.bam.rms > > cat(rms_H1, sep = "\n", file = "rms_H1_WS200.txt", labels = NULL, append = > FALSE) > > # Subsequently, I opened up the rms_H1_WS200.txt file in a text editor and > added the following (to the top): > > track type=wiggle_0 name="H1_rms" description="" visibility=full > autoScale=on co > lor=0,0,255 maxHeightPixels=100:50:20 graphType=bar priority=20 > fixedStep chrom=chr1 start=1 step=200 span=200 > > Example: > > track type=wiggle_0 name="H1_rms" description="" visibility=full > autoScale=on co > lor=0,0,255 maxHeightPixels=100:50:20 graphType=bar priority=20 > fixedStep chrom=chr1 start=1 step=200 span=200 > 0 > 0 > 0.2791065 > 0.06519054 > 0 > 0 > 0 > > > > # However, when I paste the URL (http://../rms_H1_WS200.wig) into UCSC, I > get the following error: > *Error track load error (track name='ct_H1rms_3997'): invalid double: NA* > > Is there a way to generate Wig files from rms values through the > MEDIPS.exportWIG function? Or any advice on how to generate the rms Wig > file in a similar manner to the RPKM and pDensity Wig files is much > appreciated > > Kindest, > > Maria > > > > > > > > > > ------------------------------ > > You may reply via email or visit MEDIPS: Export rms values as Wiggle for visualization in UCSC >
ADD COMMENT
0
Entering edit mode
malbert1 • 0
@malbert1-6922
Last seen 9.1 years ago
Australia

Thank you Lukas, much appreciated!!

 

ADD COMMENT

Login before adding your answer.

Traffic: 608 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6