Package schrodinger :: Package application :: Package msv :: Package io :: Module seqio :: Class MMSequenceConverter
[hide private]
[frames] | no frames]

Class MMSequenceConverter

object --+
         |
        MMSequenceConverter

Converts sequence between mmseq and MSV sequence formats.


Note: This is supposed to be used with 'with' context manager.

Instance Methods [hide private]
 
__enter__(self)
Initializes mmseq and mmseqio.
 
__exit__(self, exc_type, exc_value, traceback)
Terminates mmseq and mmseqio.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
_makeSequence(cls, handle)
Converts a mmseq sequence object specified by handle to ProteinSequence object.
int
_makeMMSEQ(cls, seq)
Converts a ProteinSequence to mmseq object.
List of ProteinSequence.
readSequences(cls, file_name, file_format=0)
Reads all sequences from file specified by file_name.
 
writeSequences(cls, sequences, file_name, file_format=1)
Writes sequences to a file specified by file_name.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_makeSequence(cls, handle)
Class Method

 

Converts a mmseq sequence object specified by handle to ProteinSequence object.

Parameters:
Returns:
Protein sequence in MSV format.

_makeMMSEQ(cls, seq)
Class Method

 

Converts a ProteinSequence to mmseq object.

Parameters:
Returns: int
mmseq sequence handle.

Note: The returned handle needs to be deleted by calling mm.mmseq_delete.

readSequences(cls, file_name, file_format=0)
Class Method

 

Reads all sequences from file specified by file_name.

Parameters:
  • file_name (str) - Name of input file.
  • file_format (int) - Format of the input file. By default, the format is MMSEQIO_ANY meaning file type is automatically recognized.
Returns: List of ProteinSequence.
List of protein sequences read from the file.
Raises:

writeSequences(cls, sequences, file_name, file_format=1)
Class Method

 

Writes sequences to a file specified by file_name.

Parameters:
  • seqences - List of sequences to be written to file.
  • file_name (str) - Name of input file.
  • file_format (int) - Format of the input file. By default, the format is MMSEQIO_NATIVE.
  • sequences (list of ProteinSequence)
Raises: