On Thursday 22 December 2005 09:45, Sneha joshi wrote:
> I am working on chemical similarity. I am interested in finding out
> followings:
> (1) how atom numbers are assigned to each  atom

Atom numbers are counted as the number they have in the array, so implictely 
stored... Use the methods getAtomNumber(Atom) and getBondNumber(Bond) in
AtomContainer to get those numbers [1].

Alternatively, you might set object IDs, using Atom.setID() and Bond.setID().

> (2) how aromatic flags 

With setFlag(CDKConstants.ISAROMATIC, true), for Bond and Atom.

> and ring size are set?

I assume you're referring here to a atomic property like 
is_part_of_ring_of_size... If so, you can use something like:

Atom.setProperty(CDKConstants.PART_OF_RING_OF_SIZE, new Integer(5));

and later retrieve it with:

Atom.getProperty(CDKConstants.PART_OF_RING_OF_SIZE);

There is no special field for this kind of information, so the general 
mechanism of get/setProperty() is used.

> 3) How to find out atoms connected by partial double bond

If you mean converting systems with 1.5 type bonds top alternating 1,2 bond 
systems, then:

SaturationChecker.saturate().

The the algorithm is not fool-proof. Use with care. This algorithm will be 
rewritten next year.

If you meant something else, please clarify.

> 4) what do individual entries in atom container mean and how are they
> assigned

:) The output of toString(), as below, is really for debugging purposes. You 
can better convert it to CML if you want something human readable.

> Atom(7804298, O, H:0, SP:0, 2D:[null], 3D:[(15.161, 1.1021, 2.1441)],
> Fract3D:[n
> ull], C:0.0, FC:0, AtomType(50, MBO:0.0, BOS:0.0, FC:0, H:0, NC:0, CR:0.0,
> VDWR:
> 0.0, EV:0, A:false, D:false, ChemicalGroupCode:0, RingSize:0,
> Aromatic:false, Sp
> hericalDescriptor:null, Isotope(16, EM:15.9949146, AB:100.0, Element(O,
> ID:50, A
> N:8))))

The meaning is best explained by matching it with the source code that 
generated it, note the use of the super() calls:

Atom.toString():
 StringBuffer stringContent = new StringBuffer();
 stringContent.append("Atom(");
 stringContent.append(this.hashCode()).append(", ");
 stringContent.append(getSymbol()).append(", ");
 stringContent.append("H:").append(getHydrogenCount()).append(", ");
 stringContent.append("SP:").append(getStereoParity()).append(", ");
 stringContent.append("2D:[").append(getPoint2d()).append("], ");
 stringContent.append("3D:[").append(getPoint3d()).append("], ");
 stringContent.append("Fract3D:[").append(getFractionalPoint3d()).append("], 
");
 stringContent.append("C:").append(getCharge()).append(", ");
 stringContent.append("FC:").append(getFormalCharge());
 stringContent.append(", ").append(super.toString());
 stringContent.append(")");
 return stringContent.toString();

AtomType.toString():
 StringBuffer resultString = new StringBuffer();
 resultString.append("AtomType(");
 resultString.append(getAtomTypeName()).append(", ");
 resultString.append("MBO:").append(getMaxBondOrder()).append(", ");
 resultString.append("BOS:").append(getBondOrderSum()).append(", ");
 resultString.append("FC:").append(getFormalCharge()).append(", ");
 resultString.append("H:").append(getHybridization()).append(", ");
 resultString.append("NC:").append(getFormalNeighbourCount()).append(", ");
 resultString.append("CR:").append(getCovalentRadius()).append(", ");
 resultString.append("VDWR:").append(getVanderwaalsRadius()).append(", ");
 resultString.append("EV:").append(getValency()).append(", ");
 resultString.append(super.toString());
 resultString.append(")");
 return resultString.toString();
    }

Isotope.toString():
 StringBuffer resultString = new StringBuffer();
 resultString.append("Isotope("); resultString.append(massNumber);
 resultString.append(", EM:"); resultString.append(exactMass);
 resultString.append(", AB:"); resultString.append(naturalAbundance);
 resultString.append(", "); resultString.append(super.toString());
 resultString.append(")");
 return resultString.toString();
 
Element.toString():
 StringBuffer resultString = new StringBuffer();
 resultString.append("Element(");
 resultString.append(getSymbol());
 resultString.append(", ID:"); resultString.append(getID());
 resultString.append(", AN:"); resultString.append(getAtomicNumber());
 resultString.append(")");
 return resultString.toString();

Regards,

and happy new year!

Egon

1.http://cdk.sourceforge.net/api/org/openscience/cdk/interfaces/AtomContainer.html

-- 
Egon Willighagen
http://chem-bla-ics.blogspot.com/


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to