next up previous contents index
Next: The Residue class: a Up: The Chain class: a Previous: Chain.atom_file_and_code() get   Contents   Index

Chain.join() -- join other chain(s) onto this one

join(chain)
Given another chain from the same model, alignment structure, or alignment sequence, this command will remove any chain breaks between the two chains. The passed chain (and any other chains between the two) will become part of the first. For example, if in a model containing five chains A, B, C, D and E chains D and B are joined, the model will end up with chains A, B, and E; former chains C and D will become part of the A chain.

Note that the chain must follow this chain in the sequence (e.g., you can join chain B or C onto chain A, but not chain A onto B or C). If it does not, or it is from a different sequence, a ValueError is raised.

Note that this does not renumber the residues; you will need to do that separately if you don't want duplicate residue numbers.

Note that for models this does not affect the model topology -- any existing C-terminal or N-terminal patches (e.g., OXT atoms) are not removed, and no bond is created between the termini of the joined chains. To accomplish that, write out the model (model.write()) and then read it back in (complete_pdb()).
Example: examples/commands/join_chains.py


# Example for: Chain.join()

# This will take a model containing two chains and join them into one.

from modeller import *

env = environ()
env.io.atom_files_directory = ['../atom_files']

mdl = model(env)
mdl.read(file='2abx')

# Join the B chain onto the end of the A chain
mdl.chains['A'].join(mdl.chains['B'])

# Renumber all residues in the new chain starting from 1
for num, residue in enumerate(mdl.chains['A'].residues):
    residue.num = '%d' % (num + 1)

mdl.write(file='2abx-join.pdb')


next up previous contents index
Next: The Residue class: a Up: The Chain class: a Previous: Chain.atom_file_and_code() get   Contents   Index
Automatic builds 2011-03-29