在 R 中,如何根据另一个对象的类设置 S4 类
我需要从 Bioconductor 的 ShortRead 库创建一个 ShortReadQ 类型的对象。
ShortReadQ 'signature(sread = "DNAStringSet", quality =
"QualityScore", id = "BStringSet")'
质量槽需要是一个继承自 QualityScore 的对象,我可以轻松地从我希望模拟的另一个 ShortReadQ 对象中确定该对象。
> class(quality(anotherObject))
[1] "SFastqQuality"
attr(,"package")
[1] "ShortRead"
在构造函数参数中使用该信息(“SFastqQuality”)的最佳方法是什么?
newObject<-ShortReadQ(sread=...,
quality=SFastqQuality(...),
id=...)
I need to create an object of type ShortReadQ from Bioconductor's ShortRead library.
ShortReadQ 'signature(sread = "DNAStringSet", quality =
"QualityScore", id = "BStringSet")'
The quality slot needs to be an object inheriting from QualityScore, of which I can easily determine from another ShortReadQ object that I wish to emulate.
> class(quality(anotherObject))
[1] "SFastqQuality"
attr(,"package")
[1] "ShortRead"
What is the best way to use that information ("SFastqQuality") in the contructor argument?
newObject<-ShortReadQ(sread=...,
quality=SFastqQuality(...),
id=...)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是你想要的吗?
Does this do what you want?
您可能需要 get 函数:
You might want the get function:
感谢您的回复。他们引导我找到了有效的解决方案
thanks for your responses. they lead me to a solution that works