https://github.com/marrlab/batchdetect
BatchDetect: a python package for detect systematic batch effects in datasets
https://github.com/marrlab/batchdetect
Last synced: about 1 year ago
JSON representation
BatchDetect: a python package for detect systematic batch effects in datasets
- Host: GitHub
- URL: https://github.com/marrlab/batchdetect
- Owner: marrlab
- License: mit
- Created: 2022-09-02T12:29:16.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-10-17T07:50:44.000Z (almost 3 years ago)
- Last Synced: 2024-05-03T16:20:49.906Z (about 2 years ago)
- Language: Python
- Homepage:
- Size: 3.43 MB
- Stars: 2
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# BatchDetect
[](https://www.codacy.com/gh/marrlab/BatchDetect/dashboard?utm_source=github.com&utm_medium=referral&utm_content=marrlab/BatchDetect&utm_campaign=Badge_Grade)
This repository contain the code for detecting batch effects in different
datasets.
For different examples, you can follow our examples in the [docs](docs) folder.
## How to install the package
For installing the package, you can simply clone the repository and run the following command:
```bash
pip -q install
```
## How to use the package
You need to have two pandas dataframes. One should include the metadata such as
annotations, donors, hospitals, etc. The other one should include the features of
the dataset. You can initalize the module simply by running:
```python
from batchdetect.batchdetect import BatchDetect
bd = BatchDetect(metadata, features)
```
After that you can run different methods as you would like. These methods include:
- `bd.low_dim_visualization("pca")`
- `bd.low_dim_visualization("tsne")`
- `bd.low_dim_visualization("umap")`
- `bd.classification_test()`
For more examples or more information about the possible options,
please refere to our [docs](docs) folder.
## Automatic feature extraction
The package also considers that there is no available feature set. We also provided
an automatic feature extraction based on first and second Order image features.
The only requirement is to provide a `metadata` dataframe with the column `file`.
You can create a feature dataframe by simply using the following:
```python
from batchdetect.image import automatic_feature_extraction
df_features = automatic_feature_extraction(metadata)
```
The rest would be similar to the previous part.
## How to cite this work
coming soon
## Metrics to use:
* Silhoutte Score (UMAP) (Rushin)
* Mean local diversity (Sophia)
* Shannon’s equitability (Sophia)
* Jensen-Shannon distance (Sophia)
* KL-Divergence (Manuel)
* other distribution metrics (Ali)
* Look at scIB (Ali)
* FID score (Manuel)
* Moran's I (Rushin)
…..
Add datasets before Wednesday (21st)
LUNG: 3 Cohorts: TCGA, CPTAC, UCL (cis).