-
Notifications
You must be signed in to change notification settings - Fork 19
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 #15 from NelleV/doc
Better documentation.
- Loading branch information
Showing
5 changed files
with
77 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
To reference iced in publication, please cite the following: | ||
|
||
@Article{servant:hicpro, | ||
Author="Servant, N. and Varoquaux, N. and Lajoie, B. R. and Viara, E. | ||
and Chen, C. J. and Vert, J. P. and Heard, E. and Dekker, J. and | ||
Barillot, E. ", | ||
Title="{{H}i{C}-{P}ro: an optimized and flexible pipeline for {H}i-{C} data processing}", | ||
Journal="Genome Biol.", | ||
Year="2015", | ||
Volume="16", | ||
Pages="259" | ||
} |
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,6 @@ | ||
.. _utils_examples: | ||
|
||
Utils | ||
------------- | ||
|
||
Examples concerning the :mod:`iced.utils` module. |
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,41 @@ | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
from matplotlib import colors | ||
|
||
from iced import datasets | ||
from iced.utils import get_intra_mask | ||
from iced.utils import get_inter_mask | ||
|
||
""" | ||
Extracting parts of a contact map. | ||
This examples shows how to use a mask to plot only the inter or the intra | ||
contact map. | ||
""" | ||
|
||
# Loading a sample dataset | ||
counts, lengths = datasets.load_sample_yeast() | ||
intra_mask = get_intra_mask(lengths) | ||
inter_mask = get_inter_mask(lengths) | ||
|
||
fig, axes = plt.subplots(ncols=2, figsize=(12, 6)) | ||
inter_counts = counts.copy() | ||
inter_counts[intra_mask] = np.nan | ||
intra_counts = counts.copy() | ||
intra_counts[inter_mask] = np.nan | ||
|
||
m = axes[0].matshow(intra_counts, cmap="Blues", norm=colors.SymLogNorm(1), | ||
origin="bottom", | ||
extent=(0, len(counts), 0, len(counts))) | ||
m = axes[1].matshow(inter_counts, cmap="Blues", norm=colors.SymLogNorm(1), | ||
origin="bottom", | ||
extent=(0, len(counts), 0, len(counts))) | ||
|
||
axes[0].set_title("Intra-chromosomal maps") | ||
axes[1].set_title("Inter-chromosomal maps") | ||
|
||
[axes[0].axhline(i, linewidth=1, color="#000000") for i in lengths.cumsum()] | ||
[axes[0].axvline(i, linewidth=1, color="#000000") for i in lengths.cumsum()] | ||
[axes[1].axhline(i, linewidth=1, color="#000000") for i in lengths.cumsum()] | ||
[axes[1].axvline(i, linewidth=1, color="#000000") for i in lengths.cumsum()] |