# Path: pdbtools/clean.py
# def stripACS(coord):
#     """
#     Removes alternate confromations.
#     """
# 
#     def removeLetters(line):
#         """
#         Mini function that removes letters that denote ACS.
#         """
# 
#         if line[16] in string.letters:
#             line = "%s %s" % (line[:16],line[17:])
#         if line[26] in string.letters:
#             line = "%s %s" % (line[:26],line[27:])
# 
#         return line
# 
#     # If a particular residue already has an atom, it will be in known_atom_dict
#     # The second occurence of that atom in the same residue is assumed to be an
#     # alternate conformation and is skipped.
#     known_atom_dict = {}
#     coord_out = []
#     skipped = []
#     for c in coord:
#         residue = c[21:26]
# 
#         # If the residue is not known, update known_atom_dict and append line
#         # to coordinate file
#         if residue not in list(known_atom_dict.keys()):
#             out = removeLetters(c)
#             coord_out.append(out)
#             known_atom_dict.update([(residue,[c[13:16]])])
# 
#         # If the residue is known, determine if the atom has been seen before.
#         # If it has, skip it.  Otherwise, append to coord_out and
#         # known_atom_dict
#         else:
#             atom = c[13:16]
#             if atom in known_atom_dict[residue]:
#                 skipped.append("REMARK%s" % c[6:])
#             else:
#                 out = removeLetters(c)
#                 coord_out.append(out)
#                 known_atom_dict[residue].append(atom)
# 
#     return coord_out, skipped


import sys
from .clean import stripACS
#!/usr/bin/env python

# Copyright 2007, Michael J. Harms
# This program is distributed under General Public License v. 3.  See the file
# COPYING for a copy of the license.

__description__ = \
"""
pdb_disulfide.py

Returns a list of cys in disulfide bonds in a protein using a simple distance
constraint.
"""

__author__ = "Michael J. Harms"
__date__ = "070726"



def pdbDisulfide(pdb,disulfide_cutoff=4.0):
    """
    Finds all disulfides in pdb file based on disulfide cutoff distance (A).
    """


# Path: pdbtools/clean.py
# def stripACS(coord):
#     """
#     Removes alternate confromations.
#     """
# 
#     def removeLetters(line):
#         """
#         Mini function that removes letters that denote ACS.
#         """
# 
#         if line[16] in string.letters:
#             line = "%s %s" % (line[:16],line[17:])
#         if line[26] in string.letters:
#             line = "%s %s" % (line[:26],line[27:])
# 
#         return line
# 
#     # If a particular residue already has an atom, it will be in known_atom_dict
#     # The second occurence of that atom in the same residue is assumed to be an
#     # alternate conformation and is skipped.
#     known_atom_dict = {}
#     coord_out = []
#     skipped = []
#     for c in coord:
#         residue = c[21:26]
# 
#         # If the residue is not known, update known_atom_dict and append line
#         # to coordinate file
#         if residue not in list(known_atom_dict.keys()):
#             out = removeLetters(c)
#             coord_out.append(out)
#             known_atom_dict.update([(residue,[c[13:16]])])
# 
#         # If the residue is known, determine if the atom has been seen before.
#         # If it has, skip it.  Otherwise, append to coord_out and
#         # known_atom_dict
#         else:
#             atom = c[13:16]
#             if atom in known_atom_dict[residue]:
#                 skipped.append("REMARK%s" % c[6:])
#             else:
#                 out = removeLetters(c)
#                 coord_out.append(out)
#                 known_atom_dict[residue].append(atom)
# 
#     return coord_out, skipped


# Path: pdbtools/disulfide.py
import sys
from .clean import stripACS

#!/usr/bin/env python

# Copyright 2007, Michael J. Harms
# This program is distributed under General Public License v. 3.  See the file
# COPYING for a copy of the license.

__description__ = \
"""
pdb_disulfide.py

Returns a list of cys in disulfide bonds in a protein using a simple distance
constraint.
"""

__author__ = "Michael J. Harms"
__date__ = "070726"



def pdbDisulfide(pdb,disulfide_cutoff=4.0):
    """
    Finds all disulfides in pdb file based on disulfide cutoff distance (A).
    """


    pdb, skipped = stripACS(pdb)