Giter Site home page Giter Site logo

pikachu's People

Contributors

bthedragonmaster avatar friederikebiermann avatar obrink avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pikachu's Issues

Depiction options without function

After playing around with the attributes of drawing.Options(), I have noticed that some of them don't do anything:

  • ‘font_size_large’
  • ‘font_size_small’
  • ‘height’
  • ‘width’
  • All ‘kk_*’ attributes (although I am not sure what they are responsible for)
  • ‘background_color’
  • I am not sure what ‘draw_hydrogens’ does, but it does not draw hydrogen atoms
  • SMILES: [R12]C1RXZ=C([Z2])C1NC@(F)C(=O)O
    • ‘Draw_hydrogens’ = False:
      image
    • ‘Draw_hydrogens’ = True:
      image

Can Pikachu draw radicals?

It seems the radicals can not be generated from SIMLES, they just show the same as the close shell species:
for instance:
draw_smiles('CN(C=O)([CH2])') is the same as draw_smiles('CN(C=O)C'), no dot appears as a lone electron

SMILES parser fails

Hey there!

When reading SMILES strings using PIKAChU, @Mar-Gol ran into the following problem:

Minimal example for reproduction:


>>> smiles = 'CCOC1=CC2=C(C=C1)S(=O)C(=C2C3=CC=CC=C3)C(=O)C4=CC=CC=C4'
>>> from pikachu.general import read_smiles
>>> mol = read_smiles(smiles)

Expected behavior:

  • The structure is converted into PIKAChU's molecular representation.

Observed behavior:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Otto Brinkhaus\anaconda3\envs\RanDepict\lib\site-packages\pikachu\general.py", line 45, in read_smiles
    structure = smiles.smiles_to_structure()
  File "C:\Users\Otto Brinkhaus\anaconda3\envs\RanDepict\lib\site-packages\pikachu\smiles\smiles.py", line 496, in smiles_to_structure
    structure.refine_structure()
  File "C:\Users\Otto Brinkhaus\anaconda3\envs\RanDepict\lib\site-packages\pikachu\chem\structure.py", line 916, in refine_structure
    self.aromatic_cycles = self.find_aromatic_cycles()
  File "C:\Users\Otto Brinkhaus\anaconda3\envs\RanDepict\lib\site-packages\pikachu\chem\structure.py", line 781, in find_aromatic_cycles
    self.promote_lone_pairs_in_aromatic_cycles(aromatic_cycles)
  File "C:\Users\Otto Brinkhaus\anaconda3\envs\RanDepict\lib\site-packages\pikachu\chem\structure.py", line 731, in promote_lone_pairs_in_aromatic_cycles
    atom.promote_lone_pair_to_p_orbital()
  File "C:\Users\Otto Brinkhaus\anaconda3\envs\RanDepict\lib\site-packages\pikachu\chem\atom.py", line 512, in promote_lone_pair_to_p_orbital
    p_orbital = p_orbitals[-1]
IndexError: list index out of range
  • We used the latest version on pipy which we installed via pip install pikachu-chem.

I will build a work-around for our application for now, but I would appreciate your help a lot!
Thank you in advance!
Otto

Default Bond thickness

Hey,

Really nice python package. Excited to see further developments.
I tried the draw functionality of the package and found the default Bond thickness to be higher than most of the other toolkits. Probably setting a lower thickness would benefit most of the users.
SMILES: CN1C=NC2=C1C(=O)N(C(=O)N2C)C

pikachu
image

CDK-Depict
image

Do let me know once you have updated the documentation.

Kind regards,
Kohulan

Depiction of large structures makes Python crash on Windows

Hey there!

We have run into a problem with the depiction functionalities in PIKAChU. When depicting large molecules, Python simply crashes. We don't get an exception that can be caught or something like that. If I execute the code below in my Python shell, the Python shell simply closes.

Minimal example for the reproduction of the problem:

from pikachu.general import read_smiles
from pikachu.drawing import drawing

smiles = 'CC(=O)N[C@H]1[C@H]([C@H](O)[C@H](O)CO)O[C@@](O[C@H](CO)[C@@H](O)[C@@H]2O[C@@](O[C@H](CO)[C@@H](O)[C@@H]3O[C@@](O[C@H](CO)[C@@H](O)[C@@H]4O[C@@](O[C@H](CO)[C@@H](O)[C@@H]5O[C@@](O[C@H](CO)[C@@H](O)[C@@H]6O[C@@](O[C@H](CO)[C@@H](O)[C@@H]7O[C@@](O[C@H](CO)[C@@H](O)[C@@H]8O[C@@](O[C@H](CO)[C@@H](O)[C@@H]9O[C@@](O[C@H](CO)[C@@H](O)[C@@H]%10O[C@@](O[C@H](CO)[C@@H](O)[C@@H]%11O[C@@](O[C@H](CO)[C@@H](O)[C@@H]%12O[C@@](O[C@H](CO)[C@@H](O)[C@@H]%13O[C@@](O[C@H](CO)[C@@H](O)[C@@H]%14O[C@@](O)(C(=O)O)C[C@H](O)[C@H]%14NC(C)=O)(C(=O)O)C[C@H](O)[C@H]%13NC(C)=O)(C(=O)O)C[C@H](O)[C@H]%12NC(C)=O)(C(=O)O)C[C@H](O)[C@H]%11NC(C)=O)(C(=O)O)C[C@H](O)[C@H]%10NC(C)=O)(C(=O)O)C[C@H](O)[C@H]9NC(C)=O)(C(=O)O)C[C@H](O)[C@H]8NC(C)=O)(C(=O)O)C[C@H](O)[C@H]7NC(C)=O)(C(=O)O)C[C@H](O)[C@H]6NC(C)=O)(C(=O)O)C[C@H](O)[C@H]5NC(C)=O)(C(=O)O)C[C@H](O)[C@H]4NC(C)=O)(C(=O)O)C[C@H](O)[C@H]3NC(C)=O)(C(=O)O)C[C@H](O)[C@H]2NC(C)=O)(C(=O)O)C[C@@H]1O'

mol = read_smiles(smiles)
drawer = drawing.Drawer(mol)

Expected behaviour:

  • Instantiation of a Drawer object.

Observed behaviour:

  • Python crashes.

We will build a workaround and simply not use PIKAChU for large structures in our application, but I think it may make sense to look into this.

Have a nice day!
Otto

Save structure to file

Hello!

I met a problem while trying to save the structure with smile.general.smiles_to_molfile(). I would be grateful if you could help.

To check if there is an issue with the molecular, I also try to draw it with the NCBI online tool(https://pubchem.ncbi.nlm.nih.gov//edit3/index.html). The SMILE string, structure and error message are following.

CC1=C(/C=C/C(C)=C/C=C/C(C)=C/C=O)C(C)(C)CCC1.NC(=O)c1ccc[n+]([C@@H]2O[C@H](COP(=O)(O)OP(=O)(O)OC[C@H]3O[C@@H](n4cnc5c(N)ncnc54)[C@H](O)[C@@H]3O)[C@@H](O)[C@H]2O)c1.O

error message
structure

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.