Hi, Do you know how organic molecule viewers determine this? Do they try to work out the connectivity in the molecules? The internal reader has a very, very basic algorithm for connectivity. See __find_bonded_atoms() in generic_fns/structure/internal.py. This might have to be improved for organic molecules, as my assumptions are ok for standard biomolecules, but maybe do not hold for all organic molecules. So in reality, so we need to be able to determine 2 molecules within one file using connectivities, or a lack of, between two group of atoms?
Regards, Edward On 20 June 2011 10:48, Han Sun <[email protected]> wrote: > Hi Edward, > > That is the problem. In the xyz file you can probably have several > molecules, but you can not recognized that. There is no parameter to define > the molecule or the residue like in the pdb file. > > Best, > Han > > On Jun 20, 2011, at 10:41 AM, Edward d'Auvergne wrote: > >> Hi Han, >> >> It's now working, your ssh access :) I was just wondering why you had >> the statement: >> >> if mol_index==0: >> >> This could be problematic if you have multiple molecules in the XYZ >> file. Is it possible to have more than one in the format? >> >> Cheers, >> >> Edward >> >> >> >> On 20 June 2011 10:07, <[email protected]> wrote: >>> >>> Author: han87 >>> Date: Mon Jun 20 10:07:35 2011 >>> New Revision: 13121 >>> >>> URL: http://svn.gna.org/viewcvs/relax?rev=13121&view=rev >>> Log: >>> Debugging the user functions load_xyz() and test_read_xyz_internal2(). >>> >>> The user functions load_xyz() in 'generic_fns/structure/internal.py' and >>> test_read_xyz_internal2() in 'test_suite/system_tests/structure.py' have >>> been changed so that the molecule name can be read properly. >>> >>> Modified: >>> branches/xyz/generic_fns/structure/internal.py >>> branches/xyz/test_suite/system_tests/structure.py >>> >>> Modified: branches/xyz/generic_fns/structure/internal.py >>> URL: >>> http://svn.gna.org/viewcvs/relax/branches/xyz/generic_fns/structure/internal.py?rev=13121&r1=13120&r2=13121&view=diff >>> >>> ============================================================================== >>> --- branches/xyz/generic_fns/structure/internal.py (original) >>> +++ branches/xyz/generic_fns/structure/internal.py Mon Jun 20 10:07:35 >>> 2011 >>> @@ -853,8 +853,9 @@ >>> if set_mol_name: >>> new_mol_name.append(set_mol_name[mol_index]) >>> else: >>> - # Set the name to the file name plus the structure >>> number. >>> - new_mol_name.append(file_root(file) + '_mol' + >>> repr(mol_index)) >>> + if mol_index==0: >>> + #Set the name to the file name plus the structure >>> number. >>> + new_mol_name.append(file_root(file) + '_mol' + >>> repr(mol_index+1)) >>> >>> # Store the original mol number. >>> orig_mol_num.append(mol_index) >>> @@ -874,7 +875,8 @@ >>> >>> # Increment the model index. >>> model_index = model_index + 1 >>> - >>> + >>> + orig_mol_num=[0] >>> # Create the structural data data structures. >>> self.pack_structs(mol_conts, orig_model_num=orig_model_num, >>> set_model_num=set_model_num, orig_mol_num=orig_mol_num, >>> set_mol_name=new_mol_name, file_name=file, file_path=path) >>> >>> >>> Modified: branches/xyz/test_suite/system_tests/structure.py >>> URL: >>> http://svn.gna.org/viewcvs/relax/branches/xyz/test_suite/system_tests/structure.py?rev=13121&r1=13120&r2=13121&view=diff >>> >>> ============================================================================== >>> --- branches/xyz/test_suite/system_tests/structure.py (original) >>> +++ branches/xyz/test_suite/system_tests/structure.py Mon Jun 20 10:07:35 >>> 2011 >>> @@ -659,10 +659,10 @@ >>> >>> self.interpreter.structure.read_xyz(file='SSS-cluster4-new-test.xyz', >>> dir=path) >>> >>> # Test the molecule name. >>> - >>> self.assertEqual(cdp.structure.structural_data[0].mol[0].mol_name, >>> 'SSS-cluster4-new-test') >>> + >>> self.assertEqual(cdp.structure.structural_data[0].mol[0].mol_name, >>> 'SSS-cluster4-new-test_mol1') >>> >>> # Load a single atom and test it. >>> - >>> self.interpreter.structure.load_spins('SSS-cluster4-new-test:3@C') >>> + >>> self.interpreter.structure.load_spins('SSS-cluster4-new-test_mol1:@C') >>> self.assertEqual(count_spins(), 1) >>> >>> # Try loading a few protons. >>> >>> >>> _______________________________________________ >>> relax (http://nmr-relax.com) >>> >>> This is the relax-commits mailing list >>> [email protected] >>> >>> To unsubscribe from this list, get a password >>> reminder, or change your subscription options, >>> visit the list information page at >>> https://mail.gna.org/listinfo/relax-commits >>> >> >> _______________________________________________ >> relax (http://nmr-relax.com) >> >> This is the relax-devel mailing list >> [email protected] >> >> To unsubscribe from this list, get a password >> reminder, or change your subscription options, >> visit the list information page at >> https://mail.gna.org/listinfo/relax-devel > > _______________________________________________ relax (http://nmr-relax.com) This is the relax-devel mailing list [email protected] To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-devel

