From: Joerg K. W. <we...@in...> - 2004-10-18 15:25:23
|
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) |