Hi Dario,

Thanks for the reply and the guidance. I think I'm almost there!

So, here is my sample data. I make the featureScores object as you suggested, but get an error when I use it with binPlot:

#################

## test data

## CpG probe info
probes <- data.frame(position=seq(1000, 3000, by = 200), chr = "chrX", strand = '-')

## Gene info
genes <- data.frame(chr = "chrX", start=c(2100, 1000,15000), end = c(3000, 2200,15900),
                    strand=c("+","-","+"))
symbol <- name <- paste("gene", 1:3, sep = '')
genes <- data.frame(name,genes,symbol)

## Methylation matrix
tmat <- matrix(rnorm(253),11,23) #  Methylation values for 11 probes across 23 samples
ids <- paste(probes[,'chr'],probes[,'position'],sep='_')
rownames(tmat) <- ids
colnames(tmat) <- paste('s',1:ncol(tmat),sep='')

print(head(genes,2))
print(head(probes,2))
print(tmat[1:2,1:3])

fsx <- featureScores(tmat,anno=genes,p.anno=probes,up=500,down=200,freq = 100)
names(fsx) <- "test"
class(fsx)

### binplot
omat <- data.frame(matrix(1:nrow(tmat)))
binPlots(fsx,order = omat,ord.label="",summarize="median",plot.type="line",lwd=2,n.bins=1)

##############

This gives an error:

> binPlots(fsx,order = omat,ord.label="",summarize="median",plot.type="line",lwd=2,n.bins=1)
Calculating intervals.
Splitting scores into bins.
Error in .Method(..., FUN = FUN, MoreArgs = MoreArgs, SIMPLIFY = SIMPLIFY,  : 
  zero-length inputs cannot be mixed with those of non-zero length


I also notice that the values of my fsx object have a different structure from the ones that are given in the example code for the binPlots documentation (also reproduced below). I feel that I need to 'tweak' something, but am not sure what!

thanks for the help!


 








###### Example from documentation of binPlots

# data(chr21genes)
# data(samplesList)  # Loads 'samples.list.subset'.
# data(expr)  # Loads 'expr.subset'.
# 
# fs <- featureScores(samples.list.subset, chr21genes, up = 5000, down = 1000, dist = "base", freq = 1000,
#                     s.width = 500)
# fs@scores <- list(tables(fs)[[2]] - tables(fs)[[4]])
# names(fs) <- "PC-Norm"
# 
# binPlots(fs, ordering = expr.subset, ord.label = "expression", plot.type = "line", n.bins = 4)
# binPlots(fs, ordering = expr.subset, ord.label = "expression", plot.type = "heatmap", n.bins = 8)







On Wednesday, November 20, 2013 9:00 PM, Dario Strbenac <dstr7320@uni.sydney.edu.au> wrote:
 
Hello Tim,

Ensure you are using a current version of Repitools. I checked the manual, and there is no mention of significancePlots. That function was renamed to profilePlots a while ago. Since you want to see all of the sites and are not testing a subset of them, I would use binPlots, and just give all the scores the same ID so they are in the same bin.

The code you use from the example is specific to microarrays. Since you know the coordinates of the CpG islands already, you can provide them as the p.anno argument to featureScores. The first argument is your matrix of values. The anno argument is your annotation of genes from UCSC. Also provide up and down values for how far away from the TSS to plot. Once you have a ScoresList object made by featureScores with this information, you can give that to binPlots.

--------------------------------------
Dario Strbenac
PhD Student
University of Sydney
Camperdown NSW 2050
Australia
	[[alternative HTML version deleted]]

