Skip to main content

transformation between smiles and bsmiles

Project description

transformation between smiles and bsmiles

All chemical molecules can be represented by SMILES notation. But from SMILES notation, can not seperate molecules into fragments directly. Here I create a new notation called BSMILES which is easier to check each fragment.

Example:

SMILES notation: O(=C1CSC(c4ccccn4)N(c2ccc3c(cccc3)c2)1)

BSMILES notation: O{0=C!CSCN!{4c%ccc!c(cccc!)c%}{3c!ccccn!}}

how to convert SMILES to BSMILES

from BSMILES.BSMILES import encode 

 bsmiles = encode(smiles)

how to convert BSMILES back to SMILES

from BSMILES.B_to_smiles import convertB 

smiles = convertB(bsmiles)

how to get fragments from BSMILES notation

  1. input one file then got one output file from BSMILES.B_to_smiles import bsmiles_to_frag
inputfile_name ="bsmiles"
outputfile_name="fragment"
bsmiles_to_frag(inputfile_name,outputfile_name)
  1. input one bsmiles string return two vectors, the second one contains fragments. from BSMILES.B_to_smiles import getFragments
bsmiles = "any_kind_of_bsmiles"
visited = []#contain all unique fragments from bsmiles
fragments = []#contain all fragments
visited,bsmiles = getFragments(visited,bsmiles)

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

BSMILES-0.0.1.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

BSMILES-0.0.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file BSMILES-0.0.1.tar.gz.

File metadata

  • Download URL: BSMILES-0.0.1.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

File hashes

Hashes for BSMILES-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f87fc6bbda6158273975b6e339635448999f1f303bcc99ddd87bb4767ee4bf94
MD5 2d6bbf1f7751c0950ee6ae9636bbaa5d
BLAKE2b-256 13f6d4427600b8e0ad2335b6368e1b314fdc8fb3c56de5153c6f296e33a543dc

See more details on using hashes here.

File details

Details for the file BSMILES-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: BSMILES-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

File hashes

Hashes for BSMILES-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 281f80dda05cada7966631242618576439ffbd668ce1c9dfc85727b408f6d1d2
MD5 cab41ca06081929f056daa08add713a1
BLAKE2b-256 faacb34ad877f683bf30b3e131b53a2a8b88a3aeed3464aae15f18fd73304ee8

See more details on using hashes here.

Supported by

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