Skip to main content

Anti-correlation based feature selection for single cell datasets

Project description

README

Tutorials

Anti-correlated genes as a method of feature selection

What is this repository for?

  • Unsupervised feature selection for single cell omics (or anything else!) that passes the null dataset test

How do I get set up?

python3 -m pip install anticor_features

You can also install using the setup.py script in the distribution like so: python3 setup.py install

How do I run use this package?

from anticor_features.anti_cor_features import get_anti_cor_genes

## Then feed in the expression matrix, with cells in columns, genes in rows
## and the feature names (all_features)
## and the species code (in gProfiler format, linked below)

anti_cor_table = get_anti_cor_genes(in_mat,
                                    all_features,
                                    species="hsapiens")

A list of the gProfiler accepted species codes is listed here: https://biit.cs.ut.ee/gprofiler/page/organism-list

The above call yields a pandas data frame that will give you the collected summary statistics, and let you filter based on the features annotated as "selected" in that column

>>> print(anti_cor_table.head())
     gene  pre_remove_feature  pre_remove_pathway  ...       FDR  num_sig_pos_cor  selected
0    Xkr4               False               False  ...       NaN              NaN       NaN
1     Rp1               False               False  ...       NaN              NaN       NaN
2   Sox17               False               False  ...  0.001883           3406.0      True
3  Mrpl15               False                True  ...       NaN              NaN       NaN
4  Lypla1               False                True  ...       NaN              NaN       NaN

The NaNs are produced where the gene was not assayed for anti-correlations either from pre-filtering (the default is to remove genes in pathways related to mitochondria, ribosomes, and hemoglobin).

If you want to customize which GO terms are removed, you can do that with the

anti_cor_table = get_anti_cor_genes(in_mat,
                                    all_features,
                                    species="hsapiens")

Command line interface

You can also use this tool at the command line, if you have either a .tsv or an hdf5 file, with the matrix under the key "infile"

python3 -m anticor_features.anticor_features -i exprs.tsv -species mmusculus

or something similar. This outputs the pandas table to a tsv in the same folder as the input file

See the help section for more detailed usage of the command line interface:

python3 -m anticor_features.anticor_features -h

License

This package is available via the AGPLv3 license.

Who do I talk to?

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anticor_features-0.1.0.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anticor_features-0.1.0-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file anticor_features-0.1.0.tar.gz.

File metadata

  • Download URL: anticor_features-0.1.0.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.5

File hashes

Hashes for anticor_features-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7f166fa24d22b7cc67ca58a34a523d9b67b09d062f832fc33b1b675715f6497e
MD5 dae125a03a9e5a5ab3fbbc68bec200c0
BLAKE2b-256 2827f737eff73971c6c6a71803accb6e981d11c52b592bb07a3eddac7f6b45a2

See more details on using hashes here.

File details

Details for the file anticor_features-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: anticor_features-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.5

File hashes

Hashes for anticor_features-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5982de98a7d0e12dc111364622da14af28807ea4f259c21faf146beb12d70586
MD5 0ae78efc5ebab36610ca86ba54b49d6b
BLAKE2b-256 1f614aa8098867a3910855898a84605219f0e882b5fe3121235212d550deaa28

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page