https://github.com/atarashansky/self-assembling-manifold
The Self-Assembling-Manifold (SAM) algorithm.
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
1 of 9 committers (11.1%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.7%) to scientific vocabulary
Keywords from Contributors
Repository
The Self-Assembling-Manifold (SAM) algorithm.
Basic Info
- Host: GitHub
- Owner: atarashansky
- License: mit
- Language: Python
- Default Branch: master
- Size: 29.6 MB
Statistics
- Stars: 44
- Watchers: 3
- Forks: 11
- Open Issues: 3
- Releases: 0
Metadata Files
README.md
self-assembling-manifold -- SAM version 1.0.1
The Self-Assembling-Manifold (SAM) algorithm.
Requirements
numpyscipypandasscikit-learnumap-learnnumbaanndataharmony
Optional dependencies
Interactive GUI (Jupyter notebooks)
plotly==4.0.0ipythonwidgetsjupytercolorloveripyevents
Plots
matplotlib
Clustering
louvainleidenalghdbscancython
scanpy
Installation
Docker
Build the Docker image with:
git clone https://github.com/atarashansky/self-assembling-manifold.git
cd Docker
bash build_image.sh
Run the Docker image with:
bash run_image.sh
It will ask you to provide the image name, container name, port to run the Jupyter notebook server on, and the path to a directory that will be mounted onto the Docker container's file system.
Anaconda
SAM requires python>=3.7. Python can be installed using Anaconda.
Download Anaconda from here: https://www.anaconda.com/download/
Create and activate a new environment with python3.7 as follows:
conda create -n environment_name python=3.7
conda activate environment_name
Having activated the environment, SAM can be downloaded from the PyPI repository using pip or, for the development version, downloaded from the github directly.
PIP install:
pip install sam-algorithm
Development version install:
git clone https://github.com/atarashansky/self-assembling-manifold.git
cd self-assembling-manifold
python setup.py install
For plotting, install matplotlib:
pip install matplotlib
For interactive data exploration (in the SAMGUI.py module), jupyter, ipythonwidgets, colorlover, ipyevents, and plotly are required. Install them in the previously made environment like so:
conda install -c conda-forge -c plotly jupyter ipywidgets plotly=4.0.0 colorlover ipyevents
Enabling the SAM GUI in JupyterLab
If you use Jupyter Notebooks, these steps are not needed. If you would like to be able to run SAMGUI in JupyterLab, please do the following:
First install nodejs with:
conda install nodejs
To enable ipythonwidgets in Jupyter lab, please run the following:
jupyter labextension install @jupyter-widgets/jupyterlab-manager@1.0 --no-build
jupyter labextension install plotlywidget@1.1.0 --no-build
jupyter labextension install jupyterlab-plotly@1.1.0 --no-build
jupyter lab build
SAMGUI should now work in JupyterLab.
Running the SAM GUI
The SAM GUI interface can be run in Jupyer notebooks with the following:
from samalg.gui import SAMGUI
sam_gui = SAMGUI(sam) # sam is your SAM object
sam_gui.SamPlot
Please see the plotting tutorial for more information about the GUI interface.

