[Bioc-sig-seq] IRanges - start and width replacement methods for RangedData and RangesList

Nicolas Delhomme delhomme at embl.de
Mon Jul 13 15:28:19 CEST 2009


Hello Michael, everybody,

I had a need for the "start"  and "width" replacement methods for  
objects of type RangedData and RangesList. I've attached the method  
below for two reasons:

1) I'd like to have them checked by an expert eye (not that I end up  
messing up my analyses...)

2) depending on 1), they might actually be worthy for others :-)

setReplaceMethod("start","RangesList",function(x,check=TRUE,value){
   values <- split(value,space(x))
   for(i in seq(along=x)){
     start(x[[i]]) <- values[[i]]
   }
   x
})

setReplaceMethod("start","RangedData",function(x,check=TRUE,value){
   start(ranges(x))<-value
   return(x)
})

setReplaceMethod("width","RangesList",function(x,check=TRUE,value){
   values <- split(value,space(x))
   for(i in seq(along=x)){
     width(x[[i]]) <- values[[i]]
   }
   x
})

setReplaceMethod("width","RangedData",function(x,check=TRUE,value){
   width(ranges(x))<-value
   return(x)
})

Best,

Nico

---------------------------------------------------------------
Nicolas Delhomme

High Throughput Functional Genomics Center

European Molecular Biology Laboratory

Tel: +49 6221 387 8426
Email: nicolas.delhomme at embl.de
Meyerhofstrasse 1 - Postfach 10.2209
69102 Heidelberg, Germany



More information about the Bioc-sig-sequencing mailing list