Skip to content

Commit

Permalink
update readme and fix some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Starlitnightly committed Nov 10, 2023
1 parent aeda681 commit eb1cea1
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<h1 align="center">
<img src="https://raw.githubusercontent.com/Starlitnightly/omicverse/master/README.assets/logo.png" width="400">
</h1><br>

[![Lifecycle:maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing) [![bulid:passing](https://img.shields.io/appveyor/build/gruntjs/grunt)](https://img.shields.io/appveyor/build/gruntjs/grunt) [![License:GPL](https://img.shields.io/badge/license-GNU-blue)](https://img.shields.io/apm/l/vim-mode) [![pypi-badge](https://img.shields.io/pypi/v/omicverse)](https://pypi.org/project/omicverse) [![Documentation Status](https://readthedocs.org/projects/omicverse/badge/?version=latest)](https://omicverse.readthedocs.io/en/latest/?badge=latest) [![CodeQL](https://github.com/Starlitnightly/omicverse/workflows/CodeQL/badge.svg)](https://github.com/Starlitnightly/omicverse/workflows/CodeQL/badge.svg) [![Pytest](https://github.com/Starlitnightly/omicverse/workflows/py38|py39/badge.svg)](https://github.com/Starlitnightly/omicverse/)
[![Lifecycle:maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing) [![bulid:passing](https://img.shields.io/appveyor/build/gruntjs/grunt)](https://img.shields.io/appveyor/build/gruntjs/grunt) [![License:GPL](https://img.shields.io/badge/license-GNU-blue)](https://img.shields.io/apm/l/vim-mode) [![pypi-badge](https://img.shields.io/pypi/v/omicverse)](https://pypi.org/project/omicverse) [![Documentation Status](https://readthedocs.org/projects/omicverse/badge/?version=latest)](https://omicverse.readthedocs.io/en/latest/?badge=latest) [![pypiDownloads](https://static.pepy.tech/badge/omicverse)](https://pepy.tech/project/omicverse)[![condaDownloads](https://img.shields.io/conda/dn/conda-forge/omicverse?logo=Anaconda)](https://anaconda.org/conda-forge/omicverse)[![Pytest](https://github.com/Starlitnightly/omicverse/workflows/py38|py39/badge.svg)](https://github.com/Starlitnightly/omicverse/)

OmicVerse is the fundamental package for multi omics included bulk and single cell analysis with Python. For more information, please read our paper: [OmicVerse: A single pipeline for exploring the entire transcriptome universe](https://www.biorxiv.org/content/10.1101/2023.06.06.543913v1)

Expand Down Expand Up @@ -65,6 +64,7 @@ Please checkout the documentations and tutorials at [omicverse.readthedocs.io](h
- [19] [Scanorama](https://github.com/brianhie/scanorama) was originally published in [*Nature Biotechnology*](https://www.nature.com/articles/s41587-019-0113-3)
- [20] [Combat](https://github.com/epigenelabs/pyComBat/) was originally published in [*biorxiv*](https://doi.org/10.1101/2020.03.17.995431)
- [21] [TAPE](https://github.com/poseidonchan/TAPE) was originally published in [*Nature Communications*](https://doi.org/10.1038/s41467-022-34550-9)
- [22] [SEACells](https://github.com/dpeerlab/SEACells) was originally published in [*Nature Biotechnology*](https://www.nature.com/articles/s41587-023-01716-9)


## Included Package not published or preprint
Expand Down
8 changes: 6 additions & 2 deletions omicverse/bulk2single/_bulktrajblend.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ class BulkTrajBlend(object):
"""
BulkTrajBlend: A class for bulk and single cell data integration and trajectory inference using beta-VAE and GNN.
"""

def __init__(self,bulk_seq:pd.DataFrame,single_seq:anndata.AnnData,
celltype_key:str,bulk_group=None,
celltype_key:str,bulk_group=None,max_single_cells:int=5000,
top_marker_num:int=500,ratio_num:int=1,gpu:Union[int,str]=0) -> None:
"""
Initialize the BulkTrajBlend class
Expand All @@ -30,6 +31,7 @@ def __init__(self,bulk_seq:pd.DataFrame,single_seq:anndata.AnnData,
top_marker_num: The number of top marker genes for each cell type.
ratio_num: The number of cells to be selected for each cell type.
gpu: The gpu id or 'cpu' or 'mps'.
max_single_cells: The maximum number of single cells to be used. Default is 5000.
"""

Expand All @@ -40,6 +42,7 @@ def __init__(self,bulk_seq:pd.DataFrame,single_seq:anndata.AnnData,
self.ratio_num=ratio_num
self.gpu=gpu
self.group=bulk_group
self.max_single_cells=max_single_cells
if gpu=='mps' and torch.backends.mps.is_available():
print('Note that mps may loss will be nan, used it when torch is supported')
self.used_device = torch.device("mps")
Expand Down Expand Up @@ -104,12 +107,13 @@ def vae_configure(self,cell_target_num=None,**kwargs):
"""
self.vae_model=Bulk2Single(bulk_data=self.bulk_seq,single_data=self.single_seq,
celltype_key=self.celltype_key,bulk_group=self.group,
max_single_cells=self.max_single_cells,
top_marker_num=self.top_marker_num,ratio_num=self.ratio_num,gpu=self.gpu)
if cell_target_num!=None:
self.vae_model.cell_target_num=dict(zip(list(set(self.single_seq.obs[self.celltype_key])),
[cell_target_num]*len(list(set(self.single_seq.obs[self.celltype_key])))))
else:
self.vae_model.predicted_fraction(*kwargs)
self.vae_model.predicted_fraction(**kwargs)

self.vae_model.bulk_preprocess_lazy()
self.vae_model.single_preprocess_lazy()
Expand Down
3 changes: 2 additions & 1 deletion omicverse/single/_nocd.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def matrix_transform(self,clustertype='leiden'):

self.N, self.K = self.Z_gt.shape




def matrix_normalize(self,cuda=False):
if torch.cuda.is_available():
cuda=True
Expand Down
5 changes: 4 additions & 1 deletion omicverse/via/utils_via.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,10 @@ def pruning_clustergraph(adjacency, global_pruning_std=1, max_outgoing=30, prese
for i in range(len(locxy[0])):
if comp_labels[locxy[0][i]] != comp_labels[locxy[1][i]]:
x, y = locxy[0][i], locxy[1][i]

else:
x, y = 0, 0
#if x==0 and y==0:
# continue
cluster_graph_csr[x, y] = adjacency[x, y]
cluster_graph_csr[y, x] = adjacency[y, x]

Expand Down
4 changes: 4 additions & 0 deletions omicverse_guide/docs/Release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,4 +303,8 @@ update `conda install omicverse -c conda-forge`
- Fix the matrix error when the symbol of genes not unique.
- Fix the `interpolation` of BulkTrajBlend when the target cells not exist.
- Fix the `generate` of BulkTrajBlend.
- Fix thhe arguement of `vae_configure` in BulkTrajBlend when cell_target_num is None
- Add `max_single_cells` for BulkTrajBlend input

### single module
- Fix the error of pyVIA when root is None

0 comments on commit eb1cea1

Please sign in to comment.