问题描述
我想合并/合并两个文件,所以,如果在我的第一个文件的B列中的条目分为列B和C在我的第二个文件的范围内,输出将包含所有包含在这两个资料文件。
I would like to merge/combine two files, so that if an entry in column B of my first file falls into the range of columns B and C in my second file, the output will contain all of the information contained in both files.
这样的:
文件1
A B
rs10 23353
rs100 10000
rs234 54440
文件2
A B C
E235 20000 30000
E255 50000 60000
在哪里,因为23353瀑布20000到30000之间,并且54440瀑布输出文件应该是这样的50000和60000之间:
where, because 23353 falls between 20000 and 30000, and 54440 falls between 50000 and 60000 the output file would look like this:
rs 23353 E235 20000 30000
rs234 54440 E255 50000 60000
和RS100将被删除(从输出文件),因为它不会在文件2落入范围内的任何行的范围内。
and rs100 would be removed (from the output file) because it does not fall within a range of any row in file 2.
有什么建议?
感谢您!
推荐答案
更新:这个问题是不是在这里表示更复杂。该解决方案可以在这里找到: R中被合并范围 - 应用循环,由Bioconductor的中使用 GenomicRanges
包交付。非常有用的包!
UPDATE: This question was more complicated than indicated here. The solution can be found here: Merge by Range in R - Applying Loops, and is delivered by using the GenomicRanges
package in Bioconductor. Very useful package!
这篇关于匹配的合并范围中的R的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!