openModels.list doesn't necessarily return the currently open models in any particular order.  The if/else part of the code is testing whether the first model in the model list has model ID 0.  If it does then it assigns the first model to m0 and the second model to m1.  Otherwise, it makes the reverse assignment -- so m0 will always contain model 0 (the code assumes there are only two models open).

As per the example in that mail, chain A of model 0 had been superimposed on chain B of model 1.  That's why the "chains" were set to "[m0.sequence('A'), m1.sequence('B')]" for handing off to makeAlignment -- those were the chains desired in the alignment.  Are you saying you don't know which chain from each PDB file to use?  How do you know which to superimpose then?

--Eric

On Oct 27, 2014, at 4:05 PM, Sanjeev Sariya <s.sariya_work@ymail.com> wrote:

Thank you Eric for the URL.
Could you please help me understand what is going on here?
from chimera import openModels, Molecule # import

models = openModels.list(modelTypes=[Molecule]) # array for model- different PDBs
if models[0].id == 0: # what does this do? m0, m1 = models
else: # m1, m0 = models # why interchanged the m1, mo? chains = [m0.sequence('A'), m1.sequence('B')] # how do I know how many chains are present in PDB file?






On Monday, October 27, 2014 6:35 PM, Eric Pettersen <pett@cgl.ucsf.edu> wrote:


Hi Sanjeev,
Take a look at this chimera-users message:  [Chimera-users] easy way to make alignments in chimera .  I think it answers most of your questions.  The only change you would need to make is that where it uses "saveStockholm" you would instead use "saveFASTA".

--Eric

                        Eric Pettersen
                        UCSF Computer Graphics Lab
                        http://www.cgl.ucsf.edu

On Oct 27, 2014, at 2:25 PM, Sanjeev Sariya <s.sariya_work@ymail.com> wrote:

Hi Chimera Developers,

I've used chimera mostly by GUI inerface [click].
How do I get the match-align work from command line in a python script?
I read a good description at:

work flow of the script is:
take in 2 pdb files and match->align them.

I think, I will have to open them before running  'mols = openModels.list(modelTypes=[Molecule])'  ?

How do I get the output saved in a FASTA file without MAV interface?

 

_______________________________________________
Chimera-users mailing list
Chimera-users@cgl.ucsf.edu
http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users