schrodinger.protein.sequence module

Implementation of ProteinSequence, Sequence, and StructureSequence class.

StructureSequence allows iteration over all sequences in a given protein CT, and iteration over residues of each (in sequence order).

class schrodinger.protein.sequence.Sequence

Bases: object

__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.protein.sequence', '__dict__': <attribute '__dict__' of 'Sequence' objects>, '__weakref__': <attribute '__weakref__' of 'Sequence' objects>, '__doc__': None})
__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__

Return hash(self).

__init__

Initialize self. See help(type(self)) for accurate signature.

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'schrodinger.protein.sequence'
__ne__

Return self!=value.

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__str__

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

class schrodinger.protein.sequence.SequenceProxy(seq)

Bases: schrodinger.models.json.JsonableClassMixin, schrodinger.protein.sequence.Sequence

A read-only wrapper for sequences. We use this to prevent users from directly modifying sequences which can corrupt undoability and residue anchoring.

MUTATION_METHODS = {'removeElements', 'insert', 'extend', 'append', 'addGapsByIndices', 'addGapsBeforeIndices', 'removeAllGaps', 'removeTerminalGaps', 'mutate', 'setStructure'}
__init__(seq)

Initialize self. See help(type(self)) for accurate signature.

__str__()

Return str(self).

__len__()
__getitem__(index)
__iter__()
__contains__(item)
__deepcopy__(memo)
__eq__(other)

Return self==value.

__hash__()

Return hash(self).

__getattr__(attr_name)
__setattr__(attr_name, value)

Implement setattr(self, name, value).

sequence_type

The class of the wrapped sequence.

Return type:type
toJsonImplementation()

Abstract method that must be defined by all derived classes. Converts an instance of the derived class into a jsonifiable object.

Returns:A dict made up of JSON native datatypes or Jsonable objects. See the link below for a table of such types. https://docs.python.org/2/library/json.html#encoders-and-decoders
classmethod fromJsonImplementation(json_obj)

Abstract method that must be defined by all derived classes. Takes in a dictionary and constructs an instance of the derived class.

Parameters:json_dict (dict) – A dictionary loaded from a JSON string or file.
Returns:An instance of the derived class.

:rtype : cls

__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.protein.sequence', '__doc__': '\n A read-only wrapper for sequences. We use this to prevent users from\n directly modifying sequences which can corrupt undoability and\n residue anchoring.\n ', 'MUTATION_METHODS': {'removeElements', 'insert', 'extend', 'append', 'addGapsByIndices', 'addGapsBeforeIndices', 'removeAllGaps', 'removeTerminalGaps', 'mutate', 'setStructure'}, '__init__': <function SequenceProxy.__init__>, '__str__': <function SequenceProxy.__str__>, '__len__': <function SequenceProxy.__len__>, '__getitem__': <function SequenceProxy.__getitem__>, '__iter__': <function SequenceProxy.__iter__>, '__contains__': <function SequenceProxy.__contains__>, '__deepcopy__': <function SequenceProxy.__deepcopy__>, '__eq__': <function SequenceProxy.__eq__>, '__hash__': <function SequenceProxy.__hash__>, '__getattr__': <function SequenceProxy.__getattr__>, '__setattr__': <function SequenceProxy.__setattr__>, 'sequence_type': <property object>, 'toJsonImplementation': <function SequenceProxy.toJsonImplementation>, 'fromJsonImplementation': <classmethod object>, '_SequenceProxy_jsonAdapters': []})
__dir__() → list

default dir() implementation

__format__()

default object formatter

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

classmethod __init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'schrodinger.protein.sequence'
__ne__

Return self!=value.

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

Return repr(self).

__sizeof__() → int

size of object in memory, in bytes

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters:json_obj (dict) – A json-loaded dictionary to create an object from.
Returns:An instance of this class.

:rtype : cls

get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type:An instance of one the classes from NATIVE_JSON_DATATYPES
class schrodinger.protein.sequence.AbstractSequence(*args, **kwargs)

Bases: schrodinger.protein.sequence.Sequence, PyQt5.QtCore.QObject

A base class for single-chain and combined-chain biological sequences.

Variables:
  • ORIGIN (enum.Enum) – Possible sequence origins
  • AnnotationClass (annotation.SequenceAnnotations) – Class to use for annotations
  • ElementClass (residue.SequenceElement) – Class to use for elements
  • alphabet (dict(str, residue.ElementType)) – A mapping of string representations of elements to element types
  • _gap_chars (tuple(str)) – A tuple of permissible gap characters in the element list; the first item will be used for serialization.
  • _unknown_res_type (residue.ElementType) – The type for an unknown residue
  • residuesChanged (QtCore.pyqtSignal) – A signal emitted when sequence residues are changed. Emitted with the indices of the first and last changed residues.
  • lengthAboutToChange (QtCore.pyqtSignal) – A signal emitted when the sequence length is about to change. Emitted with the old and new lengths.
  • lengthChanged (QtCore.pyqtSignal) – A signal emitted when the sequence length is changed. Emitted with the old and new lengths.
  • nameChanged (QtCore.pyqtSignal) – A signal emitted when the sequence name is changed.
  • visibilityChanged (QtCore.pyqtSignal) – A signal emitted when the visibility is changed.
  • structureChanged (QtCore.pyqtSignal) – A signal emitted when the structure changes.
  • annotationTitleChanged (QtCore.pyqtSignal) – A signal emitted when an annotation title is changed.
class ORIGIN

Bases: enum.Enum

An enumeration.

MAESTRO = 1
PYMOL = 2
__class__

alias of enum.EnumMeta

__members__ = mappingproxy(OrderedDict([('MAESTRO', <ORIGIN.MAESTRO: 1>), ('PYMOL', <ORIGIN.PYMOL: 2>)]))
__module__ = 'schrodinger.protein.sequence'
AnnotationClass = None
ElementClass

alias of schrodinger.protein.residue.SequenceElement

alphabet = {}
residuesChanged
lengthAboutToChange
lengthChanged
nameChanged
visibilityChanged
structureChanged
annotationTitleChanged
__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

gap_char
getAnnotation(index, annotation)

Returns the annotation at the specified index or None for a gap.

Raises:ValueError – if the annotation is not available
index(res, ignore_gaps=False)

Returns the index of the specified residue

Parameters:
  • res (schrodinger.structure._Residue) – The residue to find
  • ignore_gaps (bool) – Whether the index returned should ignore gaps in the sequence or not.
Raises:

A Value error if the residue is not present or if the res is None

Return type:

int

Returns:

The index of the residue

getIdentity(reference, consider_gaps=True)

Return a float scoring the identity between the sequence and a reference sequence, assuming that they’re already aligned

Parameters:
Returns:

The sequence identity score (between 0.0 and 1.0)

Return type:

float

getSimilarity(reference, consider_gaps=True)

Return a float score of the similarity count between the sequence and a reference sequence, assuming that they’re already aligned.

Parameters:
Returns:

The sequence similarity score (between 0.0 and 1.0)

Return type:

float

getConservation(reference, consider_gaps=True)

Return a float scoring the homology conservation between the sequence and a reference sequence, assuming that they’re already aligned.

The homology criterion is based on “side chain chemistry” descriptor matching.

Parameters:
Returns:

The sequence conservation score (between 0.0 and 1.0)

Return type:

float

getSimilarityScore(reference)

Return the total score of similarity between the sequence and a reference sequence, assuming that they’re already aligned.

Since the similarity with a gap will always be 0.0, there is no need to consider gaps.

Parameters:reference (schrodinger.protein.sequence.Sequence) – A sequence to compare against
Returns:The total sequence similarity score
Return type:float
getGaplessLength()
Returns:Length of this sequence ignoring gaps
Return type:int
getGaps()
Return type:list(residue.Gap)
Returns:The gaps in the sequence.
hasStructure()
Returns:Whether this sequence has an associated structure.
Return type:bool
getStructure()
Returns:The associated structure. Will return None if there is no associated structure.
Return type:schrodinger.structure.Structure or NoneType
setStructure(struc)

Set the associated structure. Can only be used on sequences with an associated structure.

Parameters:struc (schrodinger.structure.Structure) – The new structure for this sequence
Raises:RuntimeError – If there’s no structure associated with this sequence object.
clearAllCaching()

This method should be implemented in subclasses that cache any data.

__class__

alias of sip.wrappertype

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.protein.sequence', '__doc__': '\n A base class for single-chain and combined-chain biological sequences.\n\n :cvar ORIGIN: Possible sequence origins\n :vartype ORIGIN: enum.Enum\n\n :cvar AnnotationClass: Class to use for annotations\n :vartype AnnotationClass: annotation.SequenceAnnotations\n\n :cvar ElementClass: Class to use for elements\n :vartype ElementClass: residue.SequenceElement\n\n :cvar alphabet: A mapping of string representations of elements to\n element types\n :vartype alphabet: dict(str, residue.ElementType)\n\n :cvar _gap_chars: A tuple of permissible gap characters in the element list;\n the first item will be used for serialization.\n :vartype _gap_chars: tuple(str)\n\n :cvar _unknown_res_type: The type for an unknown residue\n :vartype _unknown_res_type: residue.ElementType\n\n :cvar residuesChanged: A signal emitted when sequence residues are changed.\n Emitted with the indices of the first and last changed residues.\n :vartype residuesChanged: QtCore.pyqtSignal\n\n :cvar lengthAboutToChange: A signal emitted when the sequence length is\n about to change. Emitted with the old and new lengths.\n :vartype lengthAboutToChange: QtCore.pyqtSignal\n\n :cvar lengthChanged: A signal emitted when the sequence length is changed.\n Emitted with the old and new lengths.\n :vartype lengthChanged: QtCore.pyqtSignal\n\n :cvar nameChanged: A signal emitted when the sequence name is changed.\n :vartype nameChanged: QtCore.pyqtSignal\n\n :cvar visibilityChanged: A signal emitted when the visibility is changed.\n :vartype visibilityChanged: QtCore.pyqtSignal\n\n :cvar structureChanged: A signal emitted when the structure changes.\n :vartype structureChanged: QtCore.pyqtSignal\n\n :cvar annotationTitleChanged: A signal emitted when an annotation title\n is changed.\n :vartype annotationTitleChanged: QtCore.pyqtSignal\n ', 'ORIGIN': <enum 'ORIGIN'>, 'AnnotationClass': None, 'ElementClass': <class 'schrodinger.protein.residue.SequenceElement'>, 'alphabet': {}, '_gap_chars': ('~',), '_unknown_res_type': ResidueType('X', 'UNK', 'Unknown'), 'residuesChanged': <unbound PYQT_SIGNAL AbstractSequence.residuesChanged[int, int]>, 'lengthAboutToChange': <unbound PYQT_SIGNAL AbstractSequence.lengthAboutToChange[int, int]>, 'lengthChanged': <unbound PYQT_SIGNAL AbstractSequence.lengthChanged[int, int]>, 'nameChanged': <unbound PYQT_SIGNAL AbstractSequence.nameChanged[]>, 'visibilityChanged': <unbound PYQT_SIGNAL AbstractSequence.visibilityChanged[]>, 'structureChanged': <unbound PYQT_SIGNAL AbstractSequence.structureChanged[]>, 'annotationTitleChanged': <unbound PYQT_SIGNAL AbstractSequence.annotationTitleChanged[]>, '__init__': <function AbstractSequence.__init__>, 'gap_char': <property object>, 'getAnnotation': <function AbstractSequence.getAnnotation>, 'index': <function AbstractSequence.index>, '_getScore': <function AbstractSequence._getScore>, 'getIdentity': <function AbstractSequence.getIdentity>, 'getSimilarity': <function AbstractSequence.getSimilarity>, 'getConservation': <function AbstractSequence.getConservation>, 'getSimilarityScore': <function AbstractSequence.getSimilarityScore>, '_res_positions': <property object>, 'getGaplessLength': <function AbstractSequence.getGaplessLength>, 'getGaps': <function AbstractSequence.getGaps>, '_invalidateResiduePositionCache': <function AbstractSequence._invalidateResiduePositionCache>, '_updateResiduePositionCache': <function AbstractSequence._updateResiduePositionCache>, 'hasStructure': <function AbstractSequence.hasStructure>, 'getStructure': <function AbstractSequence.getStructure>, 'setStructure': <function AbstractSequence.setStructure>, 'clearAllCaching': <function AbstractSequence.clearAllCaching>})
__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattr__(self, str) → object
__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__

Return hash(self).

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'schrodinger.protein.sequence'
__ne__

Return self!=value.

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__str__

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → object
connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
deleteLater(self)
destroyed

destroyed(self, QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → object
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

inherits(self, str) → bool
installEventFilter(self, QObject)
isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
killTimer(self, int)
metaObject(self) → QMetaObject
moveToThread(self, QThread)
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
sender(self) → QObject
senderSignalIndex(self) → int
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
signalsBlocked(self) → bool
startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = -1) → str
class schrodinger.protein.sequence.AbstractSingleChainSequence(elements, name='', origin=None, entry_id='', entry_name='', pdb_id='', chain='', structure_chain=None, title='')

Bases: schrodinger.protein.sequence.AbstractSequence

Base class for single-chain biological sequences

Note: Protein-specific functionality should go in ProteinSequence.

Variables:sequenceCopied (QtCore.pyqtSignal) – A signal emitted when this sequence is copied. Emitted with the sequence being copied and the newly created copy. This signal is used by the structure model to make sure that the newly created copy is kept in sync with the structure.
sequenceCopied
__init__(elements, name='', origin=None, entry_id='', entry_name='', pdb_id='', chain='', structure_chain=None, title='')

Make a sequence object from a list of strings and/or self.ElementClass

Strings are converted to self.ElementClass using a mapping of strings to element types.

Parameters:
  • elements (iterable(self.ElementClass) or iterable(str)) – An iterable of elements making up the sequence
  • name (basestring) – The name of the sequence
  • origin (Sequence.ORIGIN or None) – A piece of metadata indicating where the sequence came from
  • entry_id – An entry associated with the sequence, if any
  • entry_name – An entry name associated with the sequence, if any
  • pdb_id – An id associated with the sequence, if any
  • chain (str) – The chain to which the sequence belongs
  • structure_chain (str) – The chain of the structure this sequence is associated with. This is usually the same as chain if the sequence has a structure but isn’t necessarily.
  • title (str) – The title for the sequence
Type:

str

Type:

str

Type:

str

Raises:

ValueError – If the unknown_res_type is None and an unrecognized character is encountered in the element list or elements is None

__str__()

Return str(self).

__len__()
__iter__()
__repr__()

Returns a representation of the instance that can be pasted into a repl

__contains__(item)
__bool__()
__getitem__(index)
__delitem__(index)
__copy__()
__deepcopy__(memo)
origin
Returns:A piece of metadata indicating where the sequence came from
Rtype origin:Sequence.ORIGIN or None
getSummary()

Returns a friendly, readable summary of the sequence

Return type:basestring
Returns:A summary of the sequence
classmethod makeSeqElement(element)
Parameters:element (str or cls.ElementClass) – A sequence element or string representation thereof
Returns:sequence element
Return type:cls.ElementClass
Raises:ValueError – If an element is not in cls.alphabet and cls._unknown_res_type is not defined
getSubsequence(start, end)

Return a sequence containing a subset of the elements in this one

Parameters:
  • start (int) – The index at which the subsequence should start
  • end (int) – The index at which the subsequence should end (exclusive)
Return type:

Sequence

Returns:

A sequence

name
fullname
Returns:a formatted name + optional chain name for the sequence
Return type:str
addGapsByIndices(gap_idxs)

Add gaps to the sequence from a list of gap indices. Note that these indices are based on numbering after the insertion. To insert gaps using indices based on numbering before the insertion, see addGapsBeforeIndices.

Parameters:gap_idxs (list(int)) – A list of gap indices
addGapsBeforeIndices(indices)

Add one gap to the alignment before each of the specified residue positions. Note that these indices are based on numbering before the insertion. To insert gaps using indices based on numbering after the insertion, see addGapsByIndices.

Parameters:indices (list(int)) – A list of indices to insert gaps before.
getNumResidues()

Return the number of residues in the sequence, that is, the length of the sequence without gaps

Return type:int
Returns:The number of residues in the sequence
removeAllGaps()

Remove gaps from the sequence

insertElements(index, elements)

Insert a list of elements or sequence element into this sequence.

Parameters:
  • index (int) – The index at which to insert elements
  • elements (iterable(self.ElementClass) or iterable(str)) – A list of elements to insert
mutate(start, end, elements)

Mutate sequence elements starting at the given index to the provided elements.

Parameters:
  • start (int) – The index at which to start mutating
  • end (int) – The index of the last mutated element (exclusive)
  • elements (iterable(self.ElementClass) or iterable(str)) – The elements to which to mutate the sequence
removeElements(eles)

Remove elements from the sequence.

Parameters:eles (list(residue.AbstractSequenceElement)) – A list of elements to remove from the sequence.
Raises:ValueError – If any of the given elements are not in the sequence.
append(element)

Appends an element to the sequence

Parameters:element – The element to append to this sequence
Type:element: self.ElementClass or basestring
extend(elements)

Extends the sequence with elements from an iterable

Parameters:elements (iterable(self.ElementClass) or iterable(str)) – The iterable containing elements with which to extend this sequence
sanitize(start=0, end=None)

Remove gaps and unknown sequence elements from sequence

removeTerminalGaps()

Remove gaps from the end of the sequence

getTerminalGaps()

Return terminal gaps.

Returns:A list of terminal gaps (in ascending index order)
Return type:list(residue.Gap)
getGapCount()
Returns:the number of gaps in the sequence
Return type:int
getNextResidue(res)

Return the next residue in the sequence (ignoring gaps) or None if this is the last residue.

Parameters:res (schrodinger.protein.residue.Residue) – A given residue in the sequence
Returns:The previous residue in the sequence
Return type:schrodinger.protein.residue.Residue
getPreviousResidue(res)

Return the previous residue in the sequence (ignoring gaps) or None if this is the first residue.

Parameters:res (schrodinger.protein.residue.Residue) – A given residue in the sequence
Returns:The previous residue in the sequence
Return type:schrodinger.protein.residue.Residue
iterResidues()

Return an iterable of residues, ignoring gaps.

Returns:Iterable of residues
Return type:iter(Residue)
iterNeighbors()

Return an iterable of three element tuples consisting of (prev_res, curr_res, next_res), ignoring gaps.

None is used for neighbors of first and last residues in the sequence, and does not indicate gaps here.

Returns:Iterable of 3-tuples, each element of the each tuple being either a schrodinger.protein.residue.Residue or None
Return type:iter(tuple(Residue or NoneType, Residue, Residue or NoneType))
hasStructure()
Returns:Whether this sequence has an associated structure.
Return type:bool
getStructure()
Returns:The associated structure. Will return None if there is no associated structure.
Return type:schrodinger.structure.Structure or NoneType
setStructure(struc)

Set the associated structure. Can only be used on sequences with an associated structure.

Parameters:struc (schrodinger.structure.Structure) – The new structure for this sequence
Raises:RuntimeError – If there’s no structure associated with this sequence object.
onStructureChanged()
classmethod isValid(elements)
Parameters:elements (iterable(str) or str) – An iterable of string representations of elements making up the sequence
Returns:Tuple indicating whether valid and a set of invalid characters, if any
Return type:tuple(bool, set(str))
visibility
AnnotationClass = None
ElementClass

alias of schrodinger.protein.residue.SequenceElement

class ORIGIN

Bases: enum.Enum

An enumeration.

MAESTRO = 1
PYMOL = 2
__class__

alias of enum.EnumMeta

__members__ = mappingproxy(OrderedDict([('MAESTRO', <ORIGIN.MAESTRO: 1>), ('PYMOL', <ORIGIN.PYMOL: 2>)]))
__module__ = 'schrodinger.protein.sequence'
__class__

alias of sip.wrappertype

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.protein.sequence', '__doc__': '\n Base class for single-chain biological sequences\n\n Note: Protein-specific functionality should go in ProteinSequence.\n\n :cvar sequenceCopied: A signal emitted when this sequence is copied.\n Emitted with the sequence being copied and the newly created copy.\n This signal is used by the structure model to make sure that the newly\n created copy is kept in sync with the structure.\n :vartype sequenceCopied: QtCore.pyqtSignal\n ', 'sequenceCopied': <unbound PYQT_SIGNAL AbstractSingleChainSequence.sequenceCopied[object, object]>, '__init__': <function AbstractSingleChainSequence.__init__>, '__str__': <function AbstractSingleChainSequence.__str__>, '_clearCachedStr': <function AbstractSingleChainSequence._clearCachedStr>, '__len__': <function AbstractSingleChainSequence.__len__>, '__iter__': <function AbstractSingleChainSequence.__iter__>, '__repr__': <function AbstractSingleChainSequence.__repr__>, '_res_format_code': <function AbstractSingleChainSequence._res_format_code>, '__contains__': <function AbstractSingleChainSequence.__contains__>, '__bool__': <function AbstractSingleChainSequence.__bool__>, '__getitem__': <function AbstractSingleChainSequence.__getitem__>, '__delitem__': <function AbstractSingleChainSequence.__delitem__>, '__copy__': <function AbstractSingleChainSequence.__copy__>, '__deepcopy__': <function AbstractSingleChainSequence.__deepcopy__>, 'origin': <property object>, 'getSummary': <function AbstractSingleChainSequence.getSummary>, '_makeSeqElements': <function AbstractSingleChainSequence._makeSeqElements>, 'makeSeqElement': <classmethod object>, '_makeSeqElement': <function AbstractSingleChainSequence._makeSeqElement>, 'getSubsequence': <function AbstractSingleChainSequence.getSubsequence>, 'name': <property object>, 'fullname': <property object>, 'addGapsByIndices': <function AbstractSingleChainSequence.addGapsByIndices>, 'addGapsBeforeIndices': <function AbstractSingleChainSequence.addGapsBeforeIndices>, 'getNumResidues': <function AbstractSingleChainSequence.getNumResidues>, 'removeAllGaps': <function AbstractSingleChainSequence.removeAllGaps>, 'insertElements': <function AbstractSingleChainSequence.insertElements>, 'mutate': <function AbstractSingleChainSequence.mutate>, 'removeElements': <function AbstractSingleChainSequence.removeElements>, 'append': <function AbstractSingleChainSequence.append>, 'extend': <function AbstractSingleChainSequence.extend>, '_replaceAllElements': <function AbstractSingleChainSequence._replaceAllElements>, '_removeFromSequence': <function AbstractSingleChainSequence._removeFromSequence>, 'sanitize': <function AbstractSingleChainSequence.sanitize>, 'removeTerminalGaps': <function AbstractSingleChainSequence.removeTerminalGaps>, 'getTerminalGaps': <function AbstractSingleChainSequence.getTerminalGaps>, 'getGapCount': <function AbstractSingleChainSequence.getGapCount>, 'getNextResidue': <function AbstractSingleChainSequence.getNextResidue>, 'getPreviousResidue': <function AbstractSingleChainSequence.getPreviousResidue>, 'iterResidues': <function AbstractSingleChainSequence.iterResidues>, 'iterNeighbors': <function AbstractSingleChainSequence.iterNeighbors>, 'hasStructure': <function AbstractSingleChainSequence.hasStructure>, 'getStructure': <function AbstractSingleChainSequence.getStructure>, 'setStructure': <function AbstractSingleChainSequence.setStructure>, 'onStructureChanged': <function AbstractSingleChainSequence.onStructureChanged>, 'isValid': <classmethod object>, 'visibility': <property object>})
__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattr__(self, str) → object
__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__

Return hash(self).

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'schrodinger.protein.sequence'
__ne__

Return self!=value.

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

alphabet = {}
annotationTitleChanged
blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → object
clearAllCaching()

This method should be implemented in subclasses that cache any data.

connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
deleteLater(self)
destroyed

destroyed(self, QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → object
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

gap_char
getAnnotation(index, annotation)

Returns the annotation at the specified index or None for a gap.

Raises:ValueError – if the annotation is not available
getConservation(reference, consider_gaps=True)

Return a float scoring the homology conservation between the sequence and a reference sequence, assuming that they’re already aligned.

The homology criterion is based on “side chain chemistry” descriptor matching.

Parameters:
Returns:

The sequence conservation score (between 0.0 and 1.0)

Return type:

float

getGaplessLength()
Returns:Length of this sequence ignoring gaps
Return type:int
getGaps()
Return type:list(residue.Gap)
Returns:The gaps in the sequence.
getIdentity(reference, consider_gaps=True)

Return a float scoring the identity between the sequence and a reference sequence, assuming that they’re already aligned

Parameters:
Returns:

The sequence identity score (between 0.0 and 1.0)

Return type:

float

getSimilarity(reference, consider_gaps=True)

Return a float score of the similarity count between the sequence and a reference sequence, assuming that they’re already aligned.

Parameters:
Returns:

The sequence similarity score (between 0.0 and 1.0)

Return type:

float

getSimilarityScore(reference)

Return the total score of similarity between the sequence and a reference sequence, assuming that they’re already aligned.

Since the similarity with a gap will always be 0.0, there is no need to consider gaps.

Parameters:reference (schrodinger.protein.sequence.Sequence) – A sequence to compare against
Returns:The total sequence similarity score
Return type:float
index(res, ignore_gaps=False)

Returns the index of the specified residue

Parameters:
  • res (schrodinger.structure._Residue) – The residue to find
  • ignore_gaps (bool) – Whether the index returned should ignore gaps in the sequence or not.
Raises:

A Value error if the residue is not present or if the res is None

Return type:

int

Returns:

The index of the residue

inherits(self, str) → bool
installEventFilter(self, QObject)
isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
killTimer(self, int)
lengthAboutToChange
lengthChanged
metaObject(self) → QMetaObject
moveToThread(self, QThread)
nameChanged
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
residuesChanged
sender(self) → QObject
senderSignalIndex(self) → int
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
signalsBlocked(self) → bool
startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
structureChanged
thread(self) → QThread
timerEvent(self, QTimerEvent)
tr(self, str, disambiguation: str = None, n: int = -1) → str
visibilityChanged
class schrodinger.protein.sequence.ProteinSequence(elements, name='', origin=None, entry_id='', entry_name='', pdb_id='', chain='', structure_chain=None, title='')

Bases: schrodinger.models.json.JsonableClassMixin, schrodinger.protein.sequence.AbstractSingleChainSequence

AnnotationClass

alias of schrodinger.protein.annotation.ProteinSequenceAnnotations

ElementClass

alias of schrodinger.protein.residue.Residue

alphabet = {'2AS': ResidueType('D', '2AS', 'Aspartic acid'), '3AH': ResidueType('H', '3AH', 'Histidine'), '5HP': ResidueType('E', '5HP', 'Glutamic acid'), 'A': ResidueType('A', 'ALA', 'Alanine'), 'ACE': ResidueType('X', 'ACE', 'Capping Group'), 'ACL': ResidueType('R', 'ACL', 'Arginine'), 'AGM': ResidueType('R', 'AGM', 'Arginine'), 'AIB': ResidueType('A', 'AIB', 'Alanine'), 'ALA': ResidueType('A', 'ALA', 'Alanine'), 'ALM': ResidueType('A', 'ALM', 'Alanine'), 'ALO': ResidueType('T', 'ALO', 'Threonine'), 'ALY': ResidueType('K', 'ALY', 'Lysine'), 'ANF': ResidueType('X', 'ANF', 'Capping Group'), 'ARG': ResidueType('R', 'ARG', 'Arginine'), 'ARM': ResidueType('R', 'ARM', 'Arginine'), 'ARN': ResidueType('R', 'ARN', 'Arginine'), 'ASA': ResidueType('D', 'ASA', 'Aspartic acid'), 'ASB': ResidueType('D', 'ASB', 'Aspartic acid'), 'ASH': ResidueType('D', 'ASH', 'Aspartic acid'), 'ASK': ResidueType('D', 'ASK', 'Aspartic acid'), 'ASL': ResidueType('D', 'ASL', 'Aspartic acid'), 'ASN': ResidueType('N', 'ASN', 'Asparagine'), 'ASP': ResidueType('D', 'ASP', 'Aspartic acid'), 'ASQ': ResidueType('D', 'ASQ', 'Aspartic acid'), 'AYA': ResidueType('A', 'AYA', 'Alanine'), 'BCS': ResidueType('X', 'BCS', 'Cysteine'), 'BHD': ResidueType('D', 'BHD', 'Aspartic acid'), 'BMT': ResidueType('T', 'BMT', 'Threonine'), 'BNN': ResidueType('A', 'BNN', 'Alanine'), 'BUC': ResidueType('C', 'BUC', 'Cysteine'), 'BUG': ResidueType('L', 'BUG', 'Leucine'), 'C': ResidueType('C', 'CYS', 'Cysteine'), 'C5C': ResidueType('C', 'C5C', 'Cysteine'), 'C6C': ResidueType('C', 'C6C', 'Cysteine'), 'CCS': ResidueType('C', 'CCS', 'Cysteine'), 'CEA': ResidueType('C', 'CEA', 'Cysteine'), 'CGU': ResidueType('E', 'CGU', 'Glutamic acid'), 'CHG': ResidueType('A', 'CHG', 'Alanine'), 'CLE': ResidueType('L', 'CLE', 'Leucine'), 'CME': ResidueType('C', 'CME', 'Cysteine'), 'CSD': ResidueType('A', 'CSD', 'Alanine'), 'CSO': ResidueType('C', 'CSO', 'Cysteine'), 'CSP': ResidueType('C', 'CSP', 'Cysteine'), 'CSS': ResidueType('C', 'CSS', 'Cysteine'), 'CSW': ResidueType('C', 'CSW', 'Cysteine'), 'CSX': ResidueType('C', 'CSX', 'Cysteine'), 'CXM': ResidueType('M', 'CXM', 'Methionine'), 'CY1': ResidueType('C', 'CY1', 'Cysteine'), 'CY3': ResidueType('C', 'CY3', 'Cysteine'), 'CYG': ResidueType('C', 'CYG', 'Cysteine'), 'CYM': ResidueType('C', 'CYM', 'Cysteine'), 'CYP': ResidueType('C', 'CYP', 'Cysteine'), 'CYQ': ResidueType('C', 'CYQ', 'Cysteine'), 'CYS': ResidueType('C', 'CYS', 'Cysteine'), 'CYX': ResidueType('C', 'CYX', 'Cysteine'), 'D': ResidueType('D', 'ASP', 'Aspartic acid'), 'DAH': ResidueType('F', 'DAH', 'Phenylalanine'), 'DAL': ResidueType('X', 'DAL', 'Alanine'), 'DAR': ResidueType('X', 'DAR', 'Arginine'), 'DAS': ResidueType('X', 'DAS', 'Aspartic acid'), 'DCY': ResidueType('X', 'DCY', 'Cysteine'), 'DGL': ResidueType('X', 'DGL', 'Glutamic acid'), 'DGN': ResidueType('X', 'DGN', 'Glutamine'), 'DHA': ResidueType('A', 'DHA', 'Alanine'), 'DHI': ResidueType('X', 'DHI', 'Histidine'), 'DIL': ResidueType('X', 'DIL', 'Isoleucine'), 'DIV': ResidueType('V', 'DIV', 'Valine'), 'DLE': ResidueType('X', 'DLE', 'Leucine'), 'DLY': ResidueType('X', 'DLY', 'Lysine'), 'DNP': ResidueType('A', 'DNP', 'Alanine'), 'DPN': ResidueType('X', 'DPN', 'Phenylalanine'), 'DPR': ResidueType('X', 'DPR', 'Proline'), 'DSG': ResidueType('X', 'DSG', 'Asparagine'), 'DSN': ResidueType('X', 'DSN', 'Serine'), 'DSP': ResidueType('D', 'DSP', 'Aspartic acid'), 'DTH': ResidueType('X', 'DTH', 'Threonine'), 'DTR': ResidueType('X', 'DTR', 'Tryptophan'), 'DTY': ResidueType('X', 'DTY', 'Tyrosine'), 'DVA': ResidueType('X', 'DVA', 'Valine'), 'E': ResidueType('E', 'GLU', 'Glutamic acid'), 'EFC': ResidueType('C', 'EFC', 'Cysteine'), 'F': ResidueType('F', 'PHE', 'Phenylalanine'), 'FCO': ResidueType('X', 'FCO', 'Capping Group'), 'FLA': ResidueType('A', 'FLA', 'Alanine'), 'FME': ResidueType('M', 'FME', 'Methionine'), 'G': ResidueType('G', 'GLY', 'Glycine'), 'GGL': ResidueType('E', 'GGL', 'Glutamic acid'), 'GL3': ResidueType('G', 'GL3', 'Glycine'), 'GLH': ResidueType('E', 'GLH', 'Glutamic acid'), 'GLN': ResidueType('Q', 'GLN', 'Glutamine'), 'GLU': ResidueType('E', 'GLU', 'Glutamic acid'), 'GLY': ResidueType('G', 'GLY', 'Glycine'), 'GLZ': ResidueType('G', 'GLZ', 'Glycine'), 'GMA': ResidueType('E', 'GMA', 'Glutamic acid'), 'GSC': ResidueType('G', 'GSC', 'Glycine'), 'H': ResidueType('H', 'HIS', 'Histidine'), 'HAC': ResidueType('A', 'HAC', 'Alanine'), 'HAR': ResidueType('R', 'HAR', 'Arginine'), 'HIC': ResidueType('H', 'HIC', 'Histidine'), 'HID': ResidueType('H', 'HID', 'Histidine'), 'HIE': ResidueType('H', 'HIE', 'Histidine'), 'HIP': ResidueType('H', 'HIP', 'Histidine'), 'HIS': ResidueType('H', 'HIS', 'Histidine'), 'HMR': ResidueType('R', 'HMR', 'Arginine'), 'HPQ': ResidueType('F', 'HPQ', 'Phenylalanine'), 'HSD': ResidueType('H', 'HSD', 'Histidine'), 'HSE': ResidueType('H', 'HSE', 'Histidine'), 'HSP': ResidueType('H', 'HSP', 'Histidine'), 'HTR': ResidueType('W', 'HTR', 'Tryptophan'), 'HYP': ResidueType('X', 'HYP', 'Proline'), 'I': ResidueType('I', 'ILE', 'Isoleucine'), 'IIL': ResidueType('I', 'IIL', 'Isoleucine'), 'ILE': ResidueType('I', 'ILE', 'Isoleucine'), 'IND': ResidueType('X', 'IND', 'Capping Group'), 'IYR': ResidueType('Y', 'IYR', 'Tyrosine'), 'K': ResidueType('K', 'LYS', 'Lysine'), 'KCX': ResidueType('K', 'KCX', 'Lysine'), 'L': ResidueType('L', 'LEU', 'Leucine'), 'LEU': ResidueType('L', 'LEU', 'Leucine'), 'LLP': ResidueType('K', 'LLP', 'Lysine'), 'LLY': ResidueType('K', 'LLY', 'Lysine'), 'LTR': ResidueType('W', 'LTR', 'Tryptophan'), 'LYM': ResidueType('K', 'LYM', 'Lysine'), 'LYN': ResidueType('K', 'LYN', 'Lysine'), 'LYS': ResidueType('K', 'LYS', 'Lysine'), 'LYZ': ResidueType('K', 'LYZ', 'Lysine'), 'M': ResidueType('M', 'MET', 'Methionine'), 'MAA': ResidueType('A', 'MAA', 'Alanine'), 'MEN': ResidueType('N', 'MEN', 'Asparagine'), 'MET': ResidueType('M', 'MET', 'Methionine'), 'MHS': ResidueType('H', 'MHS', 'Histidine'), 'MIS': ResidueType('S', 'MIS', 'Serine'), 'MLE': ResidueType('L', 'MLE', 'Leucine'), 'MMO': ResidueType('R', 'MMO', 'Arginine'), 'MPA': ResidueType('X', 'MPA', 'Capping Group'), 'MPQ': ResidueType('G', 'MPQ', 'Glycine'), 'MSA': ResidueType('G', 'MSA', 'Glycine'), 'MSE': ResidueType('M', 'MSE', 'Methionine'), 'MVA': ResidueType('V', 'MVA', 'Valine'), 'N': ResidueType('N', 'ASN', 'Asparagine'), 'NCO': ResidueType('X', 'NCO', 'Capping Group'), 'NEM': ResidueType('H', 'NEM', 'Histidine'), 'NEP': ResidueType('H', 'NEP', 'Histidine'), 'NH2': ResidueType('X', 'NH2', 'Capping Group'), 'NLE': ResidueType('X', 'NLE', 'Leucine'), 'NLN': ResidueType('L', 'NLN', 'Leucine'), 'NLP': ResidueType('L', 'NLP', 'Leucine'), 'NMA': ResidueType('X', 'NMA', 'Capping Group'), 'NMC': ResidueType('G', 'NMC', 'Glycine'), 'OAS': ResidueType('S', 'OAS', 'Serine'), 'OCS': ResidueType('C', 'OCS', 'Cysteine'), 'OMT': ResidueType('M', 'OMT', 'Methionine'), 'P': ResidueType('P', 'PRO', 'Proline'), 'PAQ': ResidueType('Y', 'PAQ', 'Tyrosine'), 'PCA': ResidueType('E', 'PCA', 'Glutamic acid'), 'PEC': ResidueType('C', 'PEC', 'Cysteine'), 'PHE': ResidueType('F', 'PHE', 'Phenylalanine'), 'PHI': ResidueType('F', 'PHI', 'Phenylalanine'), 'PHL': ResidueType('F', 'PHL', 'Phenylalanine'), 'PR3': ResidueType('C', 'PR3', 'Cysteine'), 'PRO': ResidueType('P', 'PRO', 'Proline'), 'PRR': ResidueType('A', 'PRR', 'Alanine'), 'PTR': ResidueType('y', 'PTR', 'Tyrosine'), 'Q': ResidueType('Q', 'GLN', 'Glutamine'), 'R': ResidueType('R', 'ARG', 'Arginine'), 'S': ResidueType('S', 'SER', 'Serine'), 'SAC': ResidueType('S', 'SAC', 'Serine'), 'SAR': ResidueType('G', 'SAR', 'Glycine'), 'SCH': ResidueType('C', 'SCH', 'Cysteine'), 'SCS': ResidueType('C', 'SCS', 'Cysteine'), 'SCY': ResidueType('C', 'SCY', 'Cysteine'), 'SEL': ResidueType('S', 'SEL', 'Serine'), 'SEP': ResidueType('X', 'SEP', 'Serine'), 'SER': ResidueType('S', 'SER', 'Serine'), 'SET': ResidueType('S', 'SET', 'Serine'), 'SHC': ResidueType('C', 'SHC', 'Cysteine'), 'SHR': ResidueType('K', 'SHR', 'Lysine'), 'SMC': ResidueType('C', 'SMC', 'Cysteine'), 'SOC': ResidueType('C', 'SOC', 'Cysteine'), 'STY': ResidueType('Y', 'STY', 'Tyrosine'), 'SVA': ResidueType('S', 'SVA', 'Serine'), 'T': ResidueType('T', 'THR', 'Threonine'), 'THO': ResidueType('T', 'THO', 'Threonine'), 'THR': ResidueType('T', 'THR', 'Threonine'), 'TIH': ResidueType('A', 'TIH', 'Alanine'), 'TOSG': ResidueType('X', 'TOSG', 'Capping Group'), 'TPL': ResidueType('W', 'TPL', 'Tryptophan'), 'TPO': ResidueType('t', 'TPO', 'Threonine'), 'TPQ': ResidueType('A', 'TPQ', 'Alanine'), 'TRG': ResidueType('K', 'TRG', 'Lysine'), 'TRO': ResidueType('W', 'TRO', 'Tryptophan'), 'TRP': ResidueType('W', 'TRP', 'Tryptophan'), 'TYB': ResidueType('Y', 'TYB', 'Tyrosine'), 'TYM': ResidueType('Y', 'TYM', 'Tyrosine'), 'TYO': ResidueType('Y', 'TYO', 'Tyrosine'), 'TYQ': ResidueType('Y', 'TYQ', 'Tyrosine'), 'TYR': ResidueType('Y', 'TYR', 'Tyrosine'), 'TYS': ResidueType('Y', 'TYS', 'Tyrosine'), 'TYY': ResidueType('Y', 'TYY', 'Tyrosine'), 'UNK': ResidueType('X', 'UNK', 'Unknown'), 'V': ResidueType('V', 'VAL', 'Valine'), 'VAL': ResidueType('V', 'VAL', 'Valine'), 'W': ResidueType('W', 'TRP', 'Tryptophan'), 'Y': ResidueType('Y', 'TYR', 'Tyrosine')}
__init__(elements, name='', origin=None, entry_id='', entry_name='', pdb_id='', chain='', structure_chain=None, title='')

Make a sequence object from a list of strings and/or self.ElementClass

Strings are converted to self.ElementClass using a mapping of strings to element types.

Parameters:
  • elements (iterable(self.ElementClass) or iterable(str)) – An iterable of elements making up the sequence
  • name (basestring) – The name of the sequence
  • entry_id (str) – An entry associated with the sequence, if any
  • entry_name (str) – An entry name associated with the sequence, if any
  • pdb_id (str) – An id associated with the sequence, if any
  • chain (str) – The chain to which the sequence belongs
  • structure_chain (str) – The chain of the structure this sequence is associated with. This is usually the same as chain if the sequence has a structure but isn’t necessarily.
  • title (str) – The title for the sequence
Raises:

ValueError – If the unknown_res_type is None and an unrecognized character is encountered in the element list

removeStructurelessResidues(start=0, end=None)

Remove any structureless residues

Parameters:
  • start (int) – The index at which to start filtering structureless residues.
  • end (int) – The index at which to end filtering
disulfide_bonds
Returns:A sorted tuple of the valid disulfide bonds.
Return type:tuple(residue.DisulfideBond)
toJsonImplementation()

Abstract method that must be defined by all derived classes. Converts an instance of the derived class into a jsonifiable object.

Returns:A dict made up of JSON native datatypes or Jsonable objects. See the link below for a table of such types. https://docs.python.org/2/library/json.html#encoders-and-decoders
classmethod fromJsonImplementation(json_obj)

Abstract method that must be defined by all derived classes. Takes in a dictionary and constructs an instance of the derived class.

Parameters:json_dict (dict) – A dictionary loaded from a JSON string or file.
Returns:An instance of the derived class.

:rtype : cls

secondary_structures

A list of _SecondaryStructure namedtuples containing the type of secondary structure and where the secondary structures begin and end.

Returns:A list of namedtuples containing an SS_TYPE from schrodinger.structure and the residue indexes marking the limits of the secondary structure.
Return type:list(namedtuple(int, (int,int)))
encodeForPatternSearch(with_ss=False, with_flex=False, with_asa=False)

Convert to sequence dict expected by find_generalized_pattern.

Parameters:
  • with_ss (bool) – Whether to include secondary structure information.
  • with_flex (bool) – Whether to include flexibility information.
  • with_asa (bool) – Whether to include accessible surface area information.
Return type:

dict

Returns:

dictionary of sequence data

classmethod isValid(elements)
Parameters:elements (iterable(str) or str) – An iterable of string representations of elements making up the sequence
Returns:Tuple indicating whether valid and a set of invalid characters, if any
Return type:tuple(bool, set(str))
hydrophobicity_window_padding
isoelectric_point_window_padding
clearAllCaching()

This method should be implemented in subclasses that cache any data.

class ORIGIN

Bases: enum.Enum

An enumeration.

MAESTRO = 1
PYMOL = 2
__class__

alias of enum.EnumMeta

__members__ = mappingproxy(OrderedDict([('MAESTRO', <ORIGIN.MAESTRO: 1>), ('PYMOL', <ORIGIN.PYMOL: 2>)]))
__module__ = 'schrodinger.protein.sequence'
__bool__()
__class__

alias of sip.wrappertype

__contains__(item)
__copy__()
__deepcopy__(memo)
__delattr__

Implement delattr(self, name).

__delitem__(index)
__dict__ = mappingproxy({'__module__': 'schrodinger.protein.sequence', 'AnnotationClass': <class 'schrodinger.protein.annotation.ProteinSequenceAnnotations'>, 'ElementClass': <class 'schrodinger.protein.residue.Residue'>, 'alphabet': {'A': ResidueType('A', 'ALA', 'Alanine'), 'C': ResidueType('C', 'CYS', 'Cysteine'), 'D': ResidueType('D', 'ASP', 'Aspartic acid'), 'E': ResidueType('E', 'GLU', 'Glutamic acid'), 'F': ResidueType('F', 'PHE', 'Phenylalanine'), 'G': ResidueType('G', 'GLY', 'Glycine'), 'H': ResidueType('H', 'HIS', 'Histidine'), 'I': ResidueType('I', 'ILE', 'Isoleucine'), 'K': ResidueType('K', 'LYS', 'Lysine'), 'L': ResidueType('L', 'LEU', 'Leucine'), 'M': ResidueType('M', 'MET', 'Methionine'), 'N': ResidueType('N', 'ASN', 'Asparagine'), 'P': ResidueType('P', 'PRO', 'Proline'), 'Q': ResidueType('Q', 'GLN', 'Glutamine'), 'R': ResidueType('R', 'ARG', 'Arginine'), 'S': ResidueType('S', 'SER', 'Serine'), 'T': ResidueType('T', 'THR', 'Threonine'), 'V': ResidueType('V', 'VAL', 'Valine'), 'W': ResidueType('W', 'TRP', 'Tryptophan'), 'Y': ResidueType('Y', 'TYR', 'Tyrosine'), 'ALA': ResidueType('A', 'ALA', 'Alanine'), 'CYS': ResidueType('C', 'CYS', 'Cysteine'), 'ASP': ResidueType('D', 'ASP', 'Aspartic acid'), 'GLU': ResidueType('E', 'GLU', 'Glutamic acid'), 'PHE': ResidueType('F', 'PHE', 'Phenylalanine'), 'GLY': ResidueType('G', 'GLY', 'Glycine'), 'HIS': ResidueType('H', 'HIS', 'Histidine'), 'ILE': ResidueType('I', 'ILE', 'Isoleucine'), 'LYS': ResidueType('K', 'LYS', 'Lysine'), 'LEU': ResidueType('L', 'LEU', 'Leucine'), 'MET': ResidueType('M', 'MET', 'Methionine'), 'ASN': ResidueType('N', 'ASN', 'Asparagine'), 'PRO': ResidueType('P', 'PRO', 'Proline'), 'GLN': ResidueType('Q', 'GLN', 'Glutamine'), 'ARG': ResidueType('R', 'ARG', 'Arginine'), 'SER': ResidueType('S', 'SER', 'Serine'), 'THR': ResidueType('T', 'THR', 'Threonine'), 'VAL': ResidueType('V', 'VAL', 'Valine'), 'TRP': ResidueType('W', 'TRP', 'Tryptophan'), 'TYR': ResidueType('Y', 'TYR', 'Tyrosine'), 'AIB': ResidueType('A', 'AIB', 'Alanine'), 'ALM': ResidueType('A', 'ALM', 'Alanine'), 'AYA': ResidueType('A', 'AYA', 'Alanine'), 'BNN': ResidueType('A', 'BNN', 'Alanine'), 'CHG': ResidueType('A', 'CHG', 'Alanine'), 'CSD': ResidueType('A', 'CSD', 'Alanine'), 'DAL': ResidueType('X', 'DAL', 'Alanine'), 'DHA': ResidueType('A', 'DHA', 'Alanine'), 'DNP': ResidueType('A', 'DNP', 'Alanine'), 'FLA': ResidueType('A', 'FLA', 'Alanine'), 'HAC': ResidueType('A', 'HAC', 'Alanine'), 'MAA': ResidueType('A', 'MAA', 'Alanine'), 'PRR': ResidueType('A', 'PRR', 'Alanine'), 'TIH': ResidueType('A', 'TIH', 'Alanine'), 'TPQ': ResidueType('A', 'TPQ', 'Alanine'), 'AGM': ResidueType('R', 'AGM', 'Arginine'), 'DAR': ResidueType('X', 'DAR', 'Arginine'), 'HAR': ResidueType('R', 'HAR', 'Arginine'), 'MMO': ResidueType('R', 'MMO', 'Arginine'), 'ARM': ResidueType('R', 'ARM', 'Arginine'), 'ARN': ResidueType('R', 'ARN', 'Arginine'), 'HMR': ResidueType('R', 'HMR', 'Arginine'), 'ACL': ResidueType('R', 'ACL', 'Arginine'), 'MEN': ResidueType('N', 'MEN', 'Asparagine'), 'DSG': ResidueType('X', 'DSG', 'Asparagine'), 'DSP': ResidueType('D', 'DSP', 'Aspartic acid'), 'BHD': ResidueType('D', 'BHD', 'Aspartic acid'), '2AS': ResidueType('D', '2AS', 'Aspartic acid'), 'ASQ': ResidueType('D', 'ASQ', 'Aspartic acid'), 'ASB': ResidueType('D', 'ASB', 'Aspartic acid'), 'ASA': ResidueType('D', 'ASA', 'Aspartic acid'), 'ASK': ResidueType('D', 'ASK', 'Aspartic acid'), 'ASH': ResidueType('D', 'ASH', 'Aspartic acid'), 'ASL': ResidueType('D', 'ASL', 'Aspartic acid'), 'DAS': ResidueType('X', 'DAS', 'Aspartic acid'), 'BCS': ResidueType('X', 'BCS', 'Cysteine'), 'BUC': ResidueType('C', 'BUC', 'Cysteine'), 'C5C': ResidueType('C', 'C5C', 'Cysteine'), 'C6C': ResidueType('C', 'C6C', 'Cysteine'), 'CCS': ResidueType('C', 'CCS', 'Cysteine'), 'CEA': ResidueType('C', 'CEA', 'Cysteine'), 'CME': ResidueType('C', 'CME', 'Cysteine'), 'CSO': ResidueType('C', 'CSO', 'Cysteine'), 'CSP': ResidueType('C', 'CSP', 'Cysteine'), 'CSS': ResidueType('C', 'CSS', 'Cysteine'), 'CSW': ResidueType('C', 'CSW', 'Cysteine'), 'CSX': ResidueType('C', 'CSX', 'Cysteine'), 'CY1': ResidueType('C', 'CY1', 'Cysteine'), 'CY3': ResidueType('C', 'CY3', 'Cysteine'), 'CYG': ResidueType('C', 'CYG', 'Cysteine'), 'CYM': ResidueType('C', 'CYM', 'Cysteine'), 'CYP': ResidueType('C', 'CYP', 'Cysteine'), 'CYQ': ResidueType('C', 'CYQ', 'Cysteine'), 'CYX': ResidueType('C', 'CYX', 'Cysteine'), 'DCY': ResidueType('X', 'DCY', 'Cysteine'), 'EFC': ResidueType('C', 'EFC', 'Cysteine'), 'OCS': ResidueType('C', 'OCS', 'Cysteine'), 'PEC': ResidueType('C', 'PEC', 'Cysteine'), 'PR3': ResidueType('C', 'PR3', 'Cysteine'), 'SCH': ResidueType('C', 'SCH', 'Cysteine'), 'SCS': ResidueType('C', 'SCS', 'Cysteine'), 'SCY': ResidueType('C', 'SCY', 'Cysteine'), 'SHC': ResidueType('C', 'SHC', 'Cysteine'), 'SMC': ResidueType('C', 'SMC', 'Cysteine'), 'SOC': ResidueType('C', 'SOC', 'Cysteine'), 'GLH': ResidueType('E', 'GLH', 'Glutamic acid'), 'GGL': ResidueType('E', 'GGL', 'Glutamic acid'), 'PCA': ResidueType('E', 'PCA', 'Glutamic acid'), '5HP': ResidueType('E', '5HP', 'Glutamic acid'), 'DGL': ResidueType('X', 'DGL', 'Glutamic acid'), 'CGU': ResidueType('E', 'CGU', 'Glutamic acid'), 'GMA': ResidueType('E', 'GMA', 'Glutamic acid'), 'DGN': ResidueType('X', 'DGN', 'Glutamine'), 'GLZ': ResidueType('G', 'GLZ', 'Glycine'), 'SAR': ResidueType('G', 'SAR', 'Glycine'), 'NMC': ResidueType('G', 'NMC', 'Glycine'), 'GL3': ResidueType('G', 'GL3', 'Glycine'), 'GSC': ResidueType('G', 'GSC', 'Glycine'), 'MPQ': ResidueType('G', 'MPQ', 'Glycine'), 'MSA': ResidueType('G', 'MSA', 'Glycine'), 'DHI': ResidueType('X', 'DHI', 'Histidine'), 'HID': ResidueType('H', 'HID', 'Histidine'), 'HIC': ResidueType('H', 'HIC', 'Histidine'), 'HIE': ResidueType('H', 'HIE', 'Histidine'), 'HIP': ResidueType('H', 'HIP', 'Histidine'), 'HSD': ResidueType('H', 'HSD', 'Histidine'), 'HSE': ResidueType('H', 'HSE', 'Histidine'), 'HSP': ResidueType('H', 'HSP', 'Histidine'), 'MHS': ResidueType('H', 'MHS', 'Histidine'), 'NEM': ResidueType('H', 'NEM', 'Histidine'), 'NEP': ResidueType('H', 'NEP', 'Histidine'), '3AH': ResidueType('H', '3AH', 'Histidine'), 'DIL': ResidueType('X', 'DIL', 'Isoleucine'), 'IIL': ResidueType('I', 'IIL', 'Isoleucine'), 'BUG': ResidueType('L', 'BUG', 'Leucine'), 'NLE': ResidueType('X', 'NLE', 'Leucine'), 'NLP': ResidueType('L', 'NLP', 'Leucine'), 'NLN': ResidueType('L', 'NLN', 'Leucine'), 'DLE': ResidueType('X', 'DLE', 'Leucine'), 'CLE': ResidueType('L', 'CLE', 'Leucine'), 'MLE': ResidueType('L', 'MLE', 'Leucine'), 'LYM': ResidueType('K', 'LYM', 'Lysine'), 'ALY': ResidueType('K', 'ALY', 'Lysine'), 'LYZ': ResidueType('K', 'LYZ', 'Lysine'), 'LYN': ResidueType('K', 'LYN', 'Lysine'), 'LLY': ResidueType('K', 'LLY', 'Lysine'), 'LLP': ResidueType('K', 'LLP', 'Lysine'), 'SHR': ResidueType('K', 'SHR', 'Lysine'), 'TRG': ResidueType('K', 'TRG', 'Lysine'), 'DLY': ResidueType('X', 'DLY', 'Lysine'), 'KCX': ResidueType('K', 'KCX', 'Lysine'), 'FME': ResidueType('M', 'FME', 'Methionine'), 'CXM': ResidueType('M', 'CXM', 'Methionine'), 'OMT': ResidueType('M', 'OMT', 'Methionine'), 'MSE': ResidueType('M', 'MSE', 'Methionine'), 'DAH': ResidueType('F', 'DAH', 'Phenylalanine'), 'DPN': ResidueType('X', 'DPN', 'Phenylalanine'), 'HPQ': ResidueType('F', 'HPQ', 'Phenylalanine'), 'PHI': ResidueType('F', 'PHI', 'Phenylalanine'), 'PHL': ResidueType('F', 'PHL', 'Phenylalanine'), 'DPR': ResidueType('X', 'DPR', 'Proline'), 'HYP': ResidueType('X', 'HYP', 'Proline'), 'OAS': ResidueType('S', 'OAS', 'Serine'), 'MIS': ResidueType('S', 'MIS', 'Serine'), 'SAC': ResidueType('S', 'SAC', 'Serine'), 'SVA': ResidueType('S', 'SVA', 'Serine'), 'SET': ResidueType('S', 'SET', 'Serine'), 'SEP': ResidueType('X', 'SEP', 'Serine'), 'SEL': ResidueType('S', 'SEL', 'Serine'), 'DSN': ResidueType('X', 'DSN', 'Serine'), 'ALO': ResidueType('T', 'ALO', 'Threonine'), 'BMT': ResidueType('T', 'BMT', 'Threonine'), 'DTH': ResidueType('X', 'DTH', 'Threonine'), 'THO': ResidueType('T', 'THO', 'Threonine'), 'TPO': ResidueType('t', 'TPO', 'Threonine'), 'DTR': ResidueType('X', 'DTR', 'Tryptophan'), 'HTR': ResidueType('W', 'HTR', 'Tryptophan'), 'LTR': ResidueType('W', 'LTR', 'Tryptophan'), 'TPL': ResidueType('W', 'TPL', 'Tryptophan'), 'TRO': ResidueType('W', 'TRO', 'Tryptophan'), 'DTY': ResidueType('X', 'DTY', 'Tyrosine'), 'IYR': ResidueType('Y', 'IYR', 'Tyrosine'), 'PAQ': ResidueType('Y', 'PAQ', 'Tyrosine'), 'PTR': ResidueType('y', 'PTR', 'Tyrosine'), 'STY': ResidueType('Y', 'STY', 'Tyrosine'), 'TYB': ResidueType('Y', 'TYB', 'Tyrosine'), 'TYM': ResidueType('Y', 'TYM', 'Tyrosine'), 'TYO': ResidueType('Y', 'TYO', 'Tyrosine'), 'TYQ': ResidueType('Y', 'TYQ', 'Tyrosine'), 'TYS': ResidueType('Y', 'TYS', 'Tyrosine'), 'TYY': ResidueType('Y', 'TYY', 'Tyrosine'), 'DIV': ResidueType('V', 'DIV', 'Valine'), 'DVA': ResidueType('X', 'DVA', 'Valine'), 'MVA': ResidueType('V', 'MVA', 'Valine'), 'UNK': ResidueType('X', 'UNK', 'Unknown'), 'ACE': ResidueType('X', 'ACE', 'Capping Group'), 'NMA': ResidueType('X', 'NMA', 'Capping Group'), 'IND': ResidueType('X', 'IND', 'Capping Group'), 'NCO': ResidueType('X', 'NCO', 'Capping Group'), 'ANF': ResidueType('X', 'ANF', 'Capping Group'), 'TOSG': ResidueType('X', 'TOSG', 'Capping Group'), 'FCO': ResidueType('X', 'FCO', 'Capping Group'), 'MPA': ResidueType('X', 'MPA', 'Capping Group'), 'NH2': ResidueType('X', 'NH2', 'Capping Group')}, '_gap_chars': ['~', '-', '.'], '__init__': <function ProteinSequence.__init__>, '_res_format_code': <function ProteinSequence._res_format_code>, 'removeStructurelessResidues': <function ProteinSequence.removeStructurelessResidues>, 'disulfide_bonds': <property object>, 'toJsonImplementation': <function ProteinSequence.toJsonImplementation>, 'fromJsonImplementation': <classmethod object>, '_invalidateSecondaryStructure': <function ProteinSequence._invalidateSecondaryStructure>, '_updateSecondaryStructure': <function ProteinSequence._updateSecondaryStructure>, 'secondary_structures': <property object>, '_invalidatePatternSeqDict': <function ProteinSequence._invalidatePatternSeqDict>, 'encodeForPatternSearch': <function ProteinSequence.encodeForPatternSearch>, 'isValid': <classmethod object>, 'hydrophobicity_window_padding': <property object>, 'isoelectric_point_window_padding': <property object>, 'clearAllCaching': <function ProteinSequence.clearAllCaching>, '__doc__': None, '_ProteinSequence_jsonAdapters': []})
__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattr__(self, str) → object
__getattribute__

Return getattr(self, name).

__getitem__(index)
__gt__

Return self>value.

__hash__

Return hash(self).

classmethod __init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__iter__()
__le__

Return self<=value.

__len__()
__lt__

Return self<value.

__module__ = 'schrodinger.protein.sequence'
__ne__

Return self!=value.

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__()

Returns a representation of the instance that can be pasted into a repl

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__str__()

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

addGapsBeforeIndices(indices)

Add one gap to the alignment before each of the specified residue positions. Note that these indices are based on numbering before the insertion. To insert gaps using indices based on numbering after the insertion, see addGapsByIndices.

Parameters:indices (list(int)) – A list of indices to insert gaps before.
addGapsByIndices(gap_idxs)

Add gaps to the sequence from a list of gap indices. Note that these indices are based on numbering after the insertion. To insert gaps using indices based on numbering before the insertion, see addGapsBeforeIndices.

Parameters:gap_idxs (list(int)) – A list of gap indices
annotationTitleChanged
append(element)

Appends an element to the sequence

Parameters:element – The element to append to this sequence
Type:element: self.ElementClass or basestring
blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → object
connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
deleteLater(self)
destroyed

destroyed(self, QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → object
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
extend(elements)

Extends the sequence with elements from an iterable

Parameters:elements (iterable(self.ElementClass) or iterable(str)) – The iterable containing elements with which to extend this sequence
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters:json_obj (dict) – A json-loaded dictionary to create an object from.
Returns:An instance of this class.

:rtype : cls

fullname
Returns:a formatted name + optional chain name for the sequence
Return type:str
gap_char
getAnnotation(index, annotation)

Returns the annotation at the specified index or None for a gap.

Raises:ValueError – if the annotation is not available
getConservation(reference, consider_gaps=True)

Return a float scoring the homology conservation between the sequence and a reference sequence, assuming that they’re already aligned.

The homology criterion is based on “side chain chemistry” descriptor matching.

Parameters:
Returns:

The sequence conservation score (between 0.0 and 1.0)

Return type:

float

getGapCount()
Returns:the number of gaps in the sequence
Return type:int
getGaplessLength()
Returns:Length of this sequence ignoring gaps
Return type:int
getGaps()
Return type:list(residue.Gap)
Returns:The gaps in the sequence.
getIdentity(reference, consider_gaps=True)

Return a float scoring the identity between the sequence and a reference sequence, assuming that they’re already aligned

Parameters:
Returns:

The sequence identity score (between 0.0 and 1.0)

Return type:

float

getNextResidue(res)

Return the next residue in the sequence (ignoring gaps) or None if this is the last residue.

Parameters:res (schrodinger.protein.residue.Residue) – A given residue in the sequence
Returns:The previous residue in the sequence
Return type:schrodinger.protein.residue.Residue
getNumResidues()

Return the number of residues in the sequence, that is, the length of the sequence without gaps

Return type:int
Returns:The number of residues in the sequence
getPreviousResidue(res)

Return the previous residue in the sequence (ignoring gaps) or None if this is the first residue.

Parameters:res (schrodinger.protein.residue.Residue) – A given residue in the sequence
Returns:The previous residue in the sequence
Return type:schrodinger.protein.residue.Residue
getSimilarity(reference, consider_gaps=True)

Return a float score of the similarity count between the sequence and a reference sequence, assuming that they’re already aligned.

Parameters:
Returns:

The sequence similarity score (between 0.0 and 1.0)

Return type:

float

getSimilarityScore(reference)

Return the total score of similarity between the sequence and a reference sequence, assuming that they’re already aligned.

Since the similarity with a gap will always be 0.0, there is no need to consider gaps.

Parameters:reference (schrodinger.protein.sequence.Sequence) – A sequence to compare against
Returns:The total sequence similarity score
Return type:float
getStructure()
Returns:The associated structure. Will return None if there is no associated structure.
Return type:schrodinger.structure.Structure or NoneType
getSubsequence(start, end)

Return a sequence containing a subset of the elements in this one

Parameters:
  • start (int) – The index at which the subsequence should start
  • end (int) – The index at which the subsequence should end (exclusive)
Return type:

Sequence

Returns:

A sequence

getSummary()

Returns a friendly, readable summary of the sequence

Return type:basestring
Returns:A summary of the sequence
getTerminalGaps()

Return terminal gaps.

Returns:A list of terminal gaps (in ascending index order)
Return type:list(residue.Gap)
get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

hasStructure()
Returns:Whether this sequence has an associated structure.
Return type:bool
index(res, ignore_gaps=False)

Returns the index of the specified residue

Parameters:
  • res (schrodinger.structure._Residue) – The residue to find
  • ignore_gaps (bool) – Whether the index returned should ignore gaps in the sequence or not.
Raises:

A Value error if the residue is not present or if the res is None

Return type:

int

Returns:

The index of the residue

inherits(self, str) → bool
insertElements(index, elements)

Insert a list of elements or sequence element into this sequence.

Parameters:
  • index (int) – The index at which to insert elements
  • elements (iterable(self.ElementClass) or iterable(str)) – A list of elements to insert
installEventFilter(self, QObject)
isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
iterNeighbors()

Return an iterable of three element tuples consisting of (prev_res, curr_res, next_res), ignoring gaps.

None is used for neighbors of first and last residues in the sequence, and does not indicate gaps here.

Returns:Iterable of 3-tuples, each element of the each tuple being either a schrodinger.protein.residue.Residue or None
Return type:iter(tuple(Residue or NoneType, Residue, Residue or NoneType))
iterResidues()

Return an iterable of residues, ignoring gaps.

Returns:Iterable of residues
Return type:iter(Residue)
killTimer(self, int)
lengthAboutToChange
lengthChanged
classmethod makeSeqElement(element)
Parameters:element (str or cls.ElementClass) – A sequence element or string representation thereof
Returns:sequence element
Return type:cls.ElementClass
Raises:ValueError – If an element is not in cls.alphabet and cls._unknown_res_type is not defined
metaObject(self) → QMetaObject
moveToThread(self, QThread)
mutate(start, end, elements)

Mutate sequence elements starting at the given index to the provided elements.

Parameters:
  • start (int) – The index at which to start mutating
  • end (int) – The index of the last mutated element (exclusive)
  • elements (iterable(self.ElementClass) or iterable(str)) – The elements to which to mutate the sequence
name
nameChanged
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

onStructureChanged()
origin
Returns:A piece of metadata indicating where the sequence came from
Rtype origin:Sequence.ORIGIN or None
parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeAllGaps()

Remove gaps from the sequence

removeElements(eles)

Remove elements from the sequence.

Parameters:eles (list(residue.AbstractSequenceElement)) – A list of elements to remove from the sequence.
Raises:ValueError – If any of the given elements are not in the sequence.
removeEventFilter(self, QObject)
removeTerminalGaps()

Remove gaps from the end of the sequence

residuesChanged
sanitize(start=0, end=None)

Remove gaps and unknown sequence elements from sequence

sender(self) → QObject
senderSignalIndex(self) → int
sequenceCopied
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
setStructure(struc)

Set the associated structure. Can only be used on sequences with an associated structure.

Parameters:struc (schrodinger.structure.Structure) – The new structure for this sequence
Raises:RuntimeError – If there’s no structure associated with this sequence object.
signalsBlocked(self) → bool
startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
structureChanged
thread(self) → QThread
timerEvent(self, QTimerEvent)
toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type:An instance of one the classes from NATIVE_JSON_DATATYPES
tr(self, str, disambiguation: str = None, n: int = -1) → str
visibility
visibilityChanged
class schrodinger.protein.sequence.NucleicAcidSequence(elements, **kwargs)

Bases: schrodinger.protein.sequence.ProteinSequence

AnnotationClass

alias of schrodinger.protein.annotation.NucleicAcidSequenceAnnotations

ElementClass

alias of schrodinger.protein.residue.Nucleotide

alphabet = {'1CC': NucleotideType('C', '1CC', 'Cytosine'), '1MA': NucleotideType('A', '1MA', 'Adenine'), '1MG': NucleotideType('G', '1MG', 'Guanine'), '2MG': NucleotideType('G', '2MG', 'Guanine'), '5FC': NucleotideType('C', '5FC', 'Cytosine'), '5HC': NucleotideType('C', '5HC', 'Cytosine'), '5MC': NucleotideType('C', '5MC', 'Cytosine'), '5MU': NucleotideType('U', '5MU', 'Uracil'), '6MA': NucleotideType('A', '6MA', 'Adenine'), '7MG': NucleotideType('G', '7MG', 'Guanine'), 'A': NucleotideType('A', 'A', 'Adenine'), 'ADP': NucleotideType('A', 'ADP', 'Adenine'), 'AMP': NucleotideType('A', 'AMP', 'Adenine'), 'ATP': NucleotideType('A', 'ATP', 'Adenine'), 'C': NucleotideType('C', 'C', 'Cytosine'), 'CDP': NucleotideType('C', 'CDP', 'Cytosine'), 'CMP': NucleotideType('C', 'CMP', 'Cytosine'), 'CTP': NucleotideType('C', 'CTP', 'Cytosine'), 'DA': NucleotideType('A', 'DA', 'Adenine'), 'DC': NucleotideType('C', 'DC', 'Cytosine'), 'DG': NucleotideType('G', 'DG', 'Guanine'), 'DI': ResidueType('DI', 'DI', 'Unknown'), 'DT': NucleotideType('T', 'DT', 'Thymine'), 'DU': NucleotideType('U', 'DU', 'Uracil'), 'G': NucleotideType('G', 'G', 'Guanine'), 'GDP': NucleotideType('G', 'GDP', 'Guanine'), 'GMP': NucleotideType('G', 'GMP', 'Guanine'), 'GTP': NucleotideType('G', 'GTP', 'Guanine'), 'H2U': NucleotideType('U', 'H2U', 'Uracil'), 'I': ResidueType('I', 'I', 'Unknown'), 'M2G': NucleotideType('G', 'M2G', 'Guanine'), 'OMC': NucleotideType('C', 'OMC', 'Cytosine'), 'OMG': NucleotideType('G', 'OMG', 'Guanine'), 'PSU': NucleotideType('Ψ', 'PSU', 'Uracil'), 'TDP': NucleotideType('T', 'TDP', 'Thymine'), 'TMP': NucleotideType('T', 'TMP', 'Thymine'), 'TTP': NucleotideType('T', 'TTP', 'Thymine'), 'U': NucleotideType('U', 'U', 'Uracil'), 'UDP': NucleotideType('U', 'UDP', 'Uracil'), 'UMP': NucleotideType('U', 'UMP', 'Uracil'), 'UTP': NucleotideType('U', 'UTP', 'Uracil'), 'YYG': ResidueType('X', 'YYG', 'Unknown')}
__init__(elements, **kwargs)

Make a sequence object from a list of strings and/or self.ElementClass

Strings are converted to self.ElementClass using a mapping of strings to element types.

Parameters:
  • elements (iterable(self.ElementClass) or iterable(str)) – An iterable of elements making up the sequence
  • name (basestring) – The name of the sequence
  • entry_id (str) – An entry associated with the sequence, if any
  • entry_name (str) – An entry name associated with the sequence, if any
  • pdb_id (str) – An id associated with the sequence, if any
  • chain (str) – The chain to which the sequence belongs
  • structure_chain (str) – The chain of the structure this sequence is associated with. This is usually the same as chain if the sequence has a structure but isn’t necessarily.
  • title (str) – The title for the sequence
Raises:

ValueError – If the unknown_res_type is None and an unrecognized character is encountered in the element list

class ORIGIN

Bases: enum.Enum

An enumeration.

MAESTRO = 1
PYMOL = 2
__class__

alias of enum.EnumMeta

__members__ = mappingproxy(OrderedDict([('MAESTRO', <ORIGIN.MAESTRO: 1>), ('PYMOL', <ORIGIN.PYMOL: 2>)]))
__module__ = 'schrodinger.protein.sequence'
__bool__()
__class__

alias of sip.wrappertype

__contains__(item)
__copy__()
__deepcopy__(memo)
__delattr__

Implement delattr(self, name).

__delitem__(index)
__dict__ = mappingproxy({'__module__': 'schrodinger.protein.sequence', 'AnnotationClass': <class 'schrodinger.protein.annotation.NucleicAcidSequenceAnnotations'>, 'ElementClass': <class 'schrodinger.protein.residue.Nucleotide'>, 'alphabet': {'A': NucleotideType('A', 'A', 'Adenine'), 'C': NucleotideType('C', 'C', 'Cytosine'), 'G': NucleotideType('G', 'G', 'Guanine'), 'U': NucleotideType('U', 'U', 'Uracil'), 'DA': NucleotideType('A', 'DA', 'Adenine'), 'DC': NucleotideType('C', 'DC', 'Cytosine'), 'DG': NucleotideType('G', 'DG', 'Guanine'), 'DT': NucleotideType('T', 'DT', 'Thymine'), 'AMP': NucleotideType('A', 'AMP', 'Adenine'), 'ADP': NucleotideType('A', 'ADP', 'Adenine'), 'ATP': NucleotideType('A', 'ATP', 'Adenine'), '1MA': NucleotideType('A', '1MA', 'Adenine'), '6MA': NucleotideType('A', '6MA', 'Adenine'), 'CMP': NucleotideType('C', 'CMP', 'Cytosine'), 'CDP': NucleotideType('C', 'CDP', 'Cytosine'), 'CTP': NucleotideType('C', 'CTP', 'Cytosine'), '5MC': NucleotideType('C', '5MC', 'Cytosine'), '5HC': NucleotideType('C', '5HC', 'Cytosine'), '5FC': NucleotideType('C', '5FC', 'Cytosine'), '1CC': NucleotideType('C', '1CC', 'Cytosine'), 'OMC': NucleotideType('C', 'OMC', 'Cytosine'), 'GMP': NucleotideType('G', 'GMP', 'Guanine'), 'GDP': NucleotideType('G', 'GDP', 'Guanine'), 'GTP': NucleotideType('G', 'GTP', 'Guanine'), '1MG': NucleotideType('G', '1MG', 'Guanine'), '2MG': NucleotideType('G', '2MG', 'Guanine'), 'M2G': NucleotideType('G', 'M2G', 'Guanine'), '7MG': NucleotideType('G', '7MG', 'Guanine'), 'OMG': NucleotideType('G', 'OMG', 'Guanine'), 'UMP': NucleotideType('U', 'UMP', 'Uracil'), 'UDP': NucleotideType('U', 'UDP', 'Uracil'), 'UTP': NucleotideType('U', 'UTP', 'Uracil'), 'PSU': NucleotideType('Ψ', 'PSU', 'Uracil'), 'H2U': NucleotideType('U', 'H2U', 'Uracil'), '5MU': NucleotideType('U', '5MU', 'Uracil'), 'DU': NucleotideType('U', 'DU', 'Uracil'), 'TMP': NucleotideType('T', 'TMP', 'Thymine'), 'TDP': NucleotideType('T', 'TDP', 'Thymine'), 'TTP': NucleotideType('T', 'TTP', 'Thymine'), 'YYG': ResidueType('X', 'YYG', 'Unknown'), 'I': ResidueType('I', 'I', 'Unknown'), 'DI': ResidueType('DI', 'DI', 'Unknown')}, '__init__': <function NucleicAcidSequence.__init__>, '__doc__': None, '_NucleicAcidSequence_jsonAdapters': []})
__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattr__(self, str) → object
__getattribute__

Return getattr(self, name).

__getitem__(index)
__gt__

Return self>value.

__hash__

Return hash(self).

classmethod __init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__iter__()
__le__

Return self<=value.

__len__()
__lt__

Return self<value.

__module__ = 'schrodinger.protein.sequence'
__ne__

Return self!=value.

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__()

Returns a representation of the instance that can be pasted into a repl

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__str__()

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

addGapsBeforeIndices(indices)

Add one gap to the alignment before each of the specified residue positions. Note that these indices are based on numbering before the insertion. To insert gaps using indices based on numbering after the insertion, see addGapsByIndices.

Parameters:indices (list(int)) – A list of indices to insert gaps before.
addGapsByIndices(gap_idxs)

Add gaps to the sequence from a list of gap indices. Note that these indices are based on numbering after the insertion. To insert gaps using indices based on numbering before the insertion, see addGapsBeforeIndices.

Parameters:gap_idxs (list(int)) – A list of gap indices
annotationTitleChanged
append(element)

Appends an element to the sequence

Parameters:element – The element to append to this sequence
Type:element: self.ElementClass or basestring
blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → object
clearAllCaching()

This method should be implemented in subclasses that cache any data.

connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
deleteLater(self)
destroyed

destroyed(self, QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
disulfide_bonds
Returns:A sorted tuple of the valid disulfide bonds.
Return type:tuple(residue.DisulfideBond)
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → object
encodeForPatternSearch(with_ss=False, with_flex=False, with_asa=False)

Convert to sequence dict expected by find_generalized_pattern.

Parameters:
  • with_ss (bool) – Whether to include secondary structure information.
  • with_flex (bool) – Whether to include flexibility information.
  • with_asa (bool) – Whether to include accessible surface area information.
Return type:

dict

Returns:

dictionary of sequence data

event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
extend(elements)

Extends the sequence with elements from an iterable

Parameters:elements (iterable(self.ElementClass) or iterable(str)) – The iterable containing elements with which to extend this sequence
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

classmethod fromJson(json_obj)

A factory method which constructs a new object from a given dict loaded from a json string or file.

Parameters:json_obj (dict) – A json-loaded dictionary to create an object from.
Returns:An instance of this class.

:rtype : cls

classmethod fromJsonImplementation(json_obj)

Abstract method that must be defined by all derived classes. Takes in a dictionary and constructs an instance of the derived class.

Parameters:json_dict (dict) – A dictionary loaded from a JSON string or file.
Returns:An instance of the derived class.

:rtype : cls

fullname
Returns:a formatted name + optional chain name for the sequence
Return type:str
gap_char
getAnnotation(index, annotation)

Returns the annotation at the specified index or None for a gap.

Raises:ValueError – if the annotation is not available
getConservation(reference, consider_gaps=True)

Return a float scoring the homology conservation between the sequence and a reference sequence, assuming that they’re already aligned.

The homology criterion is based on “side chain chemistry” descriptor matching.

Parameters:
Returns:

The sequence conservation score (between 0.0 and 1.0)

Return type:

float

getGapCount()
Returns:the number of gaps in the sequence
Return type:int
getGaplessLength()
Returns:Length of this sequence ignoring gaps
Return type:int
getGaps()
Return type:list(residue.Gap)
Returns:The gaps in the sequence.
getIdentity(reference, consider_gaps=True)

Return a float scoring the identity between the sequence and a reference sequence, assuming that they’re already aligned

Parameters:
Returns:

The sequence identity score (between 0.0 and 1.0)

Return type:

float

getNextResidue(res)

Return the next residue in the sequence (ignoring gaps) or None if this is the last residue.

Parameters:res (schrodinger.protein.residue.Residue) – A given residue in the sequence
Returns:The previous residue in the sequence
Return type:schrodinger.protein.residue.Residue
getNumResidues()

Return the number of residues in the sequence, that is, the length of the sequence without gaps

Return type:int
Returns:The number of residues in the sequence
getPreviousResidue(res)

Return the previous residue in the sequence (ignoring gaps) or None if this is the first residue.

Parameters:res (schrodinger.protein.residue.Residue) – A given residue in the sequence
Returns:The previous residue in the sequence
Return type:schrodinger.protein.residue.Residue
getSimilarity(reference, consider_gaps=True)

Return a float score of the similarity count between the sequence and a reference sequence, assuming that they’re already aligned.

Parameters:
Returns:

The sequence similarity score (between 0.0 and 1.0)

Return type:

float

getSimilarityScore(reference)

Return the total score of similarity between the sequence and a reference sequence, assuming that they’re already aligned.

Since the similarity with a gap will always be 0.0, there is no need to consider gaps.

Parameters:reference (schrodinger.protein.sequence.Sequence) – A sequence to compare against
Returns:The total sequence similarity score
Return type:float
getStructure()
Returns:The associated structure. Will return None if there is no associated structure.
Return type:schrodinger.structure.Structure or NoneType
getSubsequence(start, end)

Return a sequence containing a subset of the elements in this one

Parameters:
  • start (int) – The index at which the subsequence should start
  • end (int) – The index at which the subsequence should end (exclusive)
Return type:

Sequence

Returns:

A sequence

getSummary()

Returns a friendly, readable summary of the sequence

Return type:basestring
Returns:A summary of the sequence
getTerminalGaps()

Return terminal gaps.

Returns:A list of terminal gaps (in ascending index order)
Return type:list(residue.Gap)
get_version()

Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.

hasStructure()
Returns:Whether this sequence has an associated structure.
Return type:bool
hydrophobicity_window_padding
index(res, ignore_gaps=False)

Returns the index of the specified residue

Parameters:
  • res (schrodinger.structure._Residue) – The residue to find
  • ignore_gaps (bool) – Whether the index returned should ignore gaps in the sequence or not.
Raises:

A Value error if the residue is not present or if the res is None

Return type:

int

Returns:

The index of the residue

inherits(self, str) → bool
insertElements(index, elements)

Insert a list of elements or sequence element into this sequence.

Parameters:
  • index (int) – The index at which to insert elements
  • elements (iterable(self.ElementClass) or iterable(str)) – A list of elements to insert
installEventFilter(self, QObject)
isSignalConnected(self, QMetaMethod) → bool
classmethod isValid(elements)
Parameters:elements (iterable(str) or str) – An iterable of string representations of elements making up the sequence
Returns:Tuple indicating whether valid and a set of invalid characters, if any
Return type:tuple(bool, set(str))
isWidgetType(self) → bool
isWindowType(self) → bool
isoelectric_point_window_padding
iterNeighbors()

Return an iterable of three element tuples consisting of (prev_res, curr_res, next_res), ignoring gaps.

None is used for neighbors of first and last residues in the sequence, and does not indicate gaps here.

Returns:Iterable of 3-tuples, each element of the each tuple being either a schrodinger.protein.residue.Residue or None
Return type:iter(tuple(Residue or NoneType, Residue, Residue or NoneType))
iterResidues()

Return an iterable of residues, ignoring gaps.

Returns:Iterable of residues
Return type:iter(Residue)
killTimer(self, int)
lengthAboutToChange
lengthChanged
classmethod makeSeqElement(element)
Parameters:element (str or cls.ElementClass) – A sequence element or string representation thereof
Returns:sequence element
Return type:cls.ElementClass
Raises:ValueError – If an element is not in cls.alphabet and cls._unknown_res_type is not defined
metaObject(self) → QMetaObject
moveToThread(self, QThread)
mutate(start, end, elements)

Mutate sequence elements starting at the given index to the provided elements.

Parameters:
  • start (int) – The index at which to start mutating
  • end (int) – The index of the last mutated element (exclusive)
  • elements (iterable(self.ElementClass) or iterable(str)) – The elements to which to mutate the sequence
name
nameChanged
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

onStructureChanged()
origin
Returns:A piece of metadata indicating where the sequence came from
Rtype origin:Sequence.ORIGIN or None
parent(self) → QObject
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeAllGaps()

Remove gaps from the sequence

removeElements(eles)

Remove elements from the sequence.

Parameters:eles (list(residue.AbstractSequenceElement)) – A list of elements to remove from the sequence.
Raises:ValueError – If any of the given elements are not in the sequence.
removeEventFilter(self, QObject)
removeStructurelessResidues(start=0, end=None)

Remove any structureless residues

Parameters:
  • start (int) – The index at which to start filtering structureless residues.
  • end (int) – The index at which to end filtering
removeTerminalGaps()

Remove gaps from the end of the sequence

residuesChanged
sanitize(start=0, end=None)

Remove gaps and unknown sequence elements from sequence

secondary_structures

A list of _SecondaryStructure namedtuples containing the type of secondary structure and where the secondary structures begin and end.

Returns:A list of namedtuples containing an SS_TYPE from schrodinger.structure and the residue indexes marking the limits of the secondary structure.
Return type:list(namedtuple(int, (int,int)))
sender(self) → QObject
senderSignalIndex(self) → int
sequenceCopied
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
setStructure(struc)

Set the associated structure. Can only be used on sequences with an associated structure.

Parameters:struc (schrodinger.structure.Structure) – The new structure for this sequence
Raises:RuntimeError – If there’s no structure associated with this sequence object.
signalsBlocked(self) → bool
startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
structureChanged
thread(self) → QThread
timerEvent(self, QTimerEvent)
toJson(_mark_version=True)

Create and returns a data structure made up of jsonable items.

Return type:An instance of one the classes from NATIVE_JSON_DATATYPES
toJsonImplementation()

Abstract method that must be defined by all derived classes. Converts an instance of the derived class into a jsonifiable object.

Returns:A dict made up of JSON native datatypes or Jsonable objects. See the link below for a table of such types. https://docs.python.org/2/library/json.html#encoders-and-decoders
tr(self, str, disambiguation: str = None, n: int = -1) → str
visibility
visibilityChanged
class schrodinger.protein.sequence.StructureSequence(st, atoms)

Bases: schrodinger.structure._AtomCollection

Class representing a sequence of protein residues.

residue

Returns residue iterator for all residues in the sequence

__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.protein.sequence', '__doc__': '\n Class representing a sequence of protein residues.\n ', '_getResidueIterator': <function StructureSequence._getResidueIterator>, 'residue': <property object>})
__dir__() → list

default dir() implementation

__eq__(that)

Return True if this object and “that” object are equivalent.

__format__()

default object formatter

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__()

Hash value for this atom collection. This hash uniquely identifies the object (e.g. when using it as keys to dicts or in sets).

__init__(st, atoms)

Initialize self. See help(type(self)) for accurate signature.

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__len__()

Return number of atoms.

__lt__

Return self<value.

__module__ = 'schrodinger.protein.sequence'
__ne__

Return self!=value.

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__str__

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

atom

Iterate over all atoms. Also allows 1-based indexed access to the atoms.

extractStructure(copy_props=False)

Return a new Structure containing only the atoms associated with this substructure. Structure properties, including the title, are inherited only if copy_props is set to True.

getAtomIndices()

Return a list of atom indices for all atoms in this object.

Returns:List of atom indicies.
Return type:list of ints
getAtomList()

Deprecated. Use getAtomIndices() method instead.

structure

Return the parent Structure object for this atom collection.

temperature_factor

Average B (temperature) factor for all atoms that have it assigned. Setting this property will set the B factor to the given value for each atom.

schrodinger.protein.sequence.get_structure_sequences(st)

Iterates over all sequences in the given structure.

schrodinger.protein.sequence.find_generalized_pattern(sequence_list, pattern, validate_pattern=False)

Finds a generalized sequence pattern within specified sequences. NOTE: The search is performed in the forward direction only.

Parameters:
  • sequence_list – list of sequence dictionaries to search.
  • pattern (str) –

    Pattern defined using extended PROSITE syntax.

    • standard IUPAC one-letter codes are used for all amino acids
    • each element in a pattern is separated using ‘-‘ symbol
    • symbol ‘x’ is used for position where any amino acid is accepted
    • ambiguities are listed using the acceptable amino acids between square brackets, e.g. [ACT] means Ala, Cys or Thr
    • amino acids not accepted for a given position are indicated by listing them between curly brackets, e.g. {GP} means ‘not Gly and not Pro’
    • repetition is indicated using parentheses, e.g. A(3) means Ala-Ala-Ala, x(2,4) means between 2 to 4 any residues
    • the following lowercase characters can be used as additional flags:
      • ’x’ means any amino acid
      • ’a’ means acidic residue: [DE]
      • ’b’ means basic residue: [KR]
      • ’o’ means hydrophobic residue: [ACFILPWVY]
      • ’p’ means aromatic residue: [WYF]
      • ’s‘ means solvent exposed residue
      • ’h’ means helical residue
      • ’e’ means extended residue
      • ’f’ means flexible residue
    • Each position can optionally by followed by @<res_num> expression that will match the position with a given residue number.
    • Entire pattern can be followed by :<index> expression that defines a ‘hotspot’ in the pattern. When the hotspot is defined, only a single residue corresponding to (pattern_match_start+index-1) will be returned as a match. The index is 1-based and can be used to place the hotspot outside of the pattern (can also be a negative number).

    Pattern examples:

    • N-{P}-[ST] : Asn-X-Ser or Thr (X != Pro)
    • N[sf]-{P}[sf]-[ST][sf] : as above, but all residues flexible OR solvent exposed
    • Nsf-{P}sf-[ST]sf : as above, but all residues flexible AND solvent exposed
    • Ns{f} : Asn solvent exposed AND not in flexible region
    • N[s{f}] : Asn solvent exposed OR not in flexible region
    • [ab]{K}{s}f : acidic OR basic, with exception of Lys, flexible AND not solvent exposed
    • Ahe : Ala helical AND extended - no match possible
    • A[he] : Ala helical OR extended
    • A{he} : Ala coiled chain conformation (not helical nor extended)
    • [ST] : Ser OR Thr
    • ST : Ser AND Thr - no match possible
  • validate_pattern (boolean) – If True, the function will validate the pattern without performing the search (the sequences parameter will be ignored) and return True if the pattern is valid, or False otherwise. The default is False.
Return type:

list of lists of integer tuples or False if the pattern is invalid

Returns:

False if the specified input pattern was incorrect. Otherwise, it returns a list of lists of matches for each input sequence. Each match is a (start, end) tuple where start and end are matching sequence positions.

Converts a StructureSequence object to dictionary required by find_generalized_pattern function. Because the conversion can be time consuming, it should be done once per sequence.

Optionally a list of atom SASAs for each atom in the CT can be specified. If it’s not specified, it will get calculated by calling analyze.calculate_sasa_by_atom().

Parameters:
  • seq (StructureSequence) – StructureSequence object
  • sasa_by_atom (list) – list of atom SASAs
Return type:

dict

Returns:

Dictionary of sequence information

schrodinger.protein.sequence.find_pattern(seq, pattern)

Find pattern matches in a specified StructureSequence object. Returns a list of matching positions.

Parameters:
  • seq (StructureSequence) – StructureSequence object
  • pattern (string) – Sequence pattern. The syntax is described in find_generalized_pattern.
Return type:

list of lists of integer tuples or None

Returns:

None if the specified input pattern was incorrect. Otherwise, it returns a list of lists of matches for each residue position in the input structure. Each match is a (start, end) tuple where start and end are matching sequence positions. If ‘hotspot’ is specified then start = end.

schrodinger.protein.sequence.get_pairwise_sequence_similarity(chain1, chain2, consider_gap=True, method='clustalw')

Given two single chain sequences, align them, and return sequence similarity among them.

Parameters:
  • chain1 (structure._Chain) – The first sequence chain.
  • chain2 (structure._Chain) – The second sequence chain.
  • consider_gap (bool) – Whether or not to consider gaps in the alignment, default to true.
  • method (string) – Which alignment method to use (‘muscle’ or ‘clustalw’)
Returns:

Sequence similarity of the alignment of the two.

Return type:

float, between 0.0 and 1.0

schrodinger.protein.sequence.create_alignment_from_chains(chains)

Return ProteinAlignment object comprised of two chains

Parameters:chains (iterable(structure._Chain)) – Chains to be aligned
schrodinger.protein.sequence.align_alignment(aln, second_aln=None, method='clustalw')

Perform alignment from an ProteinAlignment object

Parameters:
  • aln (ProteinAlignment) – Alignment data
  • method (string) – Which method/program to use
Returns:

Aligned sequences

Return type:

ProteinAlignment

schrodinger.protein.sequence.align_from_chains(chains, method='clustalw')

Perform alignment on a series of chains

Parameters:
  • chains (iterable(structure._Chain)) – Chains to be aligned
  • method (string) – Which method/program to use (choices ‘muscle’, ‘clustalw’)
Returns:

Aligned sequences

Return type:

ProteinAlignment

schrodinger.protein.sequence.get_aligned_residues(st1, st2)

This generator will yield 2 structure._Residue objects - one from each structure - for each position in aligned sequences.

Parameters:
  • st1 (structure.Structure) – First structure.
  • st2 (structure.Structure) – Second structure
Returns:

Generates tuples of 2 residues that align at each position.

Return type:

generator(structure._Residue or None, structure._Residue or None)

Raises:

ValueError – if structures don’t have equivalent chains.

class schrodinger.protein.sequence.CombinedChainSequenceMeta

Bases: schrodinger.application.msv.utils.DocstringWrapperMetaClass, sip.wrappertype

The metaclass for CombinedChainProteinSequence. This metaclass wraps the specified class attributes.

static __new__(metacls, cls, bases, classdict, *, wraps=None, wrapped_constants=(), wrapped_properties=(), wrapped_getters=(), wrapped_setters=())

See Python documentation for positional argument documentation.

Parameters:
  • wraps (type or None) – The AbstractSingleChainSequence subclass to wrap. If None, no wrapping will be done. (This allows for subclassing of the wrapper class.)
  • wrapped_constants (Iterable) – Class constants to be wrapped.
  • wrapped_properties (Iterable) – Properties to be wrapped.
  • wrapped_getters (Iterable) – Getters to be wrapped.
  • wrapped_setters (Iterable) – Setters to be wrapped.
__base__

alias of sip.wrappertype

__bases__ = (<class 'schrodinger.application.msv.utils.DocstringWrapperMetaClass'>, <class 'sip.wrappertype'>)
__basicsize__ = 904
__call__

Call self as a function.

__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.protein.sequence', '__doc__': '\n The metaclass for `CombinedChainProteinSequence`. This metaclass\n wraps the specified class attributes.\n ', '__new__': <staticmethod object>, '_wrapProperty': <staticmethod object>, '_wrapGetterMethod': <staticmethod object>, '_wrapSetterMethod': <staticmethod object>})
__dictoffset__ = 264
__dir__() → list

specialized __dir__ implementation for types

__eq__

Return self==value.

__flags__ = 2148292097
__format__()

default object formatter

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__

Return hash(self).

__init__

Initialize self. See help(type(self)) for accurate signature.

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__instancecheck__() → bool

check if an object is an instance

__itemsize__ = 40
__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'schrodinger.protein.sequence'
__mro__ = (<class 'schrodinger.protein.sequence.CombinedChainSequenceMeta'>, <class 'schrodinger.application.msv.utils.DocstringWrapperMetaClass'>, <class 'sip.wrappertype'>, <class 'type'>, <class 'object'>)
__name__ = 'CombinedChainSequenceMeta'
__ne__

Return self!=value.

__prepare__() → dict

used to create the namespace for the class statement

__qualname__ = 'CombinedChainSequenceMeta'
__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

return memory consumption of the type object

__str__

Return str(self).

__subclasscheck__() → bool

check if a class is a subclass

__subclasses__() → list of immediate subclasses
__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__text_signature__ = None
__weakrefoffset__ = 368
mro() → list

return a type’s method resolution order

class schrodinger.protein.sequence.CombinedChainProteinSequence(seqs)

Bases: schrodinger.protein.sequence.AbstractSequence

A sequence that contains multiple chains from the same protein. Instances of this class do not directly contain any residues themselves and instead wrap one or several ProteinSequence objects.

AnnotationClass

alias of schrodinger.protein.annotation.CombinedChainProteinSequenceAnnotations

__init__(seqs)
Parameters:seqs (list(ProteinSequence)) – A list of the split-chain sequences to wrap.
__deepcopy__(memo)
__getitem__(index)
__len__()
__str__()

Return str(self).

name
ElementClass

alias of schrodinger.protein.residue.Residue

class ORIGIN

Bases: enum.Enum

An enumeration.

MAESTRO = 1
PYMOL = 2
__class__

alias of enum.EnumMeta

__members__ = mappingproxy(OrderedDict([('MAESTRO', <ORIGIN.MAESTRO: 1>), ('PYMOL', <ORIGIN.PYMOL: 2>)]))
__module__ = 'schrodinger.protein.sequence'
__class__

alias of CombinedChainSequenceMeta

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.protein.sequence', '__doc__': '\n A sequence that contains multiple chains from the same protein. Instances\n of this class do not directly contain any residues themselves and instead\n wrap one or several `ProteinSequence` objects.\n ', 'AnnotationClass': <class 'schrodinger.protein.annotation.CombinedChainProteinSequenceAnnotations'>, '__init__': <function CombinedChainProteinSequence.__init__>, '__deepcopy__': <function CombinedChainProteinSequence.__deepcopy__>, '__getitem__': <function CombinedChainProteinSequence.__getitem__>, '__len__': <function CombinedChainProteinSequence.__len__>, '__str__': <function CombinedChainProteinSequence.__str__>, 'name': <property object>, '_updateSeqOffsets': <function CombinedChainProteinSequence._updateSeqOffsets>, '_updateReadOnlyCache': <function CombinedChainProteinSequence._updateReadOnlyCache>, '_indexToSeqIndexAndIndex': <function CombinedChainProteinSequence._indexToSeqIndexAndIndex>, 'indexToSeqAndIndex': <function CombinedChainProteinSequence.indexToSeqAndIndex>, 'chain': <property object>, 'fullname': <property object>, 'chains': <property object>, 'chain_offsets': <property object>, 'hasChain': <function CombinedChainProteinSequence.hasChain>, 'addChain': <function CombinedChainProteinSequence.addChain>, 'removeChain': <function CombinedChainProteinSequence.removeChain>, 'removeChains': <function CombinedChainProteinSequence.removeChains>, 'ElementClass': <class 'schrodinger.protein.residue.Residue'>, 'alphabet': {'A': ResidueType('A', 'ALA', 'Alanine'), 'C': ResidueType('C', 'CYS', 'Cysteine'), 'D': ResidueType('D', 'ASP', 'Aspartic acid'), 'E': ResidueType('E', 'GLU', 'Glutamic acid'), 'F': ResidueType('F', 'PHE', 'Phenylalanine'), 'G': ResidueType('G', 'GLY', 'Glycine'), 'H': ResidueType('H', 'HIS', 'Histidine'), 'I': ResidueType('I', 'ILE', 'Isoleucine'), 'K': ResidueType('K', 'LYS', 'Lysine'), 'L': ResidueType('L', 'LEU', 'Leucine'), 'M': ResidueType('M', 'MET', 'Methionine'), 'N': ResidueType('N', 'ASN', 'Asparagine'), 'P': ResidueType('P', 'PRO', 'Proline'), 'Q': ResidueType('Q', 'GLN', 'Glutamine'), 'R': ResidueType('R', 'ARG', 'Arginine'), 'S': ResidueType('S', 'SER', 'Serine'), 'T': ResidueType('T', 'THR', 'Threonine'), 'V': ResidueType('V', 'VAL', 'Valine'), 'W': ResidueType('W', 'TRP', 'Tryptophan'), 'Y': ResidueType('Y', 'TYR', 'Tyrosine'), 'ALA': ResidueType('A', 'ALA', 'Alanine'), 'CYS': ResidueType('C', 'CYS', 'Cysteine'), 'ASP': ResidueType('D', 'ASP', 'Aspartic acid'), 'GLU': ResidueType('E', 'GLU', 'Glutamic acid'), 'PHE': ResidueType('F', 'PHE', 'Phenylalanine'), 'GLY': ResidueType('G', 'GLY', 'Glycine'), 'HIS': ResidueType('H', 'HIS', 'Histidine'), 'ILE': ResidueType('I', 'ILE', 'Isoleucine'), 'LYS': ResidueType('K', 'LYS', 'Lysine'), 'LEU': ResidueType('L', 'LEU', 'Leucine'), 'MET': ResidueType('M', 'MET', 'Methionine'), 'ASN': ResidueType('N', 'ASN', 'Asparagine'), 'PRO': ResidueType('P', 'PRO', 'Proline'), 'GLN': ResidueType('Q', 'GLN', 'Glutamine'), 'ARG': ResidueType('R', 'ARG', 'Arginine'), 'SER': ResidueType('S', 'SER', 'Serine'), 'THR': ResidueType('T', 'THR', 'Threonine'), 'VAL': ResidueType('V', 'VAL', 'Valine'), 'TRP': ResidueType('W', 'TRP', 'Tryptophan'), 'TYR': ResidueType('Y', 'TYR', 'Tyrosine'), 'AIB': ResidueType('A', 'AIB', 'Alanine'), 'ALM': ResidueType('A', 'ALM', 'Alanine'), 'AYA': ResidueType('A', 'AYA', 'Alanine'), 'BNN': ResidueType('A', 'BNN', 'Alanine'), 'CHG': ResidueType('A', 'CHG', 'Alanine'), 'CSD': ResidueType('A', 'CSD', 'Alanine'), 'DAL': ResidueType('X', 'DAL', 'Alanine'), 'DHA': ResidueType('A', 'DHA', 'Alanine'), 'DNP': ResidueType('A', 'DNP', 'Alanine'), 'FLA': ResidueType('A', 'FLA', 'Alanine'), 'HAC': ResidueType('A', 'HAC', 'Alanine'), 'MAA': ResidueType('A', 'MAA', 'Alanine'), 'PRR': ResidueType('A', 'PRR', 'Alanine'), 'TIH': ResidueType('A', 'TIH', 'Alanine'), 'TPQ': ResidueType('A', 'TPQ', 'Alanine'), 'AGM': ResidueType('R', 'AGM', 'Arginine'), 'DAR': ResidueType('X', 'DAR', 'Arginine'), 'HAR': ResidueType('R', 'HAR', 'Arginine'), 'MMO': ResidueType('R', 'MMO', 'Arginine'), 'ARM': ResidueType('R', 'ARM', 'Arginine'), 'ARN': ResidueType('R', 'ARN', 'Arginine'), 'HMR': ResidueType('R', 'HMR', 'Arginine'), 'ACL': ResidueType('R', 'ACL', 'Arginine'), 'MEN': ResidueType('N', 'MEN', 'Asparagine'), 'DSG': ResidueType('X', 'DSG', 'Asparagine'), 'DSP': ResidueType('D', 'DSP', 'Aspartic acid'), 'BHD': ResidueType('D', 'BHD', 'Aspartic acid'), '2AS': ResidueType('D', '2AS', 'Aspartic acid'), 'ASQ': ResidueType('D', 'ASQ', 'Aspartic acid'), 'ASB': ResidueType('D', 'ASB', 'Aspartic acid'), 'ASA': ResidueType('D', 'ASA', 'Aspartic acid'), 'ASK': ResidueType('D', 'ASK', 'Aspartic acid'), 'ASH': ResidueType('D', 'ASH', 'Aspartic acid'), 'ASL': ResidueType('D', 'ASL', 'Aspartic acid'), 'DAS': ResidueType('X', 'DAS', 'Aspartic acid'), 'BCS': ResidueType('X', 'BCS', 'Cysteine'), 'BUC': ResidueType('C', 'BUC', 'Cysteine'), 'C5C': ResidueType('C', 'C5C', 'Cysteine'), 'C6C': ResidueType('C', 'C6C', 'Cysteine'), 'CCS': ResidueType('C', 'CCS', 'Cysteine'), 'CEA': ResidueType('C', 'CEA', 'Cysteine'), 'CME': ResidueType('C', 'CME', 'Cysteine'), 'CSO': ResidueType('C', 'CSO', 'Cysteine'), 'CSP': ResidueType('C', 'CSP', 'Cysteine'), 'CSS': ResidueType('C', 'CSS', 'Cysteine'), 'CSW': ResidueType('C', 'CSW', 'Cysteine'), 'CSX': ResidueType('C', 'CSX', 'Cysteine'), 'CY1': ResidueType('C', 'CY1', 'Cysteine'), 'CY3': ResidueType('C', 'CY3', 'Cysteine'), 'CYG': ResidueType('C', 'CYG', 'Cysteine'), 'CYM': ResidueType('C', 'CYM', 'Cysteine'), 'CYP': ResidueType('C', 'CYP', 'Cysteine'), 'CYQ': ResidueType('C', 'CYQ', 'Cysteine'), 'CYX': ResidueType('C', 'CYX', 'Cysteine'), 'DCY': ResidueType('X', 'DCY', 'Cysteine'), 'EFC': ResidueType('C', 'EFC', 'Cysteine'), 'OCS': ResidueType('C', 'OCS', 'Cysteine'), 'PEC': ResidueType('C', 'PEC', 'Cysteine'), 'PR3': ResidueType('C', 'PR3', 'Cysteine'), 'SCH': ResidueType('C', 'SCH', 'Cysteine'), 'SCS': ResidueType('C', 'SCS', 'Cysteine'), 'SCY': ResidueType('C', 'SCY', 'Cysteine'), 'SHC': ResidueType('C', 'SHC', 'Cysteine'), 'SMC': ResidueType('C', 'SMC', 'Cysteine'), 'SOC': ResidueType('C', 'SOC', 'Cysteine'), 'GLH': ResidueType('E', 'GLH', 'Glutamic acid'), 'GGL': ResidueType('E', 'GGL', 'Glutamic acid'), 'PCA': ResidueType('E', 'PCA', 'Glutamic acid'), '5HP': ResidueType('E', '5HP', 'Glutamic acid'), 'DGL': ResidueType('X', 'DGL', 'Glutamic acid'), 'CGU': ResidueType('E', 'CGU', 'Glutamic acid'), 'GMA': ResidueType('E', 'GMA', 'Glutamic acid'), 'DGN': ResidueType('X', 'DGN', 'Glutamine'), 'GLZ': ResidueType('G', 'GLZ', 'Glycine'), 'SAR': ResidueType('G', 'SAR', 'Glycine'), 'NMC': ResidueType('G', 'NMC', 'Glycine'), 'GL3': ResidueType('G', 'GL3', 'Glycine'), 'GSC': ResidueType('G', 'GSC', 'Glycine'), 'MPQ': ResidueType('G', 'MPQ', 'Glycine'), 'MSA': ResidueType('G', 'MSA', 'Glycine'), 'DHI': ResidueType('X', 'DHI', 'Histidine'), 'HID': ResidueType('H', 'HID', 'Histidine'), 'HIC': ResidueType('H', 'HIC', 'Histidine'), 'HIE': ResidueType('H', 'HIE', 'Histidine'), 'HIP': ResidueType('H', 'HIP', 'Histidine'), 'HSD': ResidueType('H', 'HSD', 'Histidine'), 'HSE': ResidueType('H', 'HSE', 'Histidine'), 'HSP': ResidueType('H', 'HSP', 'Histidine'), 'MHS': ResidueType('H', 'MHS', 'Histidine'), 'NEM': ResidueType('H', 'NEM', 'Histidine'), 'NEP': ResidueType('H', 'NEP', 'Histidine'), '3AH': ResidueType('H', '3AH', 'Histidine'), 'DIL': ResidueType('X', 'DIL', 'Isoleucine'), 'IIL': ResidueType('I', 'IIL', 'Isoleucine'), 'BUG': ResidueType('L', 'BUG', 'Leucine'), 'NLE': ResidueType('X', 'NLE', 'Leucine'), 'NLP': ResidueType('L', 'NLP', 'Leucine'), 'NLN': ResidueType('L', 'NLN', 'Leucine'), 'DLE': ResidueType('X', 'DLE', 'Leucine'), 'CLE': ResidueType('L', 'CLE', 'Leucine'), 'MLE': ResidueType('L', 'MLE', 'Leucine'), 'LYM': ResidueType('K', 'LYM', 'Lysine'), 'ALY': ResidueType('K', 'ALY', 'Lysine'), 'LYZ': ResidueType('K', 'LYZ', 'Lysine'), 'LYN': ResidueType('K', 'LYN', 'Lysine'), 'LLY': ResidueType('K', 'LLY', 'Lysine'), 'LLP': ResidueType('K', 'LLP', 'Lysine'), 'SHR': ResidueType('K', 'SHR', 'Lysine'), 'TRG': ResidueType('K', 'TRG', 'Lysine'), 'DLY': ResidueType('X', 'DLY', 'Lysine'), 'KCX': ResidueType('K', 'KCX', 'Lysine'), 'FME': ResidueType('M', 'FME', 'Methionine'), 'CXM': ResidueType('M', 'CXM', 'Methionine'), 'OMT': ResidueType('M', 'OMT', 'Methionine'), 'MSE': ResidueType('M', 'MSE', 'Methionine'), 'DAH': ResidueType('F', 'DAH', 'Phenylalanine'), 'DPN': ResidueType('X', 'DPN', 'Phenylalanine'), 'HPQ': ResidueType('F', 'HPQ', 'Phenylalanine'), 'PHI': ResidueType('F', 'PHI', 'Phenylalanine'), 'PHL': ResidueType('F', 'PHL', 'Phenylalanine'), 'DPR': ResidueType('X', 'DPR', 'Proline'), 'HYP': ResidueType('X', 'HYP', 'Proline'), 'OAS': ResidueType('S', 'OAS', 'Serine'), 'MIS': ResidueType('S', 'MIS', 'Serine'), 'SAC': ResidueType('S', 'SAC', 'Serine'), 'SVA': ResidueType('S', 'SVA', 'Serine'), 'SET': ResidueType('S', 'SET', 'Serine'), 'SEP': ResidueType('X', 'SEP', 'Serine'), 'SEL': ResidueType('S', 'SEL', 'Serine'), 'DSN': ResidueType('X', 'DSN', 'Serine'), 'ALO': ResidueType('T', 'ALO', 'Threonine'), 'BMT': ResidueType('T', 'BMT', 'Threonine'), 'DTH': ResidueType('X', 'DTH', 'Threonine'), 'THO': ResidueType('T', 'THO', 'Threonine'), 'TPO': ResidueType('t', 'TPO', 'Threonine'), 'DTR': ResidueType('X', 'DTR', 'Tryptophan'), 'HTR': ResidueType('W', 'HTR', 'Tryptophan'), 'LTR': ResidueType('W', 'LTR', 'Tryptophan'), 'TPL': ResidueType('W', 'TPL', 'Tryptophan'), 'TRO': ResidueType('W', 'TRO', 'Tryptophan'), 'DTY': ResidueType('X', 'DTY', 'Tyrosine'), 'IYR': ResidueType('Y', 'IYR', 'Tyrosine'), 'PAQ': ResidueType('Y', 'PAQ', 'Tyrosine'), 'PTR': ResidueType('y', 'PTR', 'Tyrosine'), 'STY': ResidueType('Y', 'STY', 'Tyrosine'), 'TYB': ResidueType('Y', 'TYB', 'Tyrosine'), 'TYM': ResidueType('Y', 'TYM', 'Tyrosine'), 'TYO': ResidueType('Y', 'TYO', 'Tyrosine'), 'TYQ': ResidueType('Y', 'TYQ', 'Tyrosine'), 'TYS': ResidueType('Y', 'TYS', 'Tyrosine'), 'TYY': ResidueType('Y', 'TYY', 'Tyrosine'), 'DIV': ResidueType('V', 'DIV', 'Valine'), 'DVA': ResidueType('X', 'DVA', 'Valine'), 'MVA': ResidueType('V', 'MVA', 'Valine'), 'UNK': ResidueType('X', 'UNK', 'Unknown'), 'ACE': ResidueType('X', 'ACE', 'Capping Group'), 'NMA': ResidueType('X', 'NMA', 'Capping Group'), 'IND': ResidueType('X', 'IND', 'Capping Group'), 'NCO': ResidueType('X', 'NCO', 'Capping Group'), 'ANF': ResidueType('X', 'ANF', 'Capping Group'), 'TOSG': ResidueType('X', 'TOSG', 'Capping Group'), 'FCO': ResidueType('X', 'FCO', 'Capping Group'), 'MPA': ResidueType('X', 'MPA', 'Capping Group'), 'NH2': ResidueType('X', 'NH2', 'Capping Group')}, '_gap_chars': ['~', '-', '.'], 'origin': <property object>, 'entry_name': <property object>, 'entry_id': <property object>, 'title': <property object>, 'pdb_id': <property object>, 'getStructure': <function CombinedChainSequenceMeta._wrapGetterMethod.<locals>.getter>, 'hasStructure': <function CombinedChainSequenceMeta._wrapGetterMethod.<locals>.getter>, 'setStructure': <function CombinedChainSequenceMeta._wrapSetterMethod.<locals>.setter>})
__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattr__(self, str) → object
__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__

Return hash(self).

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'schrodinger.protein.sequence'
__ne__

Return self!=value.

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

alphabet = {'2AS': ResidueType('D', '2AS', 'Aspartic acid'), '3AH': ResidueType('H', '3AH', 'Histidine'), '5HP': ResidueType('E', '5HP', 'Glutamic acid'), 'A': ResidueType('A', 'ALA', 'Alanine'), 'ACE': ResidueType('X', 'ACE', 'Capping Group'), 'ACL': ResidueType('R', 'ACL', 'Arginine'), 'AGM': ResidueType('R', 'AGM', 'Arginine'), 'AIB': ResidueType('A', 'AIB', 'Alanine'), 'ALA': ResidueType('A', 'ALA', 'Alanine'), 'ALM': ResidueType('A', 'ALM', 'Alanine'), 'ALO': ResidueType('T', 'ALO', 'Threonine'), 'ALY': ResidueType('K', 'ALY', 'Lysine'), 'ANF': ResidueType('X', 'ANF', 'Capping Group'), 'ARG': ResidueType('R', 'ARG', 'Arginine'), 'ARM': ResidueType('R', 'ARM', 'Arginine'), 'ARN': ResidueType('R', 'ARN', 'Arginine'), 'ASA': ResidueType('D', 'ASA', 'Aspartic acid'), 'ASB': ResidueType('D', 'ASB', 'Aspartic acid'), 'ASH': ResidueType('D', 'ASH', 'Aspartic acid'), 'ASK': ResidueType('D', 'ASK', 'Aspartic acid'), 'ASL': ResidueType('D', 'ASL', 'Aspartic acid'), 'ASN': ResidueType('N', 'ASN', 'Asparagine'), 'ASP': ResidueType('D', 'ASP', 'Aspartic acid'), 'ASQ': ResidueType('D', 'ASQ', 'Aspartic acid'), 'AYA': ResidueType('A', 'AYA', 'Alanine'), 'BCS': ResidueType('X', 'BCS', 'Cysteine'), 'BHD': ResidueType('D', 'BHD', 'Aspartic acid'), 'BMT': ResidueType('T', 'BMT', 'Threonine'), 'BNN': ResidueType('A', 'BNN', 'Alanine'), 'BUC': ResidueType('C', 'BUC', 'Cysteine'), 'BUG': ResidueType('L', 'BUG', 'Leucine'), 'C': ResidueType('C', 'CYS', 'Cysteine'), 'C5C': ResidueType('C', 'C5C', 'Cysteine'), 'C6C': ResidueType('C', 'C6C', 'Cysteine'), 'CCS': ResidueType('C', 'CCS', 'Cysteine'), 'CEA': ResidueType('C', 'CEA', 'Cysteine'), 'CGU': ResidueType('E', 'CGU', 'Glutamic acid'), 'CHG': ResidueType('A', 'CHG', 'Alanine'), 'CLE': ResidueType('L', 'CLE', 'Leucine'), 'CME': ResidueType('C', 'CME', 'Cysteine'), 'CSD': ResidueType('A', 'CSD', 'Alanine'), 'CSO': ResidueType('C', 'CSO', 'Cysteine'), 'CSP': ResidueType('C', 'CSP', 'Cysteine'), 'CSS': ResidueType('C', 'CSS', 'Cysteine'), 'CSW': ResidueType('C', 'CSW', 'Cysteine'), 'CSX': ResidueType('C', 'CSX', 'Cysteine'), 'CXM': ResidueType('M', 'CXM', 'Methionine'), 'CY1': ResidueType('C', 'CY1', 'Cysteine'), 'CY3': ResidueType('C', 'CY3', 'Cysteine'), 'CYG': ResidueType('C', 'CYG', 'Cysteine'), 'CYM': ResidueType('C', 'CYM', 'Cysteine'), 'CYP': ResidueType('C', 'CYP', 'Cysteine'), 'CYQ': ResidueType('C', 'CYQ', 'Cysteine'), 'CYS': ResidueType('C', 'CYS', 'Cysteine'), 'CYX': ResidueType('C', 'CYX', 'Cysteine'), 'D': ResidueType('D', 'ASP', 'Aspartic acid'), 'DAH': ResidueType('F', 'DAH', 'Phenylalanine'), 'DAL': ResidueType('X', 'DAL', 'Alanine'), 'DAR': ResidueType('X', 'DAR', 'Arginine'), 'DAS': ResidueType('X', 'DAS', 'Aspartic acid'), 'DCY': ResidueType('X', 'DCY', 'Cysteine'), 'DGL': ResidueType('X', 'DGL', 'Glutamic acid'), 'DGN': ResidueType('X', 'DGN', 'Glutamine'), 'DHA': ResidueType('A', 'DHA', 'Alanine'), 'DHI': ResidueType('X', 'DHI', 'Histidine'), 'DIL': ResidueType('X', 'DIL', 'Isoleucine'), 'DIV': ResidueType('V', 'DIV', 'Valine'), 'DLE': ResidueType('X', 'DLE', 'Leucine'), 'DLY': ResidueType('X', 'DLY', 'Lysine'), 'DNP': ResidueType('A', 'DNP', 'Alanine'), 'DPN': ResidueType('X', 'DPN', 'Phenylalanine'), 'DPR': ResidueType('X', 'DPR', 'Proline'), 'DSG': ResidueType('X', 'DSG', 'Asparagine'), 'DSN': ResidueType('X', 'DSN', 'Serine'), 'DSP': ResidueType('D', 'DSP', 'Aspartic acid'), 'DTH': ResidueType('X', 'DTH', 'Threonine'), 'DTR': ResidueType('X', 'DTR', 'Tryptophan'), 'DTY': ResidueType('X', 'DTY', 'Tyrosine'), 'DVA': ResidueType('X', 'DVA', 'Valine'), 'E': ResidueType('E', 'GLU', 'Glutamic acid'), 'EFC': ResidueType('C', 'EFC', 'Cysteine'), 'F': ResidueType('F', 'PHE', 'Phenylalanine'), 'FCO': ResidueType('X', 'FCO', 'Capping Group'), 'FLA': ResidueType('A', 'FLA', 'Alanine'), 'FME': ResidueType('M', 'FME', 'Methionine'), 'G': ResidueType('G', 'GLY', 'Glycine'), 'GGL': ResidueType('E', 'GGL', 'Glutamic acid'), 'GL3': ResidueType('G', 'GL3', 'Glycine'), 'GLH': ResidueType('E', 'GLH', 'Glutamic acid'), 'GLN': ResidueType('Q', 'GLN', 'Glutamine'), 'GLU': ResidueType('E', 'GLU', 'Glutamic acid'), 'GLY': ResidueType('G', 'GLY', 'Glycine'), 'GLZ': ResidueType('G', 'GLZ', 'Glycine'), 'GMA': ResidueType('E', 'GMA', 'Glutamic acid'), 'GSC': ResidueType('G', 'GSC', 'Glycine'), 'H': ResidueType('H', 'HIS', 'Histidine'), 'HAC': ResidueType('A', 'HAC', 'Alanine'), 'HAR': ResidueType('R', 'HAR', 'Arginine'), 'HIC': ResidueType('H', 'HIC', 'Histidine'), 'HID': ResidueType('H', 'HID', 'Histidine'), 'HIE': ResidueType('H', 'HIE', 'Histidine'), 'HIP': ResidueType('H', 'HIP', 'Histidine'), 'HIS': ResidueType('H', 'HIS', 'Histidine'), 'HMR': ResidueType('R', 'HMR', 'Arginine'), 'HPQ': ResidueType('F', 'HPQ', 'Phenylalanine'), 'HSD': ResidueType('H', 'HSD', 'Histidine'), 'HSE': ResidueType('H', 'HSE', 'Histidine'), 'HSP': ResidueType('H', 'HSP', 'Histidine'), 'HTR': ResidueType('W', 'HTR', 'Tryptophan'), 'HYP': ResidueType('X', 'HYP', 'Proline'), 'I': ResidueType('I', 'ILE', 'Isoleucine'), 'IIL': ResidueType('I', 'IIL', 'Isoleucine'), 'ILE': ResidueType('I', 'ILE', 'Isoleucine'), 'IND': ResidueType('X', 'IND', 'Capping Group'), 'IYR': ResidueType('Y', 'IYR', 'Tyrosine'), 'K': ResidueType('K', 'LYS', 'Lysine'), 'KCX': ResidueType('K', 'KCX', 'Lysine'), 'L': ResidueType('L', 'LEU', 'Leucine'), 'LEU': ResidueType('L', 'LEU', 'Leucine'), 'LLP': ResidueType('K', 'LLP', 'Lysine'), 'LLY': ResidueType('K', 'LLY', 'Lysine'), 'LTR': ResidueType('W', 'LTR', 'Tryptophan'), 'LYM': ResidueType('K', 'LYM', 'Lysine'), 'LYN': ResidueType('K', 'LYN', 'Lysine'), 'LYS': ResidueType('K', 'LYS', 'Lysine'), 'LYZ': ResidueType('K', 'LYZ', 'Lysine'), 'M': ResidueType('M', 'MET', 'Methionine'), 'MAA': ResidueType('A', 'MAA', 'Alanine'), 'MEN': ResidueType('N', 'MEN', 'Asparagine'), 'MET': ResidueType('M', 'MET', 'Methionine'), 'MHS': ResidueType('H', 'MHS', 'Histidine'), 'MIS': ResidueType('S', 'MIS', 'Serine'), 'MLE': ResidueType('L', 'MLE', 'Leucine'), 'MMO': ResidueType('R', 'MMO', 'Arginine'), 'MPA': ResidueType('X', 'MPA', 'Capping Group'), 'MPQ': ResidueType('G', 'MPQ', 'Glycine'), 'MSA': ResidueType('G', 'MSA', 'Glycine'), 'MSE': ResidueType('M', 'MSE', 'Methionine'), 'MVA': ResidueType('V', 'MVA', 'Valine'), 'N': ResidueType('N', 'ASN', 'Asparagine'), 'NCO': ResidueType('X', 'NCO', 'Capping Group'), 'NEM': ResidueType('H', 'NEM', 'Histidine'), 'NEP': ResidueType('H', 'NEP', 'Histidine'), 'NH2': ResidueType('X', 'NH2', 'Capping Group'), 'NLE': ResidueType('X', 'NLE', 'Leucine'), 'NLN': ResidueType('L', 'NLN', 'Leucine'), 'NLP': ResidueType('L', 'NLP', 'Leucine'), 'NMA': ResidueType('X', 'NMA', 'Capping Group'), 'NMC': ResidueType('G', 'NMC', 'Glycine'), 'OAS': ResidueType('S', 'OAS', 'Serine'), 'OCS': ResidueType('C', 'OCS', 'Cysteine'), 'OMT': ResidueType('M', 'OMT', 'Methionine'), 'P': ResidueType('P', 'PRO', 'Proline'), 'PAQ': ResidueType('Y', 'PAQ', 'Tyrosine'), 'PCA': ResidueType('E', 'PCA', 'Glutamic acid'), 'PEC': ResidueType('C', 'PEC', 'Cysteine'), 'PHE': ResidueType('F', 'PHE', 'Phenylalanine'), 'PHI': ResidueType('F', 'PHI', 'Phenylalanine'), 'PHL': ResidueType('F', 'PHL', 'Phenylalanine'), 'PR3': ResidueType('C', 'PR3', 'Cysteine'), 'PRO': ResidueType('P', 'PRO', 'Proline'), 'PRR': ResidueType('A', 'PRR', 'Alanine'), 'PTR': ResidueType('y', 'PTR', 'Tyrosine'), 'Q': ResidueType('Q', 'GLN', 'Glutamine'), 'R': ResidueType('R', 'ARG', 'Arginine'), 'S': ResidueType('S', 'SER', 'Serine'), 'SAC': ResidueType('S', 'SAC', 'Serine'), 'SAR': ResidueType('G', 'SAR', 'Glycine'), 'SCH': ResidueType('C', 'SCH', 'Cysteine'), 'SCS': ResidueType('C', 'SCS', 'Cysteine'), 'SCY': ResidueType('C', 'SCY', 'Cysteine'), 'SEL': ResidueType('S', 'SEL', 'Serine'), 'SEP': ResidueType('X', 'SEP', 'Serine'), 'SER': ResidueType('S', 'SER', 'Serine'), 'SET': ResidueType('S', 'SET', 'Serine'), 'SHC': ResidueType('C', 'SHC', 'Cysteine'), 'SHR': ResidueType('K', 'SHR', 'Lysine'), 'SMC': ResidueType('C', 'SMC', 'Cysteine'), 'SOC': ResidueType('C', 'SOC', 'Cysteine'), 'STY': ResidueType('Y', 'STY', 'Tyrosine'), 'SVA': ResidueType('S', 'SVA', 'Serine'), 'T': ResidueType('T', 'THR', 'Threonine'), 'THO': ResidueType('T', 'THO', 'Threonine'), 'THR': ResidueType('T', 'THR', 'Threonine'), 'TIH': ResidueType('A', 'TIH', 'Alanine'), 'TOSG': ResidueType('X', 'TOSG', 'Capping Group'), 'TPL': ResidueType('W', 'TPL', 'Tryptophan'), 'TPO': ResidueType('t', 'TPO', 'Threonine'), 'TPQ': ResidueType('A', 'TPQ', 'Alanine'), 'TRG': ResidueType('K', 'TRG', 'Lysine'), 'TRO': ResidueType('W', 'TRO', 'Tryptophan'), 'TRP': ResidueType('W', 'TRP', 'Tryptophan'), 'TYB': ResidueType('Y', 'TYB', 'Tyrosine'), 'TYM': ResidueType('Y', 'TYM', 'Tyrosine'), 'TYO': ResidueType('Y', 'TYO', 'Tyrosine'), 'TYQ': ResidueType('Y', 'TYQ', 'Tyrosine'), 'TYR': ResidueType('Y', 'TYR', 'Tyrosine'), 'TYS': ResidueType('Y', 'TYS', 'Tyrosine'), 'TYY': ResidueType('Y', 'TYY', 'Tyrosine'), 'UNK': ResidueType('X', 'UNK', 'Unknown'), 'V': ResidueType('V', 'VAL', 'Valine'), 'VAL': ResidueType('V', 'VAL', 'Valine'), 'W': ResidueType('W', 'TRP', 'Tryptophan'), 'Y': ResidueType('Y', 'TYR', 'Tyrosine')}
annotationTitleChanged
blockSignals(self, bool) → bool
childEvent(self, QChildEvent)
children(self) → object
clearAllCaching()

This method should be implemented in subclasses that cache any data.

connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
deleteLater(self)
destroyed

destroyed(self, QObject = None) [signal]

disconnect(self)
disconnectNotify(self, QMetaMethod)
dumpObjectInfo(self)
dumpObjectTree(self)
dynamicPropertyNames(self) → object
entry_id
entry_name
event(self, QEvent) → bool
eventFilter(self, QObject, QEvent) → bool
findChild(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → QObject

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name: str = '', options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) → List[QObject]

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

gap_char
getAnnotation(index, annotation)

Returns the annotation at the specified index or None for a gap.

Raises:ValueError – if the annotation is not available
getConservation(reference, consider_gaps=True)

Return a float scoring the homology conservation between the sequence and a reference sequence, assuming that they’re already aligned.

The homology criterion is based on “side chain chemistry” descriptor matching.

Parameters:
Returns:

The sequence conservation score (between 0.0 and 1.0)

Return type:

float

getGaplessLength()
Returns:Length of this sequence ignoring gaps
Return type:int
getGaps()
Return type:list(residue.Gap)
Returns:The gaps in the sequence.
getIdentity(reference, consider_gaps=True)

Return a float scoring the identity between the sequence and a reference sequence, assuming that they’re already aligned

Parameters:
Returns:

The sequence identity score (between 0.0 and 1.0)

Return type:

float

getSimilarity(reference, consider_gaps=True)

Return a float score of the similarity count between the sequence and a reference sequence, assuming that they’re already aligned.

Parameters:
Returns:

The sequence similarity score (between 0.0 and 1.0)

Return type:

float

getSimilarityScore(reference)

Return the total score of similarity between the sequence and a reference sequence, assuming that they’re already aligned.

Since the similarity with a gap will always be 0.0, there is no need to consider gaps.

Parameters:reference (schrodinger.protein.sequence.Sequence) – A sequence to compare against
Returns:The total sequence similarity score
Return type:float
getStructure(*args, **kwargs)
hasStructure(*args, **kwargs)
index(res, ignore_gaps=False)

Returns the index of the specified residue

Parameters:
  • res (schrodinger.structure._Residue) – The residue to find
  • ignore_gaps (bool) – Whether the index returned should ignore gaps in the sequence or not.
Raises:

A Value error if the residue is not present or if the res is None

Return type:

int

Returns:

The index of the residue

indexToSeqAndIndex(index)

Convert a combined-chain residue index to a split-chain sequence and a residue index within the specified sequence.

Parameters:index (int) – A valid combined-chain residue index
Returns:A tuple of - the split-chain sequence - residue index - the starting index of the split-chain sequence
Return type:tuple(ProteinSequence, int, int)
inherits(self, str) → bool
installEventFilter(self, QObject)
isSignalConnected(self, QMetaMethod) → bool
isWidgetType(self) → bool
isWindowType(self) → bool
killTimer(self, int)
lengthAboutToChange
lengthChanged
metaObject(self) → QMetaObject
moveToThread(self, QThread)
nameChanged
objectName(self) → str
objectNameChanged

objectNameChanged(self, str) [signal]

origin
parent(self) → QObject
pdb_id
property(self, str) → Any
pyqtConfigure(...)

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

receivers(self, PYQT_SIGNAL) → int
removeEventFilter(self, QObject)
residuesChanged
sender(self) → QObject
senderSignalIndex(self) → int
setObjectName(self, str)
setParent(self, QObject)
setProperty(self, str, Any) → bool
setStructure(*args, **kwargs)
signalsBlocked(self) → bool
startTimer(self, int, timerType: Qt.TimerType = Qt.CoarseTimer) → int
staticMetaObject = <PyQt5.QtCore.QMetaObject object>
structureChanged
thread(self) → QThread
timerEvent(self, QTimerEvent)
title
tr(self, str, disambiguation: str = None, n: int = -1) → str
visibilityChanged
chain
fullname
chains
chain_offsets
hasChain(chain_name)

Does this sequence contain a chain with the specified name?

Parameters:chain_name (str) – The chain name to check
Return type:bool
addChain(seq)

Add a new chain to this sequence.

Parameters:seq (ProteinSequence) – The chain to add
removeChain(seq)

Remove a chain from this sequence. Note that you should not remove the last chain; instead, remove this sequence from the alignment.

Parameters:seq (ProteinSequence) – The chain to remove
removeChains(seqs)

Remove multiple chains from this sequence. Note that you should not all chain from a combine-chain sequence; instead, remove the sequence from the alignment.

Parameters:seqs (list[ProteinSequence]) – The chains to remove