LLM_CT / app.py
wt123's picture
Add application file
560306d
raw
history blame
7.32 kB
import openai
import gradio as gr
openai.api_key = "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"
def get_completion_from_messages(messages, model="gpt-3.5-turbo", temperature=0):
response = openai.ChatCompletion.create(
model=model,
messages=messages,
temperature=temperature, # this is the degree of randomness of the model's output
)
return response.choices[0].message["content"]
def get_response(text):
messages = [
{'role':'system', 'content':'You are a document abstract information extractor, \
the user inputs a paper abstract, and you are responsible for extracting information. \
The information extracted is: Which genes or pathways are important in what state of the cancer (this state is usually a mutation in a driver gene). \
Do not show other information. \
When there is no such information, just return "No target"'},
{'role':'user', 'content':'Abstract: In non–small cell lung cancer (NSCLC), \
concurrent mutations in the oncogene KRAS and the tumor suppressor STK11 encoding the kinase LKB1 result in aggressive tumors \
prone to metastasis but with liabilities arising from reprogrammed metabolism. \
We previously demonstrated perturbed nitrogen metabolism and addiction to an unconventional pathway of pyrimidine synthesis in \
KRAS/LKB1 co-mutant (KL) cancer cells. To gain broader insight into metabolic reprogramming in NSCLC, \
we analyzed tumor metabolomes in a series of genetically engineered mouse models with oncogenic KRAS combined with mutations in LKB1 or p53. \
Metabolomics and gene expression profiling pointed towards an activation of the hexosamine biosynthesis pathway (HBP), \
another nitrogen-related metabolic pathway, in both mouse and human KL mutant tumors. KL cells contain high levels of HBP metabolites, \
higher flux through the HBP pathway and elevated dependence on the HBP enzyme Glutamine-Fructose-6-Phosphate Transaminase 2 (GFPT2). \
GFPT2 inhibition selectively reduced KL tumor cell growth in culture, xenografts and genetically-modified mice. \
Our results define a new metabolic vulnerability in KL tumors and provide a rationale for targeting GFPT2 in this aggressive NSCLC subtype.'},
{'role':'assistant', 'content':'Hexosamine biosynthesis pathway (HBP) and GFPT2 is important in KRAS/LKB1 co-mutant non–small cell lung cancer.'},
{'role':'user', 'content':'Abstract: Rationale: NRF2, a redox sensitive transcription factor, \
is up-regulated in head and neck squamous cell carcinoma (HNSCC), however, the associated impact and regulatory mechanisms remain unclear. \
Methods: The protein expression of NRF2 in HNSCC specimens was examined by IHC. The regulatory effect of c-MYC on NRF2 was validated by ChIP-qPCR, \
RT-qPCR and western blot. The impacts of NRF2 on malignant progression of HNSCC were determined through genetic manipulation and \
pharmacological inhibition in vitro and in vivo. The gene-set enrichment analysis (GSEA) on expression data of cDNA microarray combined with \
ChIP-qPCR, RT-qPCR, western blot, transwell migration/ invasion, cell proliferation and soft agar colony formation assays were used to \
investigate the regulatory mechanisms of NRF2. Results: NRF2 expression is positively correlated with malignant features of HNSCC. \
In addition, carcinogens, such as nicotine and arecoline, trigger c-MYC-directed NRF2 activation in HNSCC cells. \
NRF2 reprograms a wide range of cancer metabolic pathways and the most notable is the pentose phosphate pathway (PPP). \
Furthermore, glucose-6-phosphate dehydrogenase (G6PD) and transketolase (TKT) are critical downstream effectors of NRF2 that \
drive malignant progression of HNSCC; the coherently expressed signature NRF2/G6PD/TKT gene set is a potential prognostic \
biomarker for prediction of patient overall survival. Notably, G6PD- and TKT-regulated nucleotide biosynthesis is more important than \
redox regulation in determining malignant progression of HNSCC. Conclusions: Carcinogens trigger c-MYC-directed NRF2 activation. \
Over-activation of NRF2 promotes malignant progression of HNSCC through reprogramming G6PD- and TKT-mediated nucleotide biosynthesis. \
Targeting NRF2-directed cellular metabolism is an effective strategy for development of novel treatments for head and neck cancer.'},
{'role':'assistant', 'content':'NRF2, G6PD, and TKT is important in c-MYC up-regulated head and neck squamous cell carcinoma'}
]
messages.append({'role':'user', 'content':f"Abstract: {text}"})
response = get_completion_from_messages(messages, temperature=0)
return response
exp = [[
"Background: Triple-negative breast cancer (TNBC) is an aggressive subtype of breast cancer, \
characterized high rates of tumor protein 53 (p53) mutation and limited targeted therapies. Despite being clinically advantageous, \
direct targeting of mutant p53 has been largely ineffective. Therefore, we hypothesized that there exist pathways upon which p53-mutant \
TNBC cells rely upon for survival. Methods: In vitro and in silico drug screens were used to identify drugs that induced preferential death in \
p53 mutant breast cancer cells. The effects of the glutathione peroxidase 4 (GPX4) inhibitor ML-162 was deleniated using growth and death assays, \
both in vitro and in vivo. The mechanism of ML-162 induced death was determined using small molecule inhibition and genetic knockout. \
Results: High-throughput drug screening demonstrated that p53-mutant TNBCs are highly sensitive to peroxidase,cell cycle, cell division, and \
proteasome inhibitors. We further characterized the effect of the Glutathione . Peroxidase 4 (GPX4) inhibitor ML-162 and demonstrated that \
ML-162 induces preferential ferroptosis in p53-mutant, as compared to p53-wild type, TNBC cell lines. Treatment of p53-mutant xenografts with \
ML-162 suppressed tumor growth and increased lipid peroxidation in vivo. Testing multiple ferroptosis inducers demonstrated p53-missense mutant, \
and not p53-null or wild type cells, were more sensitive to ferroptosis, and that expression of mutant TP53 genes in p53-null cells sensitized \
cells to ML-162 treatment. Finally, we demonstrated that p53-mutation correlates with ALOX15 expression, which rescues ML-162 induced ferroptosis. \
Conclusions: This study demonstrates that p53-mutant TNBC cells have critical, unique survival pathways that can be effectively targeted. \
Our results illustrate the intrinsic vulnerability of p53-mutant TNBCs to ferroptosis, and highlight GPX4 as a promising target for the \
precision treatment of p53-mutant triple-negative breast cancer."
]]
def gradio():
input_text = gr.inputs.Textbox(label="Input paper abstract")
output_text = gr.outputs.Textbox(label="Extracted information")
interface = gr.Interface(fn=get_response, inputs=[input_text], outputs=output_text, examples=exp,
article="Example abstract from https://doi.org/10.21203/rs.3.rs-1547583/v1")
interface.launch()
if __name__ == '__main__':
gradio()