Skip to content

Commit

Permalink
initial commit of subpackage plot
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Simkovic committed Feb 8, 2017
1 parent 703689b commit c33b01d
Show file tree
Hide file tree
Showing 22 changed files with 405 additions and 325 deletions.
37 changes: 1 addition & 36 deletions conkit/core/ContactMap.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,39 +557,6 @@ def remove_neighbors(self, min_distance=5, inplace=False):

return contact_map

def plot_map(self, **kwargs):
"""Produce a 2D contact map plot
Parameters
----------
other : :obj:`conkit.core.ContactMap`, optional
A ConKit :obj:`conkit.core.ContactMap`
reference : :obj:`conkit.core.ContactMap`, optional
A ConKit :obj:`conkit.core.ContactMap` [this map refers to the reference contacts]
altloc : bool
Use the res_altloc positions [default: False]
file_format : str, optional
Plot figure format. See :func:`matplotlib.pyplot.savefig` for options [default: png]
file_name : str, optional
File name to which the contact map will be printed [default: contactmap.png]
Warnings
--------
* If the ``file_name`` variable is not changed, the current file will be
continuously overwritten.
* This function has been moved to :func:`conkit.plot.contact_map`.
Raises
------
RuntimeError
Matplotlib not installed
"""
import warnings
warnings.warn("This method will be removed in a future release, use conkit.plot.frequency() instead")
import conkit.plot
conkit.plot.contact_map(self, **kwargs)

def rescale(self, inplace=False):
"""Rescale the raw scores in :obj:`conkit.core.ContactMap`
Expand Down Expand Up @@ -698,9 +665,7 @@ def _create_keymap(contact_map, altloc=False):
def _find_single(contact_map, index):
"""Find all contacts associated with ``index`` based on id property"""
for c in contact_map:
if c.id[0] == index:
yield c
elif c.id[1] == index:
if c.id[0] == index or c.id[1] == index:
yield c

@staticmethod
Expand Down
42 changes: 0 additions & 42 deletions conkit/core/SequenceFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,6 @@ def calculate_freq(self):
RuntimeError
:obj:`conkit.core.SequenceFile` is not an alignment
See Also
--------
plot_freq
"""
if not self.is_alignment:
raise ValueError('This is not an alignment')
Expand All @@ -271,44 +267,6 @@ def calculate_freq(self):
# divide all by sequence length
return (aa_counts / len(msa_mat.T[0])).tolist()

def plot_freq(self, **kwargs):
"""Plot the gap frequency in each alignment column
This function calculates and plots the frequence of gaps at
each position in the Multiple Sequence Alignment.
Parameters
----------
file_format : str, optional
Plot figure format. See :func:`matplotlib.pyplot.savefig` for options [default: png]
file_name : str, optional
File name to which the plot will be printed [default: seqcov.png]
Warnings
--------
* If the ``file_name`` variable is not changed, the current file will be
continuously overwritten.
* This function has been moved to :func:`conkit.plot.sequence_coverage`.
Raises
------
MemoryError
Too many sequences in the alignment
RuntimeError
:obj:`conkit.core.SequenceFile` is not an alignment
RuntimeError
Matplotlib not installed
See Also
--------
calculate_freq
"""
import warnings
warnings.warn("This method will be removed in a future release, use conkit.plot.sequence_coverage() instead")
import conkit.plot
conkit.plot.sequence_coverage(self, **kwargs)

def sort(self, kword, reverse=False, inplace=False):
"""Sort the :obj:`conkit.core.SequenceFile`
Expand Down
223 changes: 0 additions & 223 deletions conkit/plot.py

This file was deleted.

Loading

0 comments on commit c33b01d

Please sign in to comment.