Пример #1
0
def get_superposable_atoms(polymer, segments, atom_types=["CA", "N", "C", "CB"]):
    result = []
    allowed_i = []
    residues = polymer.residues()
    for res_num_i, res_num_j in segments:
        i = get_i_residue(residues, str(res_num_i))
        j = get_i_residue(residues, str(res_num_j))
        allowed_i.extend(range(i, j))
    for i, residue in enumerate(residues):
        if i in allowed_i:
            result.extend([a for a in residue.atoms() if a.type in atom_types])
    return result
Пример #2
0
def get_superposable_atoms(polymer,
                           segments,
                           atom_types=['CA', 'N', 'C', 'CB', 'O']):
    result = []
    allowed_i = []
    residues = polymer.residues()
    for res_num_i, res_num_j in segments:
        i = get_i_residue(residues, str(res_num_i))
        j = get_i_residue(residues, str(res_num_j))
        allowed_i.extend(range(i, j + 1))
    for i, residue in enumerate(residues):
        if i in allowed_i:
            result.extend([a for a in residue.atoms() if a.type in atom_types])
    return result
Пример #3
0
def get_superposable_all_atoms(polymer, segments):
    atom_types = [
        'CA', 'N', 'C', 'CB', 'CD', 'CD1', 'CD2', 'CE', 'CE1', 'CE2', 'CE3',
        'CG', 'CG1', 'CG2', 'CH2', 'CZ', 'CZ2', 'CZ3', 'ND1', 'ND2', 'NE',
        'NE1', 'NE2', 'NH1', 'NH2', 'NZ', 'O', 'OD1', 'OD2', 'OE1', 'OE2',
        'OG', 'OG1', 'OH', 'OXT', 'SD', 'SG', 'CEN'
    ]
    result = []
    allowed_i = []
    residues = polymer.residues()
    for res_num_i, res_num_j in segments:
        i = get_i_residue(residues, str(res_num_i))
        j = get_i_residue(residues, str(res_num_j))
        allowed_i.extend(range(i, j + 1))
    for i, residue in enumerate(residues):
        if i in allowed_i:
            result.extend([a for a in residue.atoms() if a.type in atom_types])
    return result
Пример #4
0
def get_superposable_atoms(polymer, segments, atom_types=['CA', 'N', 'C', 'CB']):
    result = []
    allowed_i = []
    residues = polymer.residues()
    #if no segments provided, take the whole backbone
    if len(segments) == 0:
        print "no segments given, using backbone"
        for i, residue in enumerate(residues):
            result.extend([a for a in residue.atoms() if a.type in atom_types])
    else:
        print segments
        for res_num_i, res_num_j in segments:
            i = get_i_residue(residues, str(res_num_i))
            j = get_i_residue(residues, str(res_num_j))
            allowed_i.extend(range(i,j))
        for i, residue in enumerate(residues):
            if i in allowed_i:
                result.extend([a for a in residue.atoms() if a.type in atom_types])
    return result
Пример #5
0
def get_superposable_all_atoms(polymer, segments): 
  atom_types=['CA', 'N', 'C', 'CB',
              'CD', 'CD1', 'CD2', 'CE', 'CE1',
              'CE2', 'CE3', 'CG', 'CG1', 'CG2',
              'CH2', 'CZ', 'CZ2', 'CZ3', 'ND1', 
              'ND2', 'NE', 'NE1', 'NE2', 'NH1', 
              'NH2', 'NZ', 'O', 'OD1', 'OD2', 
              'OE1', 'OE2', 'OG', 'OG1', 'OH', 
              'OXT', 'SD', 'SG', 'CEN'] 
  result = []
  allowed_i = []
  residues = polymer.residues()
  for res_num_i, res_num_j in segments:
    i = get_i_residue(residues, str(res_num_i))
    j = get_i_residue(residues, str(res_num_j))
    allowed_i.extend(range(i,j+1))
  for i, residue in enumerate(residues):
    if i in allowed_i:
      result.extend([a for a in residue.atoms()
                     if a.type in atom_types])
  return result