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, 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='qwen-max')
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
Built Distribution
Hashes for AICelltype-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0ee6d49261299496e068b119e1952d38fff1e6630f8750c3a661bc55aab801f |
|
MD5 | 3aa4a51be64a949bfda43c42756f1412 |
|
BLAKE2b-256 | f3354b8cde985a39c2b22d14c55c0ef040c2c57895e562855e7956e5311f79da |