Skip to content

Commit

Permalink
Fixing the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimwolff committed Jul 27, 2021
1 parent 119a582 commit ed804ad
Show file tree
Hide file tree
Showing 19 changed files with 45 additions and 25 deletions.
7 changes: 5 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@
'matplotlib', 'matplotlib.pyplot', 'matplotlib.gridspec', 'matplotlib.ticker',
'matplotlib.textpath', 'matplotlib.patches', 'matplotlib.colors', 'matplotlib.cm',
'mpl_toolkits', 'mpl_toolkits.axisartist', 'mpl_toolkits.mplot3d', 'mpl_toolkits.axes_grid1',
'Bio', 'Bio.Seq', 'pyBigWig', 'tables', 'pytables', 'future', 'past', 'past.builtins',
'Bio.Seq', 'pyBigWig', 'tables', 'pytables', 'future', 'past', 'past.builtins',
'future.utils', 'cooler', 'logging', 'unidecode', 'hic2cool', 'hicmatrix', 'hicmatrix.HiCMatrix',
'hicmatrix.lib', 'krbalancing', 'fit_nbinom', 'pybedtools', 'graphviz', 'hyperopt', 'sklearn', 'sklearn.cluster']
'hicmatrix.lib', 'krbalancing', 'fit_nbinom', 'pybedtools', 'graphviz', 'hyperopt', 'sklearn', 'sklearn.cluster',
'h5py', 'numpy.random', 'sklearn', 'sklearn.model_selection', 'matplotlib.backends', 'sklearn.preprocessing',
'matplotlib.backends.backend_agg', 'cleanlab.classification', 'imblearn.under_sampling', 'sklearn.ensemble',
'sklearn.metrics', 'sklearn.impute', 'tarfile']

for mod_name in MOCK_MODULES:
sys.modules[mod_name] = Mock()
Expand Down
2 changes: 1 addition & 1 deletion docs/content/News.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Release 3.4.2

Preprint
--------
**6 March 2020*
**6 March 2020**

The preprint of the loop detection algorithm is online via biorXiv: `<https://www.biorxiv.org/content/10.1101/2020.03.05.979096v1>`_

Expand Down
8 changes: 7 additions & 1 deletion docs/content/list-of-tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ Tools for TADs processing
tools/hicDifferentialTAD
tools/hicMergeTADbins
tools/hicInterIntraTAD
tools/hicTrainTADClassifier
tools/hicTADClassifier


