Building contactmaps

A set of small utilities to analyze polymer simulations

contactmaps.intload(filename, center='N/A')[source]

Warning

About to be deprecated

class contactmaps.h5dictLoad[source]

An experimental class to fetch h5dict values based on a fake filename.

It accepts filenames in a form /path-to-h5dict/h5dictKey

It automatically caches h5dicts that are already open

use simpleFetch method for concurrent fetching using fmap

Methods

contactmaps.rad2(data)[source]

Returns Rg(N^(2/3) This is an important point, as for a dense equilibrium globule at N^{2/3} both P(s) and Rg(s) plots reach a plateau.

contactmaps.giveIntContacts(data)[source]

give all contacts of a polymer on a cubic lattice Intersections are not counted as contacts. Sorry :(

Parameters:data : Nx3 or 3xN array of ints
contactmaps.giveContactsOpenMM(data, cutoff=1.7)[source]

A wrapper to an ultra-fast openmm filter by VJ Pande If you use it, you may want to cite OpenMM

contactmaps.giveContactsAny(data, cutoff=1.7, maxContacts=300)[source]

Returns contacts of any sets of molecules with a given cutoff. Is slower than give_contacts, but can tolerate multiple chains.

Parameters:

data : Nx3 or 3xN array

Polymer configuration. One chaon only.

cutoff : float , optional

Cutoff distance that defines contact

maxContacts : int

Maximum number of contacts per monomer. If total number of contacts exceeds maxContacts*N, program becomes uncontrollable.

Returns:

k by 2 array of contacts. Each row corresponds to a contact. :

contactmaps.giveContacts(data, cutoff=1.7, maxContacts=300, method='auto', tryOpenMM=True)[source]

Returns contacts of a single polymer with a given cutoff

Warning

Use this only to find contacts of a single polymer chain

with distance between monomers of 1. Multiple chains will lead to silent bugs.

Parameters:

data : Nx3 or 3xN array

Polymer configuration. One chaon only.

cutoff : float , optional

Cutoff distance that defines contact

maxContacts : int

Maximum number of contacts per monomer. If total number of contacts exceeds maxContacts*N, program becomes uncontrollable.

method : “auto”, “continuous”, “any”

Selects between a method suitable for a continuous polymer, and an auto method

Returns:

k by 2 array of contacts. Each row corresponds to a contact. :

contactmaps.giveDistanceMap(data, size=1000)[source]

returns a distance map of a polymer with a given size

contactmaps.rescalePoints(points, bins)[source]

converts array of contacts to the reduced resolution contact map

contactmaps.rescaledMap(data, bins, cutoff=1.7)[source]

calculates a rescaled contact map of a structure Parameters ———- data : Nx3 or 3xN array

polymer conformation
bins : Lx1 array
bin starts
cutoff : float, optional
cutoff for contacts
Returns:resXres array with the contact map :
contactmaps.pureMap(data, cutoff=1.7, contactMap=None)[source]

calculates an all-by-all contact map of a single polymer chain. Doesn’t work for multi-chain polymers!!! If contact map is supplied, it just updates it

Parameters:

data : Nx3 or 3xN array

polymer conformation

cutoff : float

cutoff for contacts

contactMap : NxN array, optional

contact map to update, if averaging is used

contactmaps.cool_trunk(data)[source]

somehow trunkates the globule so that the ends are on the surface

contactmaps.averageBinnedContactMap(filenames, chains=None, binSize=None, cutoff=1.7, n=4, loadFunction=<function load at 0x7f5aec8c9e60>, exceptionsToIgnore=None)[source]

Returns an average contact map of a set of conformations. Non-existing files are ignored if exceptionsToIgnore is set to IOError. example:

An example:

Parameters:

filenames : list of strings

Filenames to average map over

chains : list of tuples or Nx2 array

(start,end+1) of each chain

binSize : int

size of each bin in monomers

cutoff : float, optional

Cutoff to calculate contacts

n : int, optional

Number of threads to use. By default 4 to minimize RAM consumption.

exceptionsToIgnore : list of Exceptions

List of exceptions to ignore when finding the contact map. Put IOError there if you want it to ignore missing files.

Returns:

tuple of two values: :

(i) MxM numpy array with the conntact map binned to binSize resolution. :

(ii) chromosomeStarts a list of start sites for binned map. :

contactmaps.averagePureContactMap(filenames, cutoff=1.7, n=4, loadFunction=<function load at 0x7f5aec8c9e60>, exceptionsToIgnore=None)[source]
Parameters:

filenames : list of strings

Filenames to average map over

cutoff : float, optional

Cutoff to calculate contacts

n : int, optional

Number of threads to use. By default 4 to minimize RAM consumption with pure maps.

exceptionsToIgnore : list of Exceptions

List of exceptions to ignore when finding the contact map. Put IOError there if you want it to ignore missing files.

Returns:

An NxN (for pure map) numpy array with the contact map. :

Previous topic

Openmm-lib - a wrapper around Openmm to use with polymer simulations

Next topic

Knot complexity scripts

This Page