Modules
compound(id, image_format='2d', image_size='large', similarity_type='fastsimilarity_2d')
make a compound by cid, then get its information
Parameters
id: str or int compound cid or name (https://pubchem.ncbi.nlm.nih.gov/) image_format : str 3d, 2d (default: 2d) image_size : str small, large, 250x250 similarity_type : str fastsimilarity_2d, fastsimilarity_3d (default: fastsimilarity_2d)
Returns
object compound object with all properties
Source code in pubchemquery/app.py
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 | |
get_cid_by_inchi(inchi)
Get a cid (only one) by inchi
Parameters
inchi : str e.g. InChI=1S/C3H8/c1-3-2/h3H2,1-2H3
Returns
str cid
Source code in pubchemquery/app.py
get_cid_by_name(name)
Get a cid (only one) by name for instance, benzene cid
Parameters
name : str compound name (https://pubchem.ncbi.nlm.nih.gov/)
Returns
str cid
Source code in pubchemquery/app.py
get_cids_by_formula(formula)
Get all cids by formula for instance, CH4
Parameters
formula : str compound formula (https://pubchem.ncbi.nlm.nih.gov/)
Returns
str cid
Source code in pubchemquery/app.py
get_cids_by_name(name)
Get a cid list by name (if available) for instance, all cids have a hydroxyl functional group
Parameters
name : str compound name (https://pubchem.ncbi.nlm.nih.gov/)
Returns
list[str] cid list
Source code in pubchemquery/app.py
get_image_by_cid(cid, image_format='2d', image_size='large')
Get compound structure image
Parameters
cid : str,int compound id image_format : str 3d, 2d (default: 2d) image_size : str small, large, 250x250
Returns
PIL.Image cid image
Source code in pubchemquery/app.py
get_image_by_inchi(inchi, image_format='2d', image_size='large')
Get compound structure image by inchi
Parameters
inchi : str compound inchi image_format : str 3d, 2d (default: 2d) image_size : str small, large, 250x250
Returns
PIL.Image cid image
Source code in pubchemquery/app.py
get_image_by_name(name, image_format='2d', image_size='large')
Get compound structure image
Parameters
name : str compound name (IUPAC Name) image_format : str 3d, 2d (default: 2d) image_size : str small, large, 250x250
Returns
PIL.Image cid image
Source code in pubchemquery/app.py
get_similar_structures_cids_by_compound_id(val, compound_id='cid', similarity_type='fastsimilarity_2d')
Get similar structures by cid
Parameters
val : int or str compound id e.g. 297, 'C1=CC=CC=C1', 'InChI=1S/C6H6/c1-2-4-6-5-3-1/h1-6H' compound_id : str cid, SMILES, InChI (default: cid) similarity_type : str fastsimilarity_2d, fastsimilarity_3d (default: fastsimilarity_2d)
Returns
list[str] cid list
Source code in pubchemquery/app.py
get_structure_by_cid(cid, file_format='SDF', record_type='3d', save_file=False, file_dir='')
Get a compound structure by cid
Parameters
cid : int or str compound id file_format : str SDF, JSON record_type : str 3d, 2d save_file : bool the sdf file is saved file_dir : str directory path, if it is empty, the current directory is selected.
Returns
str sdf string
Source code in pubchemquery/app.py
get_structure_by_name(name, file_format='SDF', record_type='3d', save_file=False, file_dir='')
Get a compound structure by cid
Parameters
name : str compound id file_format : str SDF, JSON record_type : str 3d, 2d save_file : bool the sdf file is saved file_dir : str directory path, if it is empty, the current directory is selected.
Returns
str sdf string