Thanks. Heres how I did it:

import __main__
__main__.pymol_argv = ['pymol', '-qc']
import pymol
import os
from pymol import *

pymol.finish_launching()

one= '/protein_files/1A6M.pdb'
two = '/protein_files/1GZX.pdb'
name1 = os.path.basename(one)
name2 = os.path.basename(two)

# To get filename without extension: one.split(".",1)[0]

cmd.load(one, name1)
cmd.load(two, name2)
rms = cmd.align(name1, name2)

print(rms)

cmd.quit()

On Tue, Jul 14, 2015 at 2:02 AM, Gazal <gazal...@gmail.com> wrote:

> Thanks, I tried using python like you suggested but received these errors:
>
> Symmetry-Error: Urecognized space group symbol 'P 21 21 2 A'.
> Symmetry-Error: Unable to get matrices.
>
> I used the method given by Osvaldo.
> And to test if it works I removed the lines from pdb files where it
> mentioned the space groups.
>
> And I think it works now...
>
> I get following RMSD value:
> (1.246872901916504, 581, 5, 2.418435573577881, 669, 94.0, 113)
>
> these values are:
> RMSD
> No. of atoms for which we get RMSD
> No. of cycles
> ??
> No. of atoms aligned
> ??
> ??
>
> :)
>
> But still there is this space group problem.. Any suggestions to beat that?
>
>
>
> Many thanks.
>
> --
> Gazal
>
> On Sat, Jul 11, 2015 at 10:17 PM, David Hall <li...@cowsandmilk.net>
> wrote:
>
>> I assume you are referring to
>> http://pldserver1.biochem.queensu.ca/~rlc/work/pymol/fitting.py
>>
>> That is a script that creates a function. To turn it into a program, you
>> need to set up what you read in and what you output.
>>
>> In python, this is often done by command line arguments that can read
>> from sys.argv
>>
>> import sys
>>
>> arg1 = sys.argv[1]
>> arg2 = sys.argv[2]
>>
>> cmd.load(arg1, “protein1”)
>> cmd.load(arg2, “protein2”)
>>
>> You can have the definition of fitting in your script, then call
>>
>> fitting(“protein1”, ????, “protein2”, ????)
>>
>> I left in questions for the select1 and select2 arguments of the function
>> since it is not at all clear what you would like to put in as arguments
>> there.
>>
>> Beyond that, I would recommend reading up on python assuming you are not
>> familiar with the language.
>>
>> -David
>>
>>
>> On Jul 11, 2015, at 10:00 AM, Gazal <gazal...@gmail.com> wrote:
>>
>> Thank you for your help, Osvaldo and David.
>>
>> I tried using the command but did not get the RMS as expected.. Following
>> are the results:
>>
>> 1.
>> pymol -cqr fitting.py 1A6M.pdb 4OE9.txt
>> PyMOL>run fitting.py,main
>> HEADER    OXYGEN TRANSPORT                        26-FEB-98   1A6M
>> TITLE     OXY-MYOGLOBIN, ATOMIC RESOLUTION
>> COMPND    MOL_ID: 1;
>> COMPND   2 MOLECULE: MYOGLOBIN;
>> COMPND   3 CHAIN: A
>>  ObjectMolecule: Read secondary structure assignments.
>>  ObjectMolecule: Read crystal symmetry information.
>>  Symmetry: Found 2 symmetry operators.
>>  CmdLoad: "1A6M.pdb" loaded as "1A6M".
>> HEADER    PROTEIN BINDING                         12-JAN-14   4OE9
>> TITLE     THE CRYSTAL STRUCTURE OF THE N-TERMINAL DOMAIN OF COMMD9
>> COMPND    MOL_ID: 1;
>> COMPND   2 MOLECULE: COMM DOMAIN-CONTAINING PROTEIN 9;
>> COMPND   3 CHAIN: A, B;
>> COMPND   4 FRAGMENT: COMMD9, UNP RESIDUES  1-117;
>> COMPND   5 ENGINEERED: YES;
>> COMPND   6 MUTATION: YES
>>  ObjectMolecule: Read secondary structure assignments.
>>  ObjectMolecule: Read crystal symmetry information.
>>  Symmetry: Found 1 symmetry operators.
>>  CmdLoad: "4OE9.txt" loaded as "4OE9.txt".
>>
>> 2.
>> pymol -cqr fitting.py --1A6M.pdb 4OE9.txt
>> PyMOL>run fitting.py,main
>>
>> Do I need to import Pymol module in the shell script to use the pymol
>> scripts like you did in python?
>> Am I missing something?
>>
>> ​Thanks​
>>
>> --
>> ​Gazal​
>>
>> On Fri, Jul 10, 2015 at 11:36 PM, David Hall <li...@cowsandmilk.net>
>> wrote:
>>
>>> http://www.pymolwiki.org/index.php/Command_Line_Options
>>>
>>> see the -c and -r options. I also use -q
>>>
>>> pymol -qcr script.py — arg1 arg2 arg3
>>>
>>>
>>> On Jul 10, 2015, at 8:44 AM, Gazal <gazal...@gmail.com> wrote:
>>>
>>> Hi,
>>>
>>> I'm trying to find the RMSD values for batch purposes. The command which
>>> I found works for the Pymol-command line.
>>> I was hoping if I could get an idea about using the python script
>>> fitting.py in my shell script without triggering the Pymol GUI.
>>>
>>> Thanks in advance.
>>>
>>> Gazal
>>>
>>> ------------------------------------------------------------------------------
>>> Don't Limit Your Business. Reach for the Cloud.
>>> GigeNET's Cloud Solutions provide you with the tools and support that
>>> you need to offload your IT needs and focus on growing your business.
>>> Configured For All Businesses. Start Your Cloud Today.
>>>
>>> https://www.gigenetcloud.com/_______________________________________________
>>> 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
>>>
>>>
>>>
>>
>> ------------------------------------------------------------------------------
>> Don't Limit Your Business. Reach for the Cloud.
>> GigeNET's Cloud Solutions provide you with the tools and support that
>> you need to offload your IT needs and focus on growing your business.
>> Configured For All Businesses. Start Your Cloud Today.
>>
>> https://www.gigenetcloud.com/_______________________________________________
>> 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
>>
>>
>>
>
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
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

Reply via email to