After I run a script, I've got the following lines:
PyMOL(TM) Molecular Graphics System, Version 1.4.1. Copyright (c) Schrodinger, LLC. All Rights Reserved. Created by Warren L. DeLano, Ph.D. PyMOL is user-supported open-source software. Although some versions are freely available, PyMOL is not in the public domain. If PyMOL is helpful in your work or study, then please volunteer support for our ongoing efforts to create open and affordable scientific software by purchasing a PyMOL Maintenance and/or Support subscription. More information can be found at "http://www.pymol.org". Enter "help" for a list of commands. Enter "help <command-name>" for information on a specific command. Hit ESC anytime to toggle between text and graphics. Command mode. No graphics front end. Detected 8 CPU cores. Enabled multithreaded rendering. PyMOL>align MHC1, MHC2 Match: read scoring matrix. Match: assigning 385 x 384 pairwise scores. MatchAlign: aligning residues (385 vs 384)... ExecutiveAlign: 3810 atoms aligned. Executive: RMS = 0.000 (3810 to 3810 atoms) PyMOL>sele EP1, chain M Selector: selection "EP1" defined with 63 atoms. PyMOL>sele EP2, chain R Selector: selection "EP2" defined with 64 atoms. PyMOL>rms_cur EP1 and n. CA, EP2 and n. CA Executive: RMS = 7.457 (9 to 9 atoms) PyMOL: normal program termination.
I need to extract the value "7.457" from the line " Executive: RMS = 7.457 (9 to 9 atoms)". It should be noted that the "7.457" value, as well the "9 to 9 atoms" information will vary among different rounds, so I can't use it as a pattern. The "Executive: RMS" is not variable, but it is repeated some lines above. Apparently, I'll have the value always in the second last line. This could be used to extract the value, but I don't know how to do it with python or shell script.
Can someone help me? Thank you very much!
By the way, this is the script I'm working on(It's specific PyMol program, retrieving RMSD values):
## RUNNING ## Importing PyMol files from pymol.cgo import * from pymol import cmd from pymol import stored # Loading MHC1 cmd.load ("MHC1.pdb") #Change chain C to chain M (MHC1 epitope) cmd.alter (('chain C'),'chain="M"') # Loading MHC2 cmd.load ("MHC2.pdb") #Change chain C to chain R (MHC2 epitope) cmd.alter (('chain C'),'chain="R"') ## Align MHC1 and MHC2 cmd.do ("align MHC1, MHC2") ## MHC1 epitope selection (EP1) cmd.do ("sele EP1, chain M") ## MHC2 epitope selection (EP2) cmd.do ("sele EP2, chain R") ## Remove chain names (this is required so 'rms_cur' will work properly) cmd.alter (("all"),'chain=""') ## Residues numbers aligned (this is required so 'rms_cur' will work properly) cmd.alter (("all"),'segi=""') ## RMSD Calculation between EP1 and EP2 cmd.do ("rms_cur EP1 and n. CA, EP2 and n. CA")