Skip to main content

AICelltype: Annotate cell type through gpt-4 without openai key.

Project description

AICelltype

Installation

You can use pip install package directly.

pip install AICelltype

However I strongly recommend a virtual environment, if you do not have conda please install Miniconda first.

conda create -n aicelltype_env python=3.10.0
conda activate aicelltype_env
pip install AICelltype

Parameters

tissue_name
      In theory, tissue_name can be any type of biological tissue.
gene_list
      Identify one cell type for each row in gene_list.
model
      One model should be chosen from ['gpt4', 'qwen-max', 'ERNIE-4.0'].
      gpt4: annotate cell type through gpt4 (default);
      qwen-max: annotate cell type through ali qwen model, QWEN_KEY needed, refer to link for a key;
      ERNIE-4.0: annotate cell type through baidu qianfan model, API_KEY and SECRET_KEY needed, refer to link for them.

Usage

tissue_name = 'human prostate'
gene_lt = [
    ['KLK3', 'KRT8', 'KLK2', 'MSMB', 'ACPP', 'KLK1', 'KLK4'],
    ['MMRN1', 'FLT4', 'RELN', 'CCL21', 'PROX1', 'LYVE1'],
    ['CD69', 'IL7R', 'CD3D', 'CD3E', 'CD3G', 'ACTA2', 'MYO1B', 'ACTA2', 'ANPEP', 'PDGFRB', 'CSPG4'],
    ['DDX49', 'LOC105371196', 'MTND1P30', 'LOC105373682', 'TAGLN2', 'ZNF836', 'ZNF677', 'COILP1']
]

usage1:
    # gpt4 model
    from AICelltype import aicelltype
    cell_lt = aicelltype(tissue_name, gene_lt, model='gpt4')
    print(cell_lt)
output1:
    ['Prostate Epithelial Cells', 'Lymphatic Endothelial Cells', 'T Cell and Myofibroblast', 'Unknown Cell Type']  # In result, you can get a list with four cell types which have the same order with parameter gene_list.

usage2:
    # qwen-max model
    import os
    os.environ['QWEN_KEY'] = 'your QWEN_KEY'  # Add QWEN_KEY to environ, keep secret to yourself.
    
    from AICelltype import aicelltype
    cell_lt = aicelltype(tissue_name, gene_lt, model='qwen-max')
    print(cell_lt)
output2:
    ['Prostate secretory epithelial cell', 'Lymphatic endothelial cell', 'Immune cell (likely T-cell) and smooth muscle cell mixture', 'Unknown cell type']

usage3:
    # ERNIE-4.0 model
    import os
    os.environ['API_KEY'] = 'your AIP_KEY'  # Add API_KEY to environ, keep secret to yourself.
    os.environ['SECRET_KEY'] = 'your SECRET_KEY'  # Add SECRET_KEY to environ, keep secret to yourself.
    
    from AICelltype import aicelltype
    cell_lt = aicelltype(tissue_name, gene_lt, model='ERNIE-4.0')
    print(cell_lt)
output3:
    ['Prostate glandular cells (or Prostate epithelial cells)', 'Lymphatic endothelial cells', 'T-cells (or T-lymphocytes)', 'Unknown cell type (or Possibly cancer-associated cells or Stromal cells; needs further investigation)']  # This model give more explaination.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aicelltype-0.0.6.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

AICelltype-0.0.6-py3-none-any.whl (5.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page