forked from hiclib/iced
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request hiclib#14 from NelleV/select_partial_matrix
ENH added utility function to select subsample of the matrix
- Loading branch information
Showing
9 changed files
with
157 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.. _utils: | ||
|
||
============== | ||
Utilities | ||
============== | ||
|
||
The :mod:`utils` submodule contains utilities function. | ||
|
||
.. currentmodule:: iced.utils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import matplotlib.pyplot as plt | ||
from matplotlib import colors | ||
|
||
from iced import datasets | ||
from iced.utils import extract_sub_contact_map | ||
|
||
""" | ||
Extracting parts of a contact map. | ||
This example shows how to extract contact counts associated to some chromosomes | ||
of the contact maps. Here, we extract chromosomes 1, 4 and 5 of the budding | ||
yeasts contact map | ||
""" | ||
|
||
# Loading a sample dataset | ||
counts, lengths = datasets.load_sample_yeast() | ||
sub_counts, sub_lengths = extract_sub_contact_map(counts, lengths, [0, 3, 4]) | ||
|
||
fig, ax = plt.subplots() | ||
m = ax.matshow(sub_counts, cmap="Blues", norm=colors.SymLogNorm(1), | ||
origin="bottom", | ||
extent=(0, len(sub_counts), 0, len(sub_counts))) | ||
[ax.axhline(i, linewidth=1, color="#000000") for i in lengths.cumsum()] | ||
[ax.axvline(i, linewidth=1, color="#000000") for i in lengths.cumsum()] | ||
cb = fig.colorbar(m) | ||
ax.set_title("Chromosomes I, IV and V of yeast") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters