我想使用foverlaps()执行重叠范围联接。我遇到的一个问题是#include <iostream>
#include<string>
using namespace std;
int main()
{
char cod, cod_1, cod_2, cod_3; //If you want more than one character inputted for cod then //declare it as string or
// create multiple char variables to store the multiple
// variables in
string colour,material;
float abs,ord,r;
cout<<" CODUL : "; cin>> cod >> cod_1 >> cod_2 >> cod_3;
cout<<"\nCOLOUR : "; cin>>colour;
cout<<"\nMATERIAL : "; cin>>material;
cout<<"\nABSISA : "; cin>>abs;
cout<<"\nORDONATA : "; cin>>ord;
cout<<"\nRAZA : "; cin>>r;
system("pause");
return 0;
}
参数尚未实现,我只是注意到即使选择maxgap
时,合并也不会从要连接的两个表中返回所有值。看到这里:
type = "any", mult="all"
请注意,range_one =
data.table(
seqnames = rep(11, 8),
start = c(5617339, 5624476, 5625764, 5626567, 5629602, 5631375, 5631765, 5632007),
end = c(5617339, 5624476, 5625764, 5626567, 5629602, 5631375, 5631765, 5632007),
exon_rank = c(1:8)
)
range_one =
data.table(
seqnames = rep(11, 8),
start = c(5617886, 5624476, 5625764, 5626567, 5629602, 5631375, 5631765, 5632007),
end = c(5618144, 5624965, 5625859, 5626797, 5629624, 5631475, 5631791, 5634182),
exon_rank = c(1:8)
)
> range_one
seqnames start end exon_rank
1: 11 5617339 5617411 1
2: 11 5624476 5624965 2
3: 11 5625764 5625859 3
4: 11 5626567 5626797 4
5: 11 5629602 5629624 5
6: 11 5631375 5631475 6
7: 11 5631765 5631791 7
8: 11 5632007 5634182 8
> range_two
seqnames start end exon_rank
1: 11 5617886 5618144 1
2: 11 5624476 5624965 2
3: 11 5625764 5625859 3
4: 11 5626567 5626797 4
5: 11 5629602 5629624 5
6: 11 5631375 5631475 6
7: 11 5631765 5631791 7
8: 11 5632007 5634182 8
setkey(range_one, seqnames,start,end)
setkey(range_one, seqnames,start,end)
> foverlaps(range_one,range_two, type = "any", mult="all")
seqnames start end exon_rank i.start i.end i.exon_rank
1: 11 NA NA NA 5617339 5617411 1
2: 11 5624476 5624965 2 5624476 5624965 2
3: 11 5625764 5625859 3 5625764 5625859 3
4: 11 5626567 5626797 4 5626567 5626797 4
5: 11 5629602 5629624 5 5629602 5629624 5
6: 11 5631375 5631475 6 5631375 5631475 6
7: 11 5631765 5631791 7 5631765 5631791 7
8: 11 5632007 5634182 8 5632007 5634182 8
中的第一行如何在翻转结果中丢失。
我如何确定从两侧返回的所有范围,无论它们是完全重叠还是部分重叠,或者根本不重叠?