conkit.core.contactfile module

ContactFile container used throughout ConKit

class ContactFile(id)[source]

Bases: conkit.core.entity.Entity

A contact file object representing a single prediction file

The contact file class represents a data structure to hold all predictions with a single contact map file. It contains functions to store, manipulate and organise contact maps.

Examples

>>> from conkit.core import ContactMap, ContactFile
>>> contact_file = ContactFile("example")
>>> contact_file.add(ContactMap("foo"))
>>> contact_file.add(ContactMap("bar"))
>>> print(contact_file)
ContactFile(id="example" nseq=2)
author

The author of the ContactFile

Type:str
method

The ContactFile-specific method

Type:list, str
remark

The ContactFile-specific remarks

Type:list, str
target

The target name

Type:str
top_map

The first ContactMap entry in ContactFile

Type:ContactMap
author
method

The ContactFile-specific method

remark

The ContactFile-specific remarks

sort(kword, reverse=False, inplace=False)[source]

Sort the ContactFile

Parameters:
  • kword (str) – The dictionary key to sort contacts by
  • reverse (bool, optional) – Sort the contact pairs in descending order [default: False]
  • inplace (bool, optional) – Replace the saved order of contacts [default: False]
Returns:

The reference to the ContactMap, regardless of inplace

Return type:

ContactMap

Raises:

ValueErrorkword not in ContactFile

target
top_map

The first ContactMap entry