Last time, I introduced how to get genetic information with PhytoMine-Python. This time, I found an easy way to get the gene sequence with PhytoMine-Python, so as a reminder.
This time, select Proteins.
This time, select Populus trichocarpa.
Then the Python code will come out. You can use this code in copy and paste. Since it is for python2, it is necessary to rewrite the print statement, but other than that, it seems that it can be used as it is.
The following is a modification to save the data of the specified plant species in csv format.
import pandas as pd
from intermine.webservice import Service
service = Service("https://phytozome.jgi.doe.gov/phytomine/service")
query = service.new_query("Protein")
query.add_constraint("organism.shortName", "=", "P. trichocarpa", code = "A")
seq_df = []
for row in query.rows(size=size):
seq_df.append(row)
seq_df = pd.DataFrame(seq_df,columns=row.keys())
seq_df.to_csv("20201005_Proteins_Top20.csv")
It will be saved like this.
Since this is a trial, I try to save only the first 20 genes, but in principle all genes should be able to be saved at once.
By the way, you can also select other languages from the pull-down menu.
Recommended Posts