Entering edit mode
g.k
•
0
@gk-13275
Last seen 6.0 years ago
Hello, I have a list having granges as follows:
$File1.bed
GRanges object with 3 ranges and 2 metadata columns: seqnames ranges strand | name score <Rle> <IRanges> <Rle> | <character> <numeric> [1] chr1 [ 4, 6] + | TF1 0 [2] chr1 [ 9, 9] + | TF1 0 [3] chr1 [11, 12] - | TF1 0 ------- 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
I would like to make these lists one list, to concatenate them into one.
I tried doing
do.call("c",list)
but it would not work, however when I do the following it works:
c(list[[1]],list[[2]])
I am looking for a command that can concatenate them without me having to right it manually.
This is the final result I am looking for:
GRanges object with 6 ranges and 2 metadata columns: seqnames ranges strand | name score <Rle> <IRanges> <Rle> | <character> <numeric> [1] chr1 [ 4, 6] + | TF1 0 [2] chr1 [ 9, 9] + | TF1 0 [3] chr1 [11, 12] - | TF1 0 [4] chr1 [ 4, 6] + | TF4 0 [5] chr1 [ 9, 9] + | TF4 0 [6] chr1 [11, 12] - | TF4 0 ------- seqinfo: 2 sequences from an unspecified genome; no seqlengths
Any thoughts?
Or just use
unlist
.