Tools for Hi-C and TADs visualization
Expand Down Expand Up @@ -115,7 +117,11 @@ For single-cell Hi-C data analysis please use `scHiCExplorer <https://schicexplo
|:ref:`hicDifferentialTAD` | analysis | two Hi-C matrices | two diff_tad files: accepted H0 and | Identifies differential Topologically Associating Domains (TADs) between |
| | | one TAD domain file | rejected H0. Similar to BED6 | two Hi-C matrices |
+--------------------------------------+------------------+-----------------------------------+---------------------------------------------+-----------------------------------------------------------------------------------+
|:ref:`hicInterIntraTAD` | analysis | Hi-C matrix, TAD boundaries | data file and a plot | Computes and extracts TAD data. Creates a plot for the inter/intra contact ratio. |
|:ref:`hicInterIntraTAD` | analysis | Hi-C matrix, TAD boundaries | data file and a plot | Computes and extracts TAD data. Creates a plot for the inter/intra contact ratio. |
+--------------------------------------+------------------+-----------------------------------+---------------------------------------------+-----------------------------------------------------------------------------------+
|:ref:`hicTrainTADClassifier` | analysis | Hi-C matrix, TAD boundaries | ML model for hicTADClassifier | Computes a ML model for hicTADClassifier. |
+--------------------------------------+------------------+-----------------------------------+---------------------------------------------+-----------------------------------------------------------------------------------+
|:ref:`hicTADClassifier` | analysis | Hi-C matrix, (ML model) | predicted TAD boundaries | Computes TAD boundaries based on a ML model from hicTrainTADClassifier |
+--------------------------------------+------------------+-----------------------------------+---------------------------------------------+-----------------------------------------------------------------------------------+
|:ref:`hicPlotMatrix` | visualization | hicMatrix object | a heatmap of Hi-C contacts | Plots a Hi-C matrix as a heatmap |
+--------------------------------------+------------------+-----------------------------------+---------------------------------------------+-----------------------------------------------------------------------------------+
Expand Down
3 changes: 3 additions & 0 deletions docs/content/tools/hicPlotSVL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ hicPlotSVL

Description
^^^^^^^^^^^
.. argparse::
:ref: hicexplorer.hicPlotSVL.parse_arguments
:prog: hicPlotSVL

hicPlotSVL computes the ratio between short range and long range contacts per chromosome independently. Per sample one box plot is created and, if more than one sample is given,
the computed ratios are assumed to be one distribution and a Wilcoxon rank-sum test under H0 'distributions are equal' is computed. All used data is written to a third raw data file.
Expand Down
2 changes: 1 addition & 1 deletion docs/content/tools/hicTrainTADClassifier.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _hicTrainTADClassifier:

hicTrainTADClassifier
==================
=====================

.. contents::
:local:
Expand Down
3 changes: 2 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ tool description
:ref:`hicHyperoptDetectLoops` Search for optimal hicDectectLoops parameters
:ref:`hicHyperoptDetectLoopsHiCCUPS` Search for optimal Juicer HiCCUPS parameters
:ref:`hicInterIntraTAD` Extras and computes inter and intra TAD data

:ref:`hicTrainTADClassifier` Train a classifier to predict TADs with hicTADClassifier
:ref:`hicTADClassifier` Predict TAD boundaries with hicTADClassifier
==================================== ==========================================================================================================================================================

Getting Help
Expand Down
3 changes: 2 additions & 1 deletion hicexplorer/chicPlotViewpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import matplotlib.gridspec as gridspec
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
import matplotlib as mpl
mpl.rcParams['pdf.fonttype'] = 42
import hicmatrix.HiCMatrix as hm
from hicexplorer import utilities
from hicexplorer._version import __version__
Expand Down Expand Up @@ -298,6 +297,8 @@ def plot_images(pInteractionFileList, pHighlightDifferentialRegionsFileList, pBa

def main(args=None):
args = parse_arguments().parse_args(args)
mpl.rcParams['pdf.fonttype'] = 42

viewpointObj = Viewpoint()
background_data = None

Expand Down
5 changes: 2 additions & 3 deletions hicexplorer/chicQualityControl.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.rcParams['pdf.fonttype'] = 42

from hicmatrix import HiCMatrix as hm
from hicexplorer._version import __version__
from .lib import Viewpoint
Expand Down Expand Up @@ -126,7 +125,7 @@ def compute_sparsity(pReferencePoints, pViewpointObj, pArgs, pQueue):

def main(args=None):
args = parse_arguments().parse_args(args)

matplotlib.rcParams['pdf.fonttype'] = 42
viewpointObj = Viewpoint()
referencePoints, _ = viewpointObj.readReferencePointFile(
args.referencePoints)
Expand Down
5 changes: 3 additions & 2 deletions hicexplorer/hicAggregateContacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
import matplotlib.gridspec as gridspec
import matplotlib.cm as cm
from mpl_toolkits.mplot3d import Axes3D
import matplotlib as mpl
mpl.rcParams['pdf.fonttype'] = 42

# from scipy.cluster.vq import vq, kmeans
# from scipy.cluster.hierarchy import fcluster, linkage
import sklearn.cluster as skclust
Expand Down Expand Up @@ -859,6 +858,8 @@ def plot_diagnostic_heatmaps(clustered_info, M_half, args):

def main(args=None):
args = parse_arguments().parse_args(args)
matplotlib.rcParams['pdf.fonttype'] = 42

ma = hm.hiCMatrix(args.matrix)
ma.maskBins(ma.nan_bins)
ma.matrix.data[np.isnan(ma.matrix.data)] = 0
Expand Down
4 changes: 2 additions & 2 deletions hicexplorer/hicCompartmentalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.rcParams['pdf.fonttype'] = 42

import logging
from hicmatrix import HiCMatrix as hm
from hicexplorer._version import __version__
Expand Down Expand Up @@ -177,6 +176,7 @@ def main(args=None):
Main function to generate the polarization plot.
"""
args = parse_arguments().parse_args(args)
matplotlib.rcParams['pdf.fonttype'] = 42

pc1 = pd.read_table(args.pca, header=None, sep="\t",
dtype={0: "object", 1: "Int64", 2: "Int64", 3: "float32"})
Expand Down
5 changes: 3 additions & 2 deletions hicexplorer/hicCorrectMatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
import matplotlib as mpl
mpl.rcParams['pdf.fonttype'] = 42
import matplotlib
import numpy as np
debug = 0

Expand Down Expand Up @@ -591,6 +590,8 @@ def filter_by_zscore(hic_ma, lower_threshold, upper_threshold, perchr=False):

def main(args=None):
args = parse_arguments().parse_args(args)
matplotlib.rcParams['pdf.fonttype'] = 42

if args.verbose:
log.setLevel(logging.INFO)

Expand Down
4 changes: 2 additions & 2 deletions hicexplorer/hicCorrelate.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# for plotting
from matplotlib import use as mplt_use
import matplotlib as mpl
mpl.rcParams['pdf.fonttype'] = 42

mplt_use('Agg')

import matplotlib.pyplot as plt
Expand Down Expand Up @@ -247,7 +247,7 @@ def get_vectors(mat1, mat2):
def main(args=None):

args = parse_arguments().parse_args(args)

mpl.rcParams['pdf.fonttype'] = 42
if args.labels and len(args.matrices) != len(args.labels):
log.error("The number of labels does not match the number of matrices.")
exit(0)
Expand Down
2 changes: 1 addition & 1 deletion hicexplorer/hicInterIntraTAD.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from copy import deepcopy
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.rcParams['pdf.fonttype'] = 42
import logging
log = logging.getLogger(__name__)
from hicmatrix import HiCMatrix as hm
Expand Down Expand Up @@ -271,6 +270,7 @@ def computeInterIntraTADs(pMatrix, pDomainList, pCoolOrH5, pThreadId, pQueue):

def main(args=None):
args = parse_arguments().parse_args(args)
mpl.rcParams['pdf.fonttype'] = 42

# read domains file
domains_df = readDomainBoundaries(args.tadDomains)
Expand Down
2 changes: 1 addition & 1 deletion hicexplorer/hicPlotAverageRegions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import matplotlib
matplotlib.use('Agg')
import matplotlib as mpl
mpl.rcParams['pdf.fonttype'] = 42
from matplotlib.colors import LogNorm
import matplotlib.pyplot as plt
import numpy as np
Expand Down Expand Up @@ -76,6 +75,7 @@ def parse_arguments(args=None):
def main(args=None):

args = parse_arguments().parse_args(args)
mpl.rcParams['pdf.fonttype'] = 42

matrix = load_npz(args.matrix)

Expand Down
3 changes: 2 additions & 1 deletion hicexplorer/hicPlotDistVsCounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.rcParams['pdf.fonttype'] = 42

from collections import OrderedDict
from past.builtins import zip
Expand Down Expand Up @@ -406,6 +405,8 @@ def main(args=None):
"""

args = parse_arguments().parse_args(args)
mpl.rcParams['pdf.fonttype'] = 42

mean_dict = OrderedDict()
matrix_sum = {}
if args.labels is None:
Expand Down
3 changes: 2 additions & 1 deletion hicexplorer/hicPlotMatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from matplotlib.colors import LogNorm
import matplotlib
import matplotlib as mpl
mpl.rcParams['pdf.fonttype'] = 42
import argparse
from past.builtins import zip
import pyBigWig
Expand Down Expand Up @@ -637,6 +636,8 @@ def bigwig_axes_config(pArgs, pBigWigInfo):

def main(args=None):
args = parse_arguments().parse_args(args)
mpl.rcParams['pdf.fonttype'] = 42

if args.title:
args.title = remove_non_ascii(args.title)

Expand Down
3 changes: 2 additions & 1 deletion hicexplorer/hicPlotSVL.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import matplotlib as mpl
mpl.rcParams['pdf.fonttype'] = 42
from scipy.stats import ranksums

from hicmatrix import HiCMatrix as hm
Expand Down Expand Up @@ -132,6 +131,8 @@ def compute_relation_short_long_range(pHiCMatrix, pChromosomes, pDistance, pIsCo
def main(args=None):

args = parse_arguments().parse_args(args)
mpl.rcParams['pdf.fonttype'] = 42

short_v_long_range = []
sum_smaller = []
sum_greater = []
Expand Down
3 changes: 2 additions & 1 deletion hicexplorer/hicPlotViewpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.rcParams['pdf.fonttype'] = 42
import os
from hicexplorer._version import __version__

Expand Down Expand Up @@ -106,6 +105,8 @@ def getViewpointValues(pMatrix, pReferencePoint, pChromViewpoint, pRegion_start,

def main(args=None):
args = parse_arguments().parse_args(args)
mpl.rcParams['pdf.fonttype'] = 42

log.warning('This tool is deprecated. Please use chicViewpoint, chicViewpointBackgroundModel and chicPlotViewpoint.')
if args.region:

Expand Down
3 changes: 2 additions & 1 deletion hicexplorer/hicPrepareQCreport.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.rcParams['pdf.fonttype'] = 42
from hicexplorer._version import __version__

import logging
Expand Down Expand Up @@ -261,6 +260,8 @@ def main(args=None):
"""

args = parse_arguments().parse_args(args)
mpl.rcParams['pdf.fonttype'] = 42

params = dict()
make_sure_path_exists(args.outputFolder)
for fh in args.logfiles:
Expand Down

0 comments on commit ed804ad

Please sign in to comment.