I have a dataframe where the first column is Gene ID and then each subsequent column are numerical values showing gene expression level (TP1, TP2 ...TPn). I would like to pick out only rows which match a second list of genes and create an output dataframe with only that data. Below is an example of what my input and output data would look like.
Dataframe1
Gene ID | TP1 | TP2 | ...TPn |
---|---|---|---|
Gene_1 | 121 | 243 | 415 |
Gene_2 | 45 | 23 | 52 |
Gene_3 | 284 | 392 | 482 |
Gene_4 | 83 | 72 | 90 |
Dataframe2
Gene ID |
---|
Gene_1 |
Gene_3 |
Dataframe_Output
Gene ID | TP1 | TP2 | ...TPn |
---|---|---|---|
Gene_1 | 121 | 243 | 415 |
Gene_3 | 284 | 392 | 482 |