How to extract gene IDs from a tabular file based on a list of locus tags?
I have a file like:
GeneID Locus tag Protein name
839580 AT1G01010 NAC domain containing protein 1
839569 AT1G01020 ARV1 family protein
839569 AT1G01020 ARV1 family protein
839569 AT1G01020 ARV1 family protein
I also have a list of locus tags (arround 5000) which I want to extract from the entire file.
e.g if I want to extract gene Id and protein name of
AT1G01010
AT1G01020
I should get
839580 NAC domain containing protein 1
839569 ARV1 family protein
• 2,421 views
•
link
2 answers
If it is a data frame , you can simply use merge function
merge(file1 , file2, by.x = "Locus",by.y = "Locus",all.x = TRUE)
• 1 views
•
link
One approach using Unix tools:
$ grep -Fwf locusTags.txt geneAnnotations.txt > answer.txt
• 1 views
•
link
Log in to answer this question.