Entering edit mode
7.3 years ago
saamar.rajput
▴
80
I have a text file "Interaction" with gene gene interactions in this format
a1cf apobec1
a1cf ep300
a2m actb
a2m ambp
a2m apoa1
a2m app
a2m bmp1
a2m cdc42
a2m f2
a2m ep300
The first column is the source and the second column is the target. Now I have another text file "SelectedGenes" with some selected genes, in it, in this form
a2m
ep300
apao1
alcf
I want to find the interaction of the genes present in the SelectedGenes file in the Interaction file in a way that interactions should have genes from SelectedGenes file in both the columns. The result should be
a2m ep300
a2m apoa1
a1cf ep300
This is a programming question. You put the R tag there so I assume you want a solution in R so go and learn about subsetting data frames in R.