From: DimitryASuplatov <ge...@gm...> - 2008-09-03 08:10:03
|
Hello, with your help I was able to write the following script to automatically load 21 structure and align 20 of them to the remaining one. ************************************************* import os import re from os.path import join, getsize cmd.delete(all) p = re.compile('[A-Za-z\.]*pdb') w = re.compile('nowater') for root, dirs, files in os.walk('./'): for file in files: <------>if p.search(file) and w.search(file): <------> cmd.load(file) cmd.delete('1gk9*') cmd.fetch('1gk9') for file1 in files: <------>if p.search(file1) and w.search(file1): <------> if re.search('1gk9', file1): <------><------>continue <------> pdb = re.search('(.+)\.pdb', file1) <------> print pdb.group(1), ' and 1gk9' <------> cmd.align(pdb.group(1) , '1gk9') ************************************************* The problem is that I see only the result - aligned structures. But I want to see the RMSD values and apply them to scrip variables. Is that possible? Thank you. |
From: Andreas F. <doc...@gm...> - 2008-09-03 08:21:05
|
Hey Dimitry, The "quiet" option (if present) is set to zero by default for parsed PyMOL commands, but is not set for Python API calls. align is nearly equal to cmd.align(quiet=0) Thus, if you want to get rmsd output, include quiet=0 and run your script with output redirection. The last line of your script should read cmd.align(pdb.group(1) , '1gk9', quiet=0) and the script should be called like this: pymol -qa script > output That's at least how it used to work. Andreas DimitryASuplatov wrote: > Hello, > with your help I was able to write the following script to automatically > load 21 structure and align 20 of them to the remaining one. > > ************************************************* > import os > import re > from os.path import join, getsize > > cmd.delete(all) > p = re.compile('[A-Za-z\.]*pdb') > w = re.compile('nowater') > for root, dirs, files in os.walk('./'): > for file in files: > <------>if p.search(file) and w.search(file): > <------> cmd.load(file) > cmd.delete('1gk9*') > cmd.fetch('1gk9') > for file1 in files: > <------>if p.search(file1) and w.search(file1): > <------> if re.search('1gk9', file1): > <------><------>continue > <------> pdb = re.search('(.+)\.pdb', file1) > <------> print pdb.group(1), ' and 1gk9' > <------> cmd.align(pdb.group(1) , '1gk9') > ************************************************* > > The problem is that I see only the result - aligned structures. But I > want to see the RMSD values and apply them to scrip variables. Is that > possible? > > Thank you. > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > PyMOL-users mailing list > PyM...@li... > https://lists.sourceforge.net/lists/listinfo/pymol-users > -- Andreas Förster, Research Associate Paul Freemont & Xiaodong Zhang Labs Department of Biochemistry, Imperial College London |
From: DeLano S. <de...@de...> - 2008-09-05 21:02:10
|
Dimitry, cmd.align returns a list of numbers, the first of which is the final RMS value for atoms in the final cycle of alignment. You can of course use that result in a script. Cheers, Warren -- DeLano Scientific LLC Subscriber Support Services mailto:su...@de... -----Original Message----- From: pym...@li... [mailto:pym...@li...] On Behalf Of DimitryASuplatov Sent: Wednesday, September 03, 2008 1:13 AM To: pym...@li... Subject: Re: [PyMOL] Script for iterated `align`ment Hello, with your help I was able to write the following script to automatically load 21 structure and align 20 of them to the remaining one. ************************************************* import os import re from os.path import join, getsize cmd.delete(all) p = re.compile('[A-Za-z\.]*pdb') w = re.compile('nowater') for root, dirs, files in os.walk('./'): for file in files: <------>if p.search(file) and w.search(file): <------> cmd.load(file) cmd.delete('1gk9*') cmd.fetch('1gk9') for file1 in files: <------>if p.search(file1) and w.search(file1): <------> if re.search('1gk9', file1): <------><------>continue <------> pdb = re.search('(.+)\.pdb', file1) <------> print pdb.group(1), ' and 1gk9' <------> cmd.align(pdb.group(1) , '1gk9') ************************************************* The problem is that I see only the result - aligned structures. But I want to see the RMSD values and apply them to scrip variables. Is that possible? Thank you. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ PyMOL-users mailing list PyM...@li... https://lists.sourceforge.net/lists/listinfo/pymol-users |