Can't get end value of an IRange in R/Bioconductor

穿精又带淫゛_ 提交于 2020-01-05 10:35:47

问题


I am new to the IRanges package and am having trouble getting the end value of an IRange. I am able to get the start and width values with no problem, which has me a bit baffled, and my case/spelling of end match the header line. Has anyone else run into this or can please spot what I am doing wrong? Thanks and it is much appreciated!

library(IRanges)
> test=IRanges(100645,100664)

> test
IRanges of length 1
 start    end width
[1] 100645 100664    20

> test@start
[1] 100645

> test@width
[1] 20

> test@end
Error: no slot of name "end" for this object of class "IRanges"

回答1:


The easiest manner to access the fields of an IRange object is using the helper functions: start(),end() and width(). These will return a vector with all the elements of the corresponding column.




回答2:


No experience with the package, but based on ?"class:Ranges":

end(test$ranges[1])

It would also help in the future to provide reproducible sample data.



来源:https://stackoverflow.com/questions/9746637/cant-get-end-value-of-an-irange-in-r-bioconductor

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!