scHiCPTR
1. Introduction
scHiCPTR is an unsupervised pseudotime inference pipeline through dual graph refinement for single cell Hi-C data. It reconciles pseudotime inference in the case of circular and bifurcating topology.
2. Installation & example
2.1 OS
- ubuntu 18.04
2.2 Required Python Packages
Make sure all the packages listed in the requirements.txt are installed.
- Python>=3.6
- numpy>=1.18.0
- pandas
- igraph>=0.9.8
- matplotlib>=3.3.2
2.3 Install from Github
First, download the folder scHiCPTR.
$ git clone https://github.com/lhqxinghun/scHiCPTR
Second, install the package with following command:
$ cd scHiCPTR
$ pip install .
2.4 Or install from PyPI
$ pip install scHiCPTR
**2.5 run example **
$ cd scHiCPTR/examples
$ python cellcycle.py
3. Usage
3.1 Input parameters
-
data: np.ndarray, it lists the paths of contact matrices for each cell, e.g.['path to cell_1','path_to_cell_2',...].
-
imp_method:str, the imputation method, it can be "convolution_randomwalk" or None(means no imputation)
-
chromsize:dict, it specifies the size for each chromosome and according to the reference genome, e.g. for mm9, it shall be {'1':197195432,'2':181748087,...'X':166650296}. Elements in it correspond to the contact matrics of chromosomes for a cell. (If it is set to None, the default chromsome size will be defined by mm9)
-
resolution:int, the binsize of the contact matrices.(default 1000000)
-
imp_args: dict, the parameter for imputation if the "imputation_method" is not None, including pad (int) for convolution, rp (float) for random walk, prct(float) for binaryzation, ncpus(int) for the multiprocessing.
If it is set to None by default, they will be 3,0.5,20 and 10, respectively.
-
emb_method: str, the embedding method,it can be "schicptr", "PCA" or "PPCA".
"schicptr":combing PCA and UMAP i.e. the pipeline in manucript of scHiCPTR
"PCA": using PCA only to reduce dimension
"PPCA" : replacing the imputation PCA with probabilistic PCA. (imp_method should be set to None)
-
emb_args: dict, the parameters for embedding, including pca_ncomponent (int), umap_neighbour (int), umap_mindist (float), umap_ncomponent (int), umap_metric (str), ppca_sigma (float)
If it is set to None by default, they will be 120, 100, 0.5, 20, 'euclidean' and 50, respectively.
-
embedding:np.ndarray with 2 dimensions, the 1st shape is the number of cells and the 2nd shape is the dimension of embeddings. Note that data will be ignored if this parameter is valid.
-
start:int, the root cell for trajectory inference. (default 0)
-
knn_args:dict, including the 'n_neighbors' and 'metric' for knn graph construction. (default 100 and 'euclidean', respectively)
-
prune_args:dict, including the 'lambda_'for mixture of HIS, 'threshold' for purning, and 'louvain_res' for louvain clustering. (default 0.5, 0.7 and 0.5, respectively)
3.2 Input with contact matrices
Data preparation Sparse matrices: For each cell, each intra-chromosomal contact matrice is stored in a .txt file. The file contain three columns separated by tab, i.e. sparse format of the contact matrix . The name of the file need to be in the format of 'cell_{id}_chr{nm}.txt'. {id} is the number of cells (like 1, 2, 3,...) and {nm} is the number of chromosome (like 1, 2, ..., X).
Parameters setting To perform scHiCPTR on contact matrices, the embedding should be set to None, the data indicates the path for each cell, and the chromsize and resolution should be specified accordingly.
Note that we have provided an example of input matrices in /data/matrices/1M, and the example code for this can be found at /example/cellcycle.py
3.3 Input with embeded vectors
the embedding should be an np.ndarray with 2 dimensions, the 1st dimension is the number of cells and the 2nd dimension is the dimension of embeddings. the data,chromsize, and resolution will be ignored.
we have also provided an example of input embeddings in /data/embeds, and the example code for this can be found at /example/cellcycle.py
3.4 Alternative operations in the software
The scHiCPTR allows users to replace the imputation and embedding components if they need to. Take two cases here as examples
Using PC space instead of UMAP
For this case, just set the emb_method to "PCA", and adjust the "pca_component" in emb_args to target dimension
Using probabilistic PCA for preprocessing
Since probabilistic PCA has an ability to handle missing values, users can replace the imputation and pre-dimensionalization step with it. This can be down by setting the imp_method to None and emb_method to "PPCA".
Metadata
Release files for scHiCPTR 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| scHiCPTR-0.1.2.tar.gz | 12.3 MB | Without provenance | Details for scHiCPTR-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| scHiCPTR-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for scHiCPTR-0.1.2-py3-none-any.whl |
Total release size: 12.4 MB
Release files / scHiCPTR-0.1.2.tar.gz
| Download URL | scHiCPTR-0.1.2.tar.gz |
|---|---|
| Size | 12.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0f06d73fc62d506216c51f21e0b5664dd1565bfa82015eada4074e98c0d5ee4f
|
|
BLAKE2b-256 checksum How to use checksums |
6bbc794a07e691573267880aee80efe4674d062ee3c853f9bc13faaeda536eab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.12 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.1
|
Release files / scHiCPTR-0.1.2-py3-none-any.whl
| Download URL | scHiCPTR-0.1.2-py3-none-any.whl |
|---|---|
| Size | 17.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
de5c5b42ec3c06ea061f66062d804b211cbd34a56b0394a670934d745c0b61f1
|
|
BLAKE2b-256 checksum How to use checksums |
00f6f07b76648ef775510b084a6bdde8f19941be1080b6acfd017a9c159115bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.12 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.1
|
Security for scHiCPTR 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.