Just a wild guess
fetch 1htr, async=0
Marius

On Tue, May 4, 2010 at 10:58 PM, Michael Zimmermann <michaelz@iastate.edu> wrote:
Dear PyMOL users,

I was just making a script to selectively download sections of PDB files using fetch.  When I run the pml from the GUI I see that all of the commands are executed and then the structure called by fetch is loaded.  Is there any way to force the other commands to wait until fetch is finished getting the PDB file?  Interestingly, if I run the script a second time, then it behaves as I would have expected it to.  If multiple PDB files are fetched and downloaded the pattern is similar; the first time the script is run all of the commands are processed, and then all of the structures are "fetched" but the second time the script is run the structures are fetched and then the next lines of code are run.  I would like to do this for hundreds of structures based on PFam domains, so it would be nice if this would work reliably.

I am executing the file with
>PyMOL.exe -c -k -u myscript.pml

--------------------------PML-File ------------------
fetch 1htr
remove not (alt ''+A)
alter all, alt=''
select prot, (chain P and resi 2-30)
save PF_1htr.pdb, prot
delete all
----------------------------------------------------------

----------------------PYMOL-output-after-first-run-----------------
PyMOL>@Fetch_PF07966.pml
PyMOL>cd C:\DOCUME~1\Administrator\MYDOCU~1\MATLAB\Motion_conservation
 cd: now in C:\DOCUME~1\Administrator\MYDOCU~1\MATLAB\Motion_conservation
PyMOL>fetch 1htr
PyMOL>remove not (alt ''+A)
PyMOL>alter all, alt=''
 Alter: modified 0 atoms.
PyMOL>select prot, (chain P and resi 2-30)
 Selector: selection "prot" defined with 0 atoms.
PyMOL>save C:\DOCUME~1\Administrator\MYDOCU~1\MATLAB\Motion_conservation\PF07966\PF_1htr.pdb, prot
 Save: wrote "C:\DOCUME~1\Administrator\MYDOCU~1\MATLAB\Motion_conservation\PF07966\PF_1htr.pdb".
PyMOL>delete all
HEADER    ASPARTYL PROTEASE                       21-OCT-94   1HTR
TITLE     CRYSTAL AND MOLECULAR STRUCTURES OF HUMAN PROGASTRICSIN AT
TITLE    2 1.62 ANGSTROMS RESOLUTION
COMPND    MOL_ID: 1;
COMPND   2 MOLECULE: PROGASTRICSIN (PRO SEGMENT);
COMPND   3 CHAIN: P;
COMPND   4 EC: 3.4.23.3;
COMPND   5 ENGINEERED: YES;
COMPND   6 MOL_ID: 2;
COMPND   7 MOLECULE: GASTRICSIN;
COMPND   8 CHAIN: B;
COMPND   9 EC: 3.4.23.3;
COMPND  10 ENGINEERED: YES
 ObjectMolecule: Read secondary structure assignments.
 ObjectMolecule: Read crystal symmetry information.
 Symmetry: Found 8 symmetry operators.
 CmdLoad: ".\1htr.pdb" loaded as "1htr".
-----------------------------------------

----------------------PYMOL-output-after-second-run-----------------
PyMOL>fetch 1htr
PyMOL>remove not (alt ''+A)
HEADER    ASPARTYL PROTEASE                       21-OCT-94   1HTR
TITLE     CRYSTAL AND MOLECULAR STRUCTURES OF HUMAN PROGASTRICSIN AT
TITLE    2 1.62 ANGSTROMS RESOLUTION
COMPND    MOL_ID: 1;
COMPND   2 MOLECULE: PROGASTRICSIN (PRO SEGMENT);
COMPND   3 CHAIN: P;
COMPND   4 EC: 3.4.23.3;
COMPND   5 ENGINEERED: YES;
COMPND   6 MOL_ID: 2;
COMPND   7 MOLECULE: GASTRICSIN;
COMPND   8 CHAIN: B;
COMPND   9 EC: 3.4.23.3;
COMPND  10 ENGINEERED: YES
 ObjectMolecule: Read secondary structure assignments.
 ObjectMolecule: Read crystal symmetry information.
 CmdLoad: ".\1htr.pdb" appended into object "1htr", state 2.
 Remove: eliminated 16 atoms in model "1htr".
PyMOL>alter all, alt=''
 Alter: modified 3113 atoms.
PyMOL>select prot, (chain P and resi 2-30)
 Selector: selection "prot" defined with 239 atoms.
PyMOL>save C:\DOCUME~1\Administrator\MYDOCU~1\MATLAB\Motion_conservation\PF07966\PF_1htr.pdb, prot
 Save: wrote "C:\DOCUME~1\Administrator\MYDOCU~1\MATLAB\Motion_conservation\PF07966\PF_1htr.pdb".
PyMOL>delete all
-----------------------------------------

--
Michael Zimmermann
Ph.D. student in Bioinformatics and Computational Biology
Department of Biochemistry, Biophysics and Molecular Biology
Iowa State University

------------------------------------------------------------------------------

_______________________________________________
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net