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: [email protected]
Meyerhofstrasse 1 - Postfach 10.2209
69102 Heidelberg, Germany

_______________________________________________
Bioc-sig-sequencing mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing

Reply via email to