【发布时间】:2019-05-20 13:21:45
【问题描述】:
我目前正在处理包含染色体开始和结束位置的基因组数据。我想识别与另一个区域重叠的基因组区域并将它们折叠成新的基因组区域。
虽然我可以通过 GenomicRanges 包确定哪些区域重叠,但它会将我返回到需要过滤掉的数据。我想要的是删除 B 列中的数据不在 A 列中的行
data<- read.csv(textConnection(
"index,queryhits, subjecthits
1, 1, 530,
2, 2, 545,
3, 2, 799,
4, 2, 93,
5, 3, 415,
6, 4, 745,
7, 545,799,
8, 545,93,
9, 545,415,
10, 545,745,
"))
subjecthit 列中的值不应在 queryhit 列中。比如第2行queryhit列等于2,subjecthits列等于545,表示545和2号分组。
但是,queryhit 中的一个值可以是 545,我不想再计算一次,因为我要删除 queryhits 列中包含 545 值的行 预期输出是
index queryhits subjecthits
1 1 530
2 2 545
3 2 799
4 2 93
5 3 415
6 4 745
我的真实数据大约是 20000 行,所以我希望在 queryhit 和 subjecthits 列中都有一个唯一的数字。
感谢您的任何帮助或建议
【问题讨论】: