Package schrodinger :: Package application :: Package msv :: Package domain :: Module sequence :: Class ProteinSequence
[hide private]
[frames] | no frames]

Class ProteinSequence

       object --+                
                |                
sip.simplewrapper --+            
                    |            
          sip.wrapper --+        
                        |        
     PyQt5.QtCore.QObject --+    
                            |    
                     Sequence --+
                                |
                               ProteinSequence

Nested Classes [hide private]
  AnnotationClass
Knows how to annotate a ProteinSequence
  ORIGIN
  SSA_POS_TYPE
Instance Methods [hide private]
 
__init__(self, elements, name='', alphabet=dict(AMINO_ACIDS_ONE_LETTER.items()+ AMINO_ACIDS_THREE_LETTER...., origin=None, entry_id='', chain='', unknown_res_type=ResidueType("X", "UNK", "Unknown"), gap_chars=['~', '-', '.'])
Make a sequence object from a list of strings, using a mapping of strings to element types.
list
_makeSeqElements(self, elements)
Returns: list of residues
schrodinger.application.msv.domain.residue.Residue
makeSeqElement(self, element)
Returns: residue
 
insert(self, index, elements)
Insert a list of elements or sequence element into this sequence
 
mutate(self, start, end, elements)
Mutate sequence elements starting at the given index to the provided elements
 
append(self, element)
Appends an element to the sequence
 
extend(self, elements)
Extends the sequence with elements from a list
 
sanitize(self, start=0, end=None)
Remove gaps and unknown sequence elements from sequence
 
removeStructurelessResidues(self, start=0, end=None)
Remove any structureless residues
 
removeTerminalGaps(self)
Remove gaps from the end of the sequence
 
getTerminalGaps(self)
Return indices of terminal gaps
 
getGapCount(self)
Returns: the number of gaps in the sequence
 
_updateSSAPositions(self, _1, _2)
Updates the stored indices of start and end positions of secondary structure assignment blocks in the sequence.
int or None
getSSAPosType(self, index)
Return whether the residue at the specified index is at the start, middle or end of a secondary structure block.

Inherited from Sequence: __add__, __contains__, __copy__, __deepcopy__, __getitem__, __iter__, __len__, __repr__, __str__, addGaps, get, getGapIndicesByKeyFunc, getGaps, getGapsByKeyFunc, getHomology, getIdentity, getNextResidue, getNextResidueIndex, getNumResidues, getPreviousResidue, getPreviousResidueIndex, getResidueByOrigin, getSimilarity, getSimilarityScore, getSubsequence, hasEntryID, hasStructure, hasVisibleResidues, index, iterNeighbors, lengthAboutToChange, lengthChanged, nameChanged, remove, removeAllGaps, removeFromSequence, removeGaps, replaceAllElements, residuesChanged, residuesDeleted, setGaps, setName

Inherited from PyQt5.QtCore.QObject: __getattr__, blockSignals, childEvent, children, connectNotify, customEvent, deleteLater, destroyed, disconnect, disconnectNotify, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChildren, inherits, installEventFilter, isSignalConnected, isWidgetType, isWindowType, killTimer, metaObject, moveToThread, objectName, objectNameChanged, parent, property, pyqtConfigure, receivers, removeEventFilter, sender, senderSignalIndex, setObjectName, setParent, setProperty, signalsBlocked, startTimer, thread, timerEvent, tr

Inherited from sip.simplewrapper: __new__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Class Methods [hide private]
Tuple of (bool, set)
isValid(cls, elements, alphabet={res.short_code: res for res in STD_AMINO_ACIDS}, gap_chars=['~', '-', '.'])
Returns: Tuple indicating whether valid and a set of invalid characters, if any
Class Variables [hide private]

Inherited from PyQt5.QtCore.QObject: staticMetaObject

Properties [hide private]
str fullname

Inherited from Sequence: annotation_types, name, origin

Inherited from Sequence (private): _origin_setter

Inherited from object: __class__

Method Details [hide private]

__init__(self, elements, name='', alphabet=dict(AMINO_ACIDS_ONE_LETTER.items()+ AMINO_ACIDS_THREE_LETTER...., origin=None, entry_id='', chain='', unknown_res_type=ResidueType("X", "UNK", "Unknown"), gap_chars=['~', '-', '.'])
(Constructor)

 

Make a sequence object from a list of strings, using a mapping of strings to element types.

Parameters:
  • elements (list) - An iterable of string representations of elements making up the sequence
  • name (basestring) - The name of the sequence
  • alphabet (dict) - A mapping of string representations of elements to element types
  • unknown_res_type (object) - The type, if any, of an unknown residue
  • gap_chars (set of basestring) - A set of permissible gap characters in the element list, the first of which will be used in serialization
Raises:
  • ValueError - If the unknown_res_type is None and an unrecognized character is encountered in the element list
Overrides: object.__init__

_makeSeqElements(self, elements)

 

Return a list of elements converted to proper sequence items

Parameters:
  • elements (list) - list of basestring or basestring
Returns: list
list of residues
Raises:
  • ValueError - If an element is not in self.alphabet and self._unknown_res_type is not defined
Overrides: Sequence._makeSeqElements

makeSeqElement(self, element)

 
Parameters:
Returns: schrodinger.application.msv.domain.residue.Residue
residue

insert(self, index, elements)

 

Insert a list of elements or sequence element into this sequence

Parameters:
  • index - The index at which to insert elements
  • elements - A list of elements to insert
Overrides: Sequence.insert
(inherited documentation)

mutate(self, start, end, elements)

 

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

Parameters:
  • start - The index at which to start mutating
  • end - The index of the last mutated element
  • elements - The elements to which to mutate the sequence
Overrides: Sequence.mutate
(inherited documentation)

append(self, element)

 

Appends an element to the sequence

Parameters:
  • element - The element to append to this sequence
Overrides: Sequence.append
(inherited documentation)

extend(self, elements)

 

Extends the sequence with elements from a list

Parameters:
  • elements - The list containing elements with which to extend this one
Overrides: Sequence.extend
(inherited documentation)

sanitize(self, start=0, end=None)

 

Remove gaps and unknown sequence elements from sequence

Overrides: Sequence.sanitize

getGapCount(self)

 
Returns:
the number of gaps in the sequence

_updateSSAPositions(self, _1, _2)

 

Updates the stored indices of start and end positions of secondary structure assignment blocks in the sequence. The parameters are ignored and included only so that the function can be triggered when the sequence is changed.

getSSAPosType(self, index)

 

Return whether the residue at the specified index is at the start, middle or end of a secondary structure block. Note that while it is unrealistic for a residue to be both the start and end of a block, this may happen (e.g. due to deletion of other elements in an SSA block). In these cases, the residue will be identified as the start of a block by this function.

Parameters:
  • index (int) - Index of the residue to check
Returns: int or None
One of self.SSA_POS_TYPE.START, self.SSA_POS_TYPE.MIDDLE or self.SSA_POS_TYPE.END or None if no residue is at the specified index.

isValid(cls, elements, alphabet={res.short_code: res for res in STD_AMINO_ACIDS}, gap_chars=['~', '-', '.'])
Class Method

 
Parameters:
  • elements (list) - An iterable of string representations of elements making up the sequence
  • alphabet (dict) - A mapping of string representations of elements to element types
  • gap_chars (set of basestring) - A set of permissible gap characters in the element list
Returns: Tuple of (bool, set)
Tuple indicating whether valid and a set of invalid characters, if any
Overrides: Sequence.isValid

Property Details [hide private]

fullname

Get Method:
unreachable.fullname(self) - Returns: a formatted name + optional chain name for the sequence
Type:
str