def parse_arguments(args=None):
    parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter, add_help=False, description='scHicCluster uses kmeans or spectral clustering to associate each cell to a cluster and therefore to its cell cycle. The clustering can be run on the raw data, on a kNN computed via the exact euclidean distance or via PCA. Please consider also the other clustering and dimension reduction approaches of the scHicExplorer suite. They can give you better results, can be faster or less memory demanding.')
    parserRequired = parser.add_argument_group('Required arguments')
    parserRequired.add_argument('--matrix', '-m', help='The single cell Hi-C interaction matrices to cluster. Needs to be in scool format', metavar='scool scHi-C matrix', required=True)
    parserRequired.add_argument('--numberOfClusters', '-c', help='Number of to be computed clusters', required=False, default=12, type=int)
    parserRequired.add_argument('--clusterMethod', '-cm', help='Algorithm to cluster the Hi-C matrices', choices=['spectral', 'kmeans'], default='spectral')
    parserOpt = parser.add_argument_group('Optional arguments')
    parserOpt.add_argument('--chromosomes', help='List of to be plotted chromosomes', nargs='+')
    parserOpt.add_argument('--intraChromosomalContactsOnly', '-ic', help='This option loads only the intra-chromosomal contacts. Can improve the cluster result if data is very noisy.', action='store_true')
    parserOpt.add_argument('--additionalPCA', '-pca', help='Computes PCA on top of a k-nn. Can improve the cluster result.', action='store_true')
    parserOpt.add_argument('--dimensionsPCA', '-dim_pca', help='The number of dimensions from the PCA matrix that should be considered for clustering. Can improve the cluster result.', default=20, type=int)
    parserOpt.add_argument('--dimensionReductionMethod', '-drm', help='Dimension reduction methods, knn with euclidean distance, pca', choices=['none', 'knn', 'pca'], default='none')
    parserOpt.add_argument('--createScatterPlot', '-csp', help='Create a scatter plot for the clustering, the x and y are the first and second principal component of the computed k-nn graph.', required=False, default=None)
    parserOpt.add_argument('--numberOfNearestNeighbors', '-k', help='Number of to be used computed nearest neighbors for the knn graph. Default is either the default value or the number of the provided cells, whatever is smaller.', required=False, default=100, type=int)
    parserOpt.add_argument('--dpi', '-d', help='The dpi of the scatter plot.', required=False, default=300, type=int)
    parserOpt.add_argument('--outFileName', '-o', help='File name to save the resulting clusters', required=True, default='clusters.txt')
    parserOpt.add_argument('--cell_coloring_type', '-cct', help='A two column list, first colum the cell names as stored in the scool file, second column the associated coloring for the scatter plot', required=False)
    parserOpt.add_argument('--cell_coloring_batch', '-ccb', help='A two column list, first colum the cell names as stored in the scool file, second column the associated coloring for the scatter plot', required=False)
    parserOpt.add_argument('--latexTable', '-lt', help='Return the overlap statistics if --cell_coloring_type is given as a latex table.')
    parserOpt.add_argument('--figuresize', help='Fontsize in the plot for x and y axis.', type=float, nargs=2, default=(15, 6), metavar=('x-size', 'y-size'))
    parserOpt.add_argument('--colorMap', help='Color map to use for the heatmap, supported are the categorical colormaps from holoviews: http://holoviews.org/user_guide/Colormaps.html', default='glasbey_dark')
    parserOpt.add_argument('--fontsize', help='Fontsize in the plot for x and y axis.', type=float, default=15)
    parserOpt.add_argument('--threads', '-t', help='Number of threads. Using the python multiprocessing module.', required=False, default=8, type=int)
    parserOpt.add_argument('--help', '-h', action='help', help='show this help message and exit')
    parserOpt.add_argument('--version', action='version', version='%(prog)s {}'.format(__version__))
    return parser
def parse_arguments(args=None):
    parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter, add_help=False, description='scHicCluster uses kmeans or spectral clustering to associate each cell to a cluster and therefore to its cell cycle. The clustering can be run on the raw data, on a kNN computed via the exact euclidean distance or via PCA. Please consider also the other clustering and dimension reduction approaches of the scHicExplorer suite. They can give you better results, can be faster or less memory demanding.')
    parserRequired = parser.add_argument_group('Required arguments')
    parserRequired.add_argument('--matrix', '-m', help='The single cell Hi-C interaction matrices to cluster. Needs to be in scool format', metavar='scool scHi-C matrix', required=True)
    parserRequired.add_argument('--numberOfClusters', '-c', help='Number of to be computed clusters', required=False, default=12, type=int)
    parserRequired.add_argument('--clusterMethod', '-cm', help='Algorithm to cluster the Hi-C matrices', choices=['spectral', 'kmeans'], default='spectral')
    parserOpt = parser.add_argument_group('Optional arguments')
    parserOpt.add_argument('--chromosomes', help='List of to be plotted chromosomes', nargs='+')
    parserOpt.add_argument('--intraChromosomalContactsOnly', '-ic', help='This option loads only the intra-chromosomal contacts. Can improve the cluster result if data is very noisy.', action='store_true')
    parserOpt.add_argument('--additionalPCA', '-pca', help='Computes PCA on top of a k-nn. Can improve the cluster result.', action='store_true')
    parserOpt.add_argument('--dimensionsPCA', '-dim_pca', help='The number of dimensions from the PCA matrix that should be considered for clustering. Can improve the cluster result.', default=20, type=int)
    parserOpt.add_argument('--dimensionReductionMethod', '-drm', help='Dimension reduction methods, knn with euclidean distance, pca', choices=['none', 'knn', 'pca'], default='none')
    parserOpt.add_argument('--createScatterPlot', '-csp', help='Create a scatter plot for the clustering, the x and y are the first and second principal component of the computed k-nn graph.', required=False, default=None)
    parserOpt.add_argument('--numberOfNearestNeighbors', '-k', help='Number of to be used computed nearest neighbors for the knn graph. Default is either the default value or the number of the provided cells, whatever is smaller.', required=False, default=100, type=int)
    parserOpt.add_argument('--dpi', '-d', help='The dpi of the scatter plot.', required=False, default=300, type=int)
    parserOpt.add_argument('--outFileName', '-o', help='File name to save the resulting clusters', required=True, default='clusters.txt')
    parserOpt.add_argument('--cell_coloring_type', '-cct', help='A two column list, first colum the cell names as stored in the scool file, second column the associated coloring for the scatter plot', required=False)
    parserOpt.add_argument('--cell_coloring_batch', '-ccb', help='A two column list, first colum the cell names as stored in the scool file, second column the associated coloring for the scatter plot', required=False)
    parserOpt.add_argument('--latexTable', '-lt', help='Return the overlap statistics if --cell_coloring_type is given as a latex table.')
    parserOpt.add_argument('--figuresize', help='Fontsize in the plot for x and y axis.', type=float, nargs=2, default=(15, 6), metavar=('x-size', 'y-size'))
    parserOpt.add_argument('--colorMap', help='Color map to use for the heatmap, supported are the categorical colormaps from holoviews: http://holoviews.org/user_guide/Colormaps.html', default='glasbey_dark')
    parserOpt.add_argument('--fontsize', help='Fontsize in the plot for x and y axis.', type=float, default=15)
    parserOpt.add_argument('--threads', '-t', help='Number of threads. Using the python multiprocessing module.', required=False, default=8, type=int)
    parserOpt.add_argument('--help', '-h', action='help', help='show this help message and exit')
    parserOpt.add_argument('--version', action='version', version='%(prog)s {}'.format(__version__))
    return parser