Hello, I have a dataframe with two columns in R, where each row represents a different genomic position. I am trying to obtain all the combinations of columns 1 and 2 that match with any of the reference alleles I have. Can someone help?
Like others, I am lost what you wish to achieve. If you are really talking about regular genomic positions and intervals / overlaps etc., have a look at GRanges and the respective set operations.
If you really just have strings (gene names or the like), the expand.grid() function might be useful. It should at least solve the "The idea is to be able to generate all the combinations" part of your problem.