[BioC] using geneplotter with my own data
    Matthew Hobbs 
    mathob at gimr.garvan.unsw.edu.au
       
    Fri May 30 10:56:28 MEST 2003
    
    
  
Hi,
I am relatively new to R and BioConductor and despite looking at the help 
documents and vignettes am struggling with lots of things.  At the moment I 
am trying to do something useful with the 
cPlot function from geneplotter.  This runs OK when I follow the examples but 
these use data that I'm not interested in.  To use my own data for chromosome 
names and lengths and for gene names, positions and strands I gather I need 
to 
instantiate a chromLocation object.  When I try this (see below) I end up with 
a plot that consists only of a Y axis.  Please tell me where I'm going wrong!
Thanks,
Matthew
library(geneplotter)
# make a named vector of chromosome lengths:
chromLengths <- c(10000,5000)
names(chromLengths)<-c('X','Y')
# is strand indicated by sign of the position integer? I think so...
# make a named vector of gene positions on chromosome X:
Xvector<-c(100,200,-500,1000)
names(Xvector)<-c('gene1', 'gene2', 'gene3', 'gene4')
#  make a named vector of gene positions on chromosome Y:
Yvector<-c(11000,-2000)
names(Yvector)<-c('gene5', 'gene6')
# put these in a named list:
chromList <-list(Xvector,Yvector)
names(chromList) <- c('X','Y')
# make a chromLocation object:
mychromlocation <- buildChromClass('H. statisticiensis', 'made it all up', 
chromList, chromLengths)
# plot it:
cPlot(mychromlocation)
# yuk
-- 
----------------------------------------------------------------------
Matthew Hobbs
Garvan Institute of Medical Research
384 Victoria St            Ph   : (02) 9295 8327
Darlinghurst                
http://www.garvan.org.au        email:  m.hobbs at garvan.org.au
    
    
More information about the Bioconductor
mailing list