From: Joerg K. W. <we...@in...> - 2004-10-18 16:31:52
|
Hi Thijs Beuming, i've never said it is not suitable, but you should not violate the internal conventions, which stores only 'C' and then assigns internal atom types, which can be transformed to Sybyl MOL2 atom types and vice versa. Of course it is more complicated to use JOElib and not a simple line parser, but there is also a much greater benefit. Or what is your goal when using JOElib? Here a more detailed explanation of what i mean (hava also a look at the tutorial): // please see examples under joelib.test 1. So take an single MOL2 file. 2. Open an input stream (file based or buffer based) 3. Load the molecule with joelib.io.types.SybylMol2 read(myMolObject); 4. access element and atom type: JOEElementTable.instance().getSymbol(atom.getAtomicNum()) // please see example joelib.test.TestMolecule Kind regards, Joerg > Hi Joerg, > > Consider the "atom lines" in a mol2 file. > > 1 C3 1.9861 2.4354 1.0036 C.3 1 FIP270 > 15.2100 > 2 C9 2.5381 1.1184 0.8986 C.3 0 <0> > 15.9400 > 3 C8 3.9341 1.2354 1.0666 C.3 0 <0> > 12.2200 > > I am just looking for a way to store the first two fields (i.e. 1 and > C3, or 2 and C9), i don't particularly care how its done, as long as I > can access them after later. > I understand that these fields have no real chemical meaning, and are > therefore not included in your class, but for my purpose they are > essential. If you suggest Joelib is not suitable for this then I'll try > something else. > > Thanks for your attention, > > Thijs > > On Oct 18, 2004, at 11:28 AM, Joerg K. Wegner wrote: > >> Hi Thijs Beuming, >> >> as far as i can see i can't recommend this way to proceed. >> You shouldn't mess around with the Atom class in this way. >> >> You should use joelib.io.types.SybylMol2 to read MOL2 entries, e.g. on >> your String block for one entry. >> >> As you can see an interl conversion is required, which will be applied >> automatically, when using this class. >> >> JOETypeTable ttab = JOETypeTable.instance(); >> ttab.setFromType("SYB"); >> ttab.setToType("ATN"); >> str1 = ttab.translate(str); >> atom.setAtomicNum(Integer.parseInt(str1)); >> ttab.setToType("INT"); >> str1 = ttab.translate(str); >> atom.setType(str1); >> >> Kind regards, Joerg >> >>> I am trying to modify the JOEAtom class to contain a field for the >>> atom name, >>> e.g by reading the second token of a sybylmol2 atom line with >>> atom.setAtomName(atom_name) in the SybylMol2 class >>> and the methods in JOEAtom. >>> public void setAtomName(String atomname) >>> { >>> _atomname = new String(atomname); >>> } >>> public String getAtomName() >>> { >>> return (_atomname); >>> } >>> I can't retrieve the stored names however when i iterate over the >>> atoms from a JOEMol: >>> for(int i=1;i<=mol.numAtoms();i++){ >>> JOEAtom atom = mol.getAtom(i); >>> System.out.println(atom.getAtomName()); >>> } >>> all the names are null. >>> Any suggestions? >>> Thanks. >>> --- >>> Thijs Beuming >>> Harel Weinstein Lab >>> Department of Physiology & Biophysics >>> Weill Medical College of Cornell University >>> 1300 York Avenue, Box 75 >>> New York, NY 10021 >>> Tel: (212) 7466539 >>> Fax: (212) 746-6361 >>> th...@me... >>> ------------------------------------------------------- >>> This SF.net email is sponsored by: IT Product Guide on ITManagersJournal >>> Use IT products in your business? Tell us what you think of them. >>> Give us >>> Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find >>> out more >>> http://productguide.itmanagersjournal.com/guidepromo.tmpl >>> _______________________________________________ >>> Joelib-help mailing list >>> Joe...@li... >>> https://lists.sourceforge.net/lists/listinfo/joelib-help >> >> >> >> -- >> Dipl. Chem. Joerg K. Wegner >> Center of Bioinformatics Tuebingen (ZBIT) >> Department of Computer Architecture >> Univ. Tuebingen, Sand 1, D-72076 Tuebingen, Germany >> Phone: (+49/0) 7071 29 78970 >> Fax: (+49/0) 7071 29 5091 >> E-Mail: mailto:we...@in... >> WWW: http://www-ra.informatik.uni-tuebingen.de >> -- >> Never mistake motion for action. >> (E. Hemingway) >> >> Never mistake action for meaningful action. >> (Hugo Kubinyi,2004) >> >> > --- > Thijs Beuming > Harel Weinstein Lab > Department of Physiology & Biophysics > Weill Medical College of Cornell University > 1300 York Avenue, Box 75 > New York, NY 10021 > Tel: (212) 7466539 > Fax: (212) 746-6361 > th...@me... > > -- Dipl. Chem. Joerg K. Wegner Center of Bioinformatics Tuebingen (ZBIT) Department of Computer Architecture Univ. Tuebingen, Sand 1, D-72076 Tuebingen, Germany Phone: (+49/0) 7071 29 78970 Fax: (+49/0) 7071 29 5091 E-Mail: mailto:we...@in... WWW: http://www-ra.informatik.uni-tuebingen.de -- Never mistake motion for action. (E. Hemingway) Never mistake action for meaningful action. (Hugo Kubinyi,2004) |