Basic usage
There are a number of different ways to load data into the SAM object.
Using the SAM constructor
Using preloaded scipy.sparse or numpy expression matrix, gene IDs, and cell IDs:
from samalg import SAM #import SAM
sam=SAM(counts=(matrix,geneIDs,cellIDs))
sam.preprocess_data() # log transforms and filters the data
sam.run() #run with default parameters
sam.scatter()
Using preloaded pandas.DataFrame (cells x genes):
from samalg import SAM #import SAM
sam=SAM(counts=dataframe)
sam.preprocess_data() # log transforms and filters the data
sam.run() #run with default parameters
sam.scatter()
Using an existing AnnData object:
from samalg import SAM #import SAM
sam=SAM(counts=adata)
sam.preprocess_data() # log transforms and filters the data
sam.run() #run with default parameters
sam.scatter()
Using the load_data function
Loading data from a tabular file (e.g. csv or txt):
``` from samalg import SAM #import SAM sam=SAM() #initialize SAM object sam.loaddata('/path/to/expressiondata_file.csv') #load data from a csv file
sam.loaddata('/path/to/expressiondata_file.txt', sep='\t') #load data from a txt file with tab delimiters
sam.preprocessdata() # log transforms and filters the data sam.loadannotations('/path/to/annotations_file.csv') sam.run() sam.scatter() ```
Loading an existing AnnData h5ad file:
If loading tabular data (e.g. from a csv), load_data by default saves the sparse data structure to a h5ad file in the same location as the tabular file for faster loading in subsequent analyses. This file can be loaded as:
from samalg import SAM #import SAM
sam=SAM() #initialize SAM object
sam.load_data('/path/to/h5ad_file.h5ad') #load data from a h5ad file
sam.preprocess_data() # log transforms and filters the data
sam.run()
sam.scatter()
Saving/Loading SAM
If you wish to save the SAM outputs and raw and filtered data, you can write sam.adata to a h5ad file as follows:
sam.save_anndata(filename).
You can load this data back with sam.load_data:
sam.load_data(filename)
Citation
If using the SAM algorithm, please cite the following eLife paper: https://elifesciences.org/articles/48994
Tarashansky, A. J. et al. Self-assembling manifolds in single-cell RNA sequencing data. eLife 8, e48994 (2019).
Adding extra functionality
As always, please submit a new issue if you would like to see any functionalities / convenience functions / etc added.
Owner
- Login: atarashansky
- Kind: user
- Repositories: 3
- Profile: https://github.com/atarashansky
GitHub Events
Total
- Issues event: 2
- Watch event: 2
Last Year
- Issues event: 2
- Watch event: 2
Committers
Last synced: about 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| atarashansky | t****n@s****u | 396 |
| atarashansky | a****y@g****m | 242 |
| atarashansky | a****y@c****g | 16 |
| Fabio Zanini | f****i@f****m | 11 |
| atarashans | a****y@i****m | 5 |
| atarashansky | a****y@c****m | 2 |
| atarashansky | a****y@C****t | 2 |
| Alexander Tarashansky | a****y@C****l | 2 |
| atarashansky | a****y@a****l | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 41
- Total pull requests: 6
- Average time to close issues: about 1 month
- Average time to close pull requests: about 23 hours
- Total issue authors: 22
- Total pull request authors: 3
- Average comments per issue: 2.56
- Average comments per pull request: 0.17
- Merged pull requests: 5
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 4
- Pull requests: 1
- Average time to close issues: about 2 months
- Average time to close pull requests: 4 days
- Issue authors: 3
- Pull request authors: 1
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- atarashansky (15)
- Sayyam-Shah (3)
- dnanes (2)
- georgyFenix (2)
- fenghuijian (2)
- CisnerosFernandez (1)
- andygxzeng (1)
- avianalter (1)
- xuesoso (1)
- hl324 (1)
- nkm47 (1)
- qisun2 (1)
- pythonhelp (1)
- flying-sheep (1)
- iosonofabio (1)
Pull Request Authors
- iosonofabio (3)
- atarashansky (2)
- georgyFenix (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 230 last-month
- Total dependent packages: 2
- Total dependent repositories: 4
- Total versions: 56
- Total maintainers: 1
pypi.org: sam-algorithm
The Self-Assembling-Manifold algorithm
- Homepage: https://github.com/atarashansky/self-assembling-manifold
- Documentation: https://sam-algorithm.readthedocs.io/
- License: mit
-
Latest release: 1.0.2
published over 3 years ago
Rankings
Maintainers (1)
Dependencies
- anndata >=0.7.4
- dill *
- h5py <=2.10.0
- harmonypy *
- numba >=0.50.1
- numpy >=1.19.0
- packaging >=0.20.0
- pandas >1.0.0
- scikit-learn >=0.23.1
- scipy >=1.3.1
- umap-learn >=0.4.6
- debian buster-slim build