This is a test version of Biostars. For the public version, visit https://www.biostars.org.
mapping of drug names of excel sheet and tsv files

I have an excel sheet in which two sheets are available. I want the 2nd sheet to be compared with my drug tsv file. My 2nd sheet consists of drug names which i want to map with drug names of drug tsv file and print the drug ID from drug tsv file. As I am new to python, I ant understand how to write it in python. Please help me regarding this.

python

but it can join those files which are of same format.....not xlsx and tsv format. I need a script which can map both xlsx and tsv formats.

Can you add the first few lines of both files to the post?

Here is the excel sheet content: Drug PRIVIGEN

content of tsv file: drug chembl id privigen CHEMBL761

If it's something that needs to be done only once, you could just export 2nd sheet of the Excel document and perform mapping afterwards.

1 answer

  1. you need some library to read the Excel, check https://www.geeksforgeeks.org/reading-excel-file-using-python/
  2. Read the TSV file, load it in a List
  3. Open the Excel, read the drug name and ID, if the name is in your list, print the info

it's hard to code without seeing the input data format

Log in to answer this question.