0

空の GRanges (パッケージ GenomicRanges から) オブジェクト dynamicall を作成したいと考えています。

opt1 と opt2 という 2 つの代替オプションがある場合、次のように静的に記述できます。

library(GenomicRanges)
GRanges(seqnames=NULL,ranges=NULL,strand=NULL, opt1=NULL, opt2=NULL)

問題は、「GRanges オブジェクトを動的に作成するにはどうすればよいか」です。より具体的には、「次の機能○○は可能ですか?」:

opts=c('opt1','opt2','opt3')
#' dynamic create blank GRanges with optional fields
#' @param opts, a vector containing the colnames of "mcols" of GRanges object
#' @return  blank GRanges object
functionXX<-function(opts){
   //todo:
}

ありがとう!

4

1 に答える 1