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)

Attributes

author The author of the ContactFile
method The ContactFile-specific method
remark The ContactFile-specific remarks
target The target name
top_map The first ContactMap entry in ContactFile

Methods

add(entity) Add a child to the Entity
copy() Create a shallow copy of Entity
deepcopy() Create a deep copy of Entity
remove(id) Remove a child
sort(kword[, reverse, inplace]) Sort the ContactFile
author

The author of the ContactFile

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:

obj

The reference to the ContactMap, regardless of inplace

Raises:

ValueError

kword not in ContactFile

target

The target name

top_map

The first ContactMap entry in ContactFile