Get raw alignment: Difference between revisions

From PyMOLWiki
Jump to navigation Jump to search
(Created page with "'''get_raw_alignment''' is an API only function that returns a list of lists of (object,index) tuples containing the raw per-atom alignment relationships. Alignment objects can b...")
 
Line 10: Line 10:


<source lang="python">
<source lang="python">
# start a python block
python
# get two structures
# get two structures
cmd.fetch('2xwu 2x19', async=0)
cmd.fetch('2xwu 2x19', async=0)
Line 20: Line 23:
for idx1, idx2 in raw_aln:
for idx1, idx2 in raw_aln:
     print '%s`%d -> %s`%d' % tuple(idx1 + idx2)
     print '%s`%d -> %s`%d' % tuple(idx1 + idx2)
#end the python block
python end
</source>
</source>



Revision as of 12:15, 18 August 2011

get_raw_alignment is an API only function that returns a list of lists of (object,index) tuples containing the raw per-atom alignment relationships. Alignment objects can be created by passing the "object" argument to align or super.

Please note: The order of the atom tuples are not necessarily in the order in which the two (or more) selections were passed to cmd.align.

PYMOL API

cmd.get_raw_alignment(string name)

EXAMPLE

# start a python block
python

# get two structures
cmd.fetch('2xwu 2x19', async=0)

# align and get raw alignment
cmd.align('/2xwu//B//CA', '/2x19//B//CA', cycles=0, transform=0, object='aln')
raw_aln = cmd.get_raw_alignment('aln')

# print residue pairs
for idx1, idx2 in raw_aln:
    print '%s`%d -> %s`%d' % tuple(idx1 + idx2)

#end the python block
python end

SEE ALSO