我有一个包含以下内容的列表:
$
File1.bed
GRanges object with 3 ranges and 2 metadata columns:
seqnames ranges strand | name
<Rle> <IRanges> <Rle> | <character>
[1] chr1 [ 4, 6] + | TF1
[2] chr1 [ 9, 9] + | TF1
[3] chr1 [11, 12] - | TF1
-------
seqinfo: 2 sequences from an unspecified genome; no seqlengths
$
File1.bed
GRanges object with 3 ranges and 2 metadata columns:
seqnames ranges strand | name score
<Rle> <IRanges> <Rle> | <character> <numeric>
[1] chr2 [ 5, 60] + | TF4 0
[2] chr1 [21, 90] + | TF4 0
[3] chr2 [23, 30] - | TF4 0
-------
seqinfo: 3 sequences from an unspecified genome; no seqlengths
我想使这些列表成为一个列表,然后将它们连接成一个列表。 我正在使用
data_bed = unlist(as(data_bed, "GRangesList"))
但是这给我一个错误,因为农庄对象具有不同的列,因此无法串联成一列。有没有一种方法可以选择我需要的列,以便从我想要的列中创建一个列表?
有什么想法吗?
示例输入:
structure(list(`C:/Users/Documents/test_data/File1.bed` = <S4 object of class structure("GRanges", package = "GenomicRanges")>,
`C:/Users/Documents/test_data/File2.bed` = <S4 object of class structure("GRanges", package = "GenomicRanges")>), .Names = c("C:/Users/Documents/test_data/File1.bed",
"C:/Users/Documents/test_data/File2.bed"))