Help us understand the problem. What is going on with this article?

geneXplain platform の apiを利用してみた

More than 1 year has passed since last update.

geneXplain platformのapiを利用してみた

ドイツのgeneXplain社が開発しているgeneXplain platform はブラウザーを利用してライフサイエンス関連のデータ解析を行う商用のツール


これを実行するためにはgeneXplainのアカウントが必要で、無償のアカウントをgeneXplain platform registrationで登録する
Screen Shot 2019-02-22 at 18.01.30.png


GitHub にはR 用用 genexplain/genexplain-apiが記載されている


Python を利用してgeneXplain platformにアクセスしてみる


GitHubのQuick startではアプリケーションの一覧を取得する例が掲載されているので、これをそのまま実行してみる
プログラム上に記述したりすると面倒なので、geneXplain platformの username と passwordは環境変数で与えることにする

export gx_username="登録したユーザー名"
export gx_password="登録したパスワード"


$ python3 -m pip install requests
#!/bin/env python3
import requests
import sys
import os
import json
import pprint

server = ''
system = 'biouml'

class GeneXplain(object):
     """ GeneXplain object currently supports login and application list only.
        You must set environmental variable `gx_username` and `gx_password` at first.
    # api
    _LOGIN = 'web/login'
    _ANALYSIS_LIST = 'web/analysis/list'

    def __init__(self):
        self.session = None
        self.username = os.environ['gx_username']
        self.password = os.environ['gx_password']

    def login(self):
        url = os.path.join(server, system, GeneXplain._LOGIN)
        self.session = requests.Session()
        response = self.session.get(url, params={'username': self.username, 'password': self.password})
        if response.status_code != 200:
            raise ValueError(response.text)
        return response

    def list_applications(self):
        url = os.path.join(server, system, GeneXplain._ANALYSIS_LIST)
        response = self.session.get(url)
        data = response.json()
        if data['type'] != 0:
            raise ValueError
            applications = data['values']
        return applications

def main():
    gx = GeneXplain()
    response = gx.login()
    applications = gx.list_applications()

if __name__ == '__main__':


$ python3
['Data manipulation/Annotate diagram',
 'Data manipulation/Annotate table',
 'Data manipulation/Annotate track with genes',
 'Data manipulation/Composite module to proteins',
 'Data manipulation/Convert table',
 'Data manipulation/Convert table to track',
 'Statistical analysis/PCA',
 'Statistical analysis/Polynomial Regression analysis',
 'Statistical analysis/Table imputation',
 'Statistical analysis/Up and Down Identification',
 'Statistical analysis/Variance filter']



Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away