예제 #1
0
def check_for_peptide_links(
    atom1,
    atom2,
):
    classes1 = linking_utils.get_classes(atom1)
    classes2 = linking_utils.get_classes(atom2)
    atom_group1 = atom1.parent()
    atom_group2 = atom2.parent()
    if classes1.common_amino_acid or classes2.common_amino_acid:
        if classes1.common_amino_acid:
            other = atom_group2
        else:
            other = atom_group1
        if linking_utils.get_class(other.resname) not in ["other"]:
            return None
        # sulfur bridge
        key = "SS"
        if atom1.name.strip() == "SG" and atom2.name.strip(
        ) == "SG":  # too strict?
            return key, False
        # test for backbond atoms
        count = 0
        for atom in other.atoms():
            if atom.name.strip() in ["C", "N", "O"]: count += 1
        if count != 3: return None
        key = "TRANS"
        if atom2.name.strip() == "C" and atom1.name.strip() == "N":
            return key, False
        elif atom1.name.strip() == "C" and atom2.name.strip() == "N":
            return key, True
    return False
예제 #2
0
def check_for_peptide_links(atom1,
                            atom2,
                            ):
  classes1 = linking_utils.get_classes(atom1)
  classes2 = linking_utils.get_classes(atom2)
  atom_group1 = atom1.parent()
  atom_group2 = atom2.parent()
  if classes1.common_amino_acid or classes2.common_amino_acid:
    if classes1.common_amino_acid:
      other = atom_group2
    else:
      other = atom_group1
    if linking_utils.get_class(other.resname) not in ["other"]:
      return None
    # sulfur bridge
    key = "SS"
    if atom1.name.strip()=="SG" and atom2.name.strip()=="SG": # too strict?
      return key, False
    # test for backbond atoms
    count = 0
    for atom in other.atoms():
      if atom.name.strip() in ["C", "N", "O"]: count+=1
    if count!=3: return None
    key = "TRANS"
    if atom2.name.strip()=="C" and atom1.name.strip()=="N":
      return key, False
    elif atom1.name.strip()=="C" and atom2.name.strip()=="N":
      return key, True
  return False