PhytoMine-How to efficiently acquire gene sequence data of a specific plant species with Python

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.

1. Access PhytoMine's DataSources

スクリーンショット 2020-10-05 12.15.39.png

2. Access the link to the array you want to get

This time, select Proteins.

スクリーンショット 2020-10-05 12.15.44.png

3. Select the link of the plant species for which you want to get the sequence

This time, select Populus trichocarpa.

スクリーンショット 2020-10-05 12.18.35.png

4. Click Generate Python Code in the upper right

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.

スクリーンショット 2020-10-05 12.19.44.png

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.

スクリーンショット 2020-10-05 12.34.30.png

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.

スクリーンショット 2020-10-05 12.20.44.png

Recommended Posts

PhytoMine-How to efficiently acquire gene sequence data of a specific plant species with Python
[Introduction to Python] How to sort the contents of a list efficiently with list sort
[Introduction to Python] How to get the index of data with a for statement
A collection of competitive pro techniques to solve with Python
Detect objects of a specific color and size with Python
[Python] Extracts data frames that do not match a specific column with other data frames of Pandas
[Python] How to force a method of a subclass to do something specific
I tried to create a list of prime numbers with python
Introduction of "scikit-mobility", a library that allows you to easily analyze human flow data with Python (Part 1)
How to send a visualization image of data created in Python to Typetalk
Send an email to a specific email address with python without SMTP settings
Try to image the elevation data of the Geographical Survey Institute with Python
A beginner of machine learning tried to predict Arima Kinen with python
Try to solve a set problem of high school math with Python
Add a Python data source with Redash
Convert Excel data to JSON with python
Convert FX 1-minute data to 5-minute data with Python
Recommendation of Altair! Data visualization with Python
[Introduction to Data Scientists] Basics of Python ♬
Summary of how to read numerical data with python [CSV, NetCDF, Fortran binary]
I tried to make a simple mail sending application with tkinter of Python
How to get a list of files in the same directory with python
[AtCoder] Solve A problem of ABC101 ~ 169 with Python
How to read a CSV file with Python 2/3
Send a message to LINE with Python (LINE Notify)
Convert data with shape (number of data, 1) to (number of data,) with numpy.
I tried to make a function to retrieve data from database column by column using sql with sqlite3 of python [sqlite3, sql, pandas]
Acquire the data of Mitsubishi UFJ International Investment Trust eMAXIS with Python and make a graph with the beginning of the term as 100
Try to draw a life curve with python
I want to make a game with Python
Try to make a "cryptanalysis" cipher with Python
Solve A ~ D of yuki coder 247 with python
A story stuck with handling Python binary data
Folium: Visualize data on a map with Python
How to specify attributes with Mock of python
Decide to assign a laboratory with Python (fiction)
Steps to create a Twitter bot with python
Try to make a dihedral group with Python
Write CSV data to AWS-S3 with AWS-Lambda + Python
A well-prepared record of data analysis in Python
I want to write to a file with Python
A layman wants to get started with Python
Extract data from a web page with Python
Get a large amount of Starbucks Twitter data with python and try data analysis Part 1
Predicting the goal time of a full marathon with machine learning-③: Visualizing data with Python-
Get the value of a specific key in a list from the dictionary type in the list with Python
Try to create a battle record table with matplotlib from the data of "Schedule-kun"
How to identify the element with the smallest number of characters in a Python list?
Consolidate a large number of CSV files in folders with python (data without header)
[Python] I tried to automatically create a daily report of YWT with Outlook mail
Quickly create a Python data analysis dashboard with Streamlit and deploy it to AWS
A memo of misunderstanding when trying to load the entire self-made module with Python3
Python2 / numpy> Replace only a specific column in a file with column data from another file> numpy.c_
I tried scraping food recall information with Python to create a pandas data frame
How to convert / restore a string with [] in python
Summary of tools needed to analyze data in Python
[Python] How to draw a line graph with Matplotlib
How to scrape image data from flickr with python
Recommendation of building a portable Python environment with conda
Python Ver. To introduce WebPay with a little code.
Change IP settings to ACL of conoha with python