Comments (4)
It would have been helpful if you split these into separate issues/support.
- In code you set it as an Attachment Point number on the pseudo atom, in CXSMILES:
*c1ccccc1 |$_AP1$|
, PseudoAtom.setAttachmentPoint number. - API point is set carbon visibility (DepictionGenerator.withCarbonSymbols()) - however that example is mixed with the benzenes you would need something custom. Explained better here: https://github.com/cdk/cdk/wiki/Standard-Generator#symbol-visibility
- If you have given in the correct input it will be correct. CXSMILES:
*c1ccccc1 |$A$|
C*.C*.C1=CC=CC=C1C=2C(C=CN3C2C=*C(=*3)C**)=O.C* |$;R2;;R3;;;;;;;;;;;;;;W;;A;;X;R4;;;R1$,m:0:5.4.9.8.7.6,2:7.6.5.4.9.8,24:4.9.8.7.6.5,Sg:n:20:m:ht| US 2007/0129372 (I)
- Please can you attach your code in text rather than a picture and will see what is going on.
from depict.
- might be you need
abrv.setContractOnHetero(false);
from depict.
Thank you very much for your reply, I have the following 3 questions:
Question 1.
in CXSMILES:*c1ccccc1 |$_AP1$|, PseudoAtom.setAttachmentPoint number. Can you give me an example, such as
CC(C)C1=C(C(=C(C(=C1[R6])[R7])[R8])[R9])[R10]
C1CN(CC(=O)N(C1)[R11])[R]
Question 2.
Explained better here as you said: https://github.com/cdk/cdk/wiki/Standard-Generator#symbol-visibility
CH3 can be generated, however, CH, CH2 do not know how to generate.
Question 3.
For example, in the figure below, given smiles: B[*], Chemdraw generates A and D from *. I don't know why, generally * refers to a specific atom.
from depict.
Question 1
In your first case it was encoded as iso-propyl, this is incorrect but common misconception. The attachment-point indication isn't formed from wavy bonds but is rather something explicitly for attachments.
Here's a screen shot from some sketch processing I did. https://www.nextmovesoftware.com/products/Praline_Sheffield2016.pdf
To input these I used CXSMILES: https://docs.chemaxon.com/display/docs/ChemAxon_Extended_SMILES_and_SMARTS_-_CXSMILES_and_CXSMARTS.html
*C1=C(C(=C(C(=C1[R6])[R7])[R8])[R9])[R10] |$_AP1$|
Actually the more correct way to encode this is:
*C1=C(C(=C(C(=C1*)*)*)*)* |$_AP1;;;;;;;R6;R7;R8;R9;R10$|
supporting [R1]
isn't official in SMILES.
Here's your other one
C1CN(CC(=O)N(C1)[R11])* |$;;;;;;;;;_AP1$|
Here's how you can do this progamatically:
SmilesParser smipar = new SmilesParser(SilentChemObjectBuilder.getInstance());
IAtomContainer mol = smipar.parseSmiles("*CCO");
((IPseudoAtom)mol.getAtom(0)).setAttachPointNum(1); // set _AP1
new DepictionGenerator().depict(mol).writeTo("/tmp/tmp.svg");
Question 2
CH3 can be generated, however, CH, CH2 do not know how to generate.
You can give it custom function:
SmilesParser smipar = new SmilesParser(SilentChemObjectBuilder.getInstance());
IAtomContainer mol = smipar.parseSmiles("*CCO");
DepictionGenerator depictgen = new DepictionGenerator();
depictgen = depictgen.withParam(StandardGenerator.Visibility.class,
new SymbolVisibility() {
@Override
public boolean visible(IAtom atom, List<IBond> neighbors, RendererModel model) {
return atom.getAtomicNumber() != 6 || atom.getIndex() == 1;
}
});
depictgen.depict(mol).writeTo("/tmp/tmp.svg");
depictgen = depictgen.withParam(StandardGenerator.Visibility.class,
new SymbolVisibility() {
@Override
public boolean visible(IAtom atom, List<IBond> neighbors, RendererModel model) {
return true; // everything
}
});
Question 3
In CDK * is *, not A. This is a display preference if you want you could change them all to the be this:
for (IAtom atom : mol.atoms()) {
// all unlabelled * => A
if (atom instanceof IPseudoAtom &&
((IPseudoAtom) atom).getLabel().equals("*") &&
((IPseudoAtom) atom).getAttachPointNum() == 0) {
((IPseudoAtom) atom).setLabel("A");
}
}
Adding an option for D
for [2H]
is certainly useful though
from depict.
Related Issues (20)
- How to disable the Thiele ring? HOT 7
- latest Docker fails with exception HOT 3
- CDK Depict website down? HOT 2
- missing stereo in CXSMILES depiction HOT 7
- relabelling of atoms is possible? HOT 4
- What are the query params? HOT 2
- Missing charges HOT 1
- atom numbering based on the InChI HOT 16
- thoughts about input of .sdf (version 3000) / extended stereochemistry HOT 2
- mark missing stereo HOT 3
- depict 1H-imidazole HOT 3
- bug in atom placement on for image render - specific smiles HOT 1
- Bug in depicting CXSMILES with Stereochemistry HOT 8
- www.simolecule.com does not work anymore HOT 2
- Flip should flip stereobond HOT 1
- feature request: generating multiple molecue structures within one image HOT 1
- Abbreviation of ketene
- fork me icon broken? HOT 1
- Aromatic display HOT 2
- CDK Depict website appears to be down HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from depict.