first add
This commit is contained in:
17
utils/search.py
Normal file
17
utils/search.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import sqlite3
|
||||
|
||||
# 连接到数据库
|
||||
conn = sqlite3.connect('../test/data/35/data/chembl_35/chembl_35_sqlite/chembl_35.db')
|
||||
|
||||
# 查询抗生素相关分子 (修正版)
|
||||
query = """
|
||||
SELECT m.chembl_id, m.pref_name, cs.molecule_synonym
|
||||
FROM molecule_synonyms cs
|
||||
JOIN molecule_dictionary m ON cs.molregno = m.molregno
|
||||
WHERE cs.molecule_synonym LIKE '%antibiotic%'
|
||||
LIMIT 10
|
||||
"""
|
||||
|
||||
cursor = conn.execute(query)
|
||||
for row in cursor.fetchall():
|
||||
print(row)
|
||||
Reference in New Issue
Block a user