This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to extract the whole row from table based on a ID list?

I want to extract the whole row from a table (file2) based on the ID list file(file1).

For example.

File1:

SS1G_00002T0
SS1G_00026T0
SS1G_00027T0
SS1G_00029T0
SS1G_00037T0

File2:

fastaId.GeneId   ecNum      definition                                                            catalyticActivity
SS1G_00001T0     3.7.1.3    Kynureninase.                                                         L-kynurenine + H(2)O = anthranilate + L-alanine.
SS1G_00002T0     1.4.1.2    Glutamate dehydrogenase.                                              L-glutamate + H(2)O + NAD(+) = 2-oxoglutarate + NH(3) + NADH.
SS1G_00002T0     1.4.1.2    Glutamate dehydrogenase.                                              L-glutamate + H(2)O + NAD(+) = 2-oxoglutarate + NH(3) + NADH.
SS1G_00026T0     3.4.-.-    Acting on peptide bonds (peptide hydrolases).                         \N
SS1G_00026T0     3.4.-.-    Acting on peptide bonds (peptide hydrolases).                         \N
SS1G_00027T0     6.3.2.19   Ubiquitin--protein ligase.                                            ATP + ubiquitin + protein lysine = AMP + diphosphate + protein N-ubiquityllysine.
SS1G_00029T0     2.7.8.5    CDP-diacylglycerol--glycerol-3-phosphate 3-phosphatidyltransferase.   CDP-diacylglycerol + glycerol 3-phosphate = CMP + 3-(3-phosphatidyl)- glycerol 1-phosphate.
SS1G_00037T0     5.3.3.5    Cholestenol delta-isomerase.                                          5-alpha-cholest-7-en-3-beta-ol = 5-alpha-cholest-8-en-3-beta-ol.
SS1G_00044T0     3.1.27.1   Ribonuclease T2.                                                      Two-stage endonucleolytic cleavage to 3'-phosphomononucleotides and 3'-phosphooligonucleotides with 2',3'-cyclic phosphate intermediates.
r rna-seq blast

1 answer

I want to extract the whole row from a table (file2) based on the ID list file(file1).

grep -f file1 file2

Log in to answer this question.