Brief Overview of Package Use
Contents
Brief Overview of Package Use#
Python package implementing and expanding on the universal sequence mapping tools created by S. Vinga and J. Almeida and referenced in 1 2 3.
The USM class is a basic class for holding computed USM/CGR coordinates. There are two class methods for instantiating a USM class: Use the method USM.make_usm() to get and store the USM coordinates of a data sequence. Use the method USM.cgr2d() to get 2d CGR coordinates using the formula derived in 3
Example:
import pyusm
data = ['a', 'b', 'c']
#produces an instance of the USM class with form 'USM'
datausm = pyusm.USM.make_usm(data)
#produces an instance of the USM class with form '2DCGR'
datacgr = pyusm.USM.cgr2d(data)
Feed a list of USM forward coordinates to usm_entropy.renyi2usm() to compute the continuous quadratic renyi entropy of the USM map. Note: This function does not currently accept full instances of the USM class. When calling you must provide the attribute containing the coordinates to compute entropy for.
Example:
from pyusm import usm_entropy
#computes the quadratic renyi entropy values from the forward USM map coordinates in datausm.fw
rn2dict = usm_entropy.renyi2usm(datausm.fw)
See Demo of Universal Sequence Maps (USM) in Python for an in-depth description of the theory behind CGR and USM maps and how USM coordinates are calculated.
See Demo of USM Renyi Entropy in Python for an explanation and proof of the implementation of the continuous quadratic renyi entropy formula for USM coordinates.