Skip to main content

Package for running the CIDR algorithm implemented in R, in python

Project description

rnadtu

A Python package for running the CIDR algorithm (originally implemented in R) for clustering single-cell RNA-seq data using AnnData objects.

Features

  • Run the CIDR algorithm from Python using:

    • cidr() — subprocess-based, using temporary CSV files (recommended for large datasets)
    • cidr_non_csv() — subprocess-based, using in-memory buffers (faster but memory intensive and difficult to debug)
    • cidr_rpy2() — uses the rpy2 bridge (direct R integration, less suitable for large datasets)
  • Optional configuration options:

    • data_type: default is "raw", can be "cpm" (counts per million)
    • n_cluster: default is None (CIDR calculates the optimal number), or manually specify an positive integer
    • layer: which layer of the AnnData object to use for input
    • Optional output controls:
      • pc: store principal coordinates
      • dissim: store dissimilarity matrix
      • dropout: store dropout matrix
      • save_clusters: (only in cidr_rpy2) choose store cluster labels (default True)
  • Results are saved in the AnnData object:

    • obsm[layer + "_cidr_pc"] — principal components
    • obsm[layer + "_cidr_clusters"] — cluster labels (if save_clusters=True)
    • obsp[layer + "_cidr_dissimilarity_matrix"] — pairwise distances
    • uns[layer + "_cidr_variation"], uns[layer + "_cidr_eigenvalues"] — PCA variation
    • uns[layer + "_cidr_dropout_candidates"] — dropout data
  • Generates a clustering plot in cidr_plots.pdf

Installation

Important: Before installing the package via pip install rnadtu, please follow the installation prerequisites below

Install R and CIDR

To get the package up and running you first need to install R and the CIDR library:

  • Install R ≥ 4.4.0 with default settings
  • On windows, make sure R is added to PATH, typically as
    C:\Program Files\R\R-<your-version>\bin
  • Install Corresponding version of RTools
  • Open an R console in a terminal or in Rstudio and run the following command:
    install.packages("devtools") (this may take a little)
  • install CIDR with the following command:
    devtools::install_github('VCCRI/CIDR')
  • OPTIONAL if you want to run individual functions of the CIDR algorithm:
    • install the Arrow with the following command:
      install.packages('arrow')
    • install the qs package with the following command:
      install.packages('qs')

Install rpy2

To install rpy2, which is a package that some of the functions in our package depends on, simply use the command pip install rpy2. However, if you are on windows, do the following:
The R-version in the steps is 4.4.0, but should be replaced with your respective version, this should be replaced with the R-version on your pc.

  • Make sure python is installed with Python --version
  • Update your pip version with python -m pip install --upgrade pip
  • Make sure you have R installed, typically placed at
    C:\Program Files\R\R-4.4.0
  • As mentioned earlier, add the following to your PATH variable
    C:\Program Files\R\R-4.4.0\bin (No action needed for mac)
  • Install rpy2 without compiling with
    pip install --only-binary :all: rpy2(Skip this step for mac)

Finally, go ahead and install the rnadtu package with
pip install rnadtu

License

RNADTU is licensed under the GNU General Public License v2.0.

It includes source code from the VCCRI/CIDR project, which is also distributed under the GPL v2.0.

See the License file for full details.

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

rnadtu-0.1.8.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.

rnadtu-0.1.8-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file rnadtu-0.1.8.tar.gz.

File metadata

  • Download URL: rnadtu-0.1.8.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for rnadtu-0.1.8.tar.gz
Algorithm Hash digest
SHA256 f422d7df0064f903294410d409826bd38192cf32bb1e67a965d10a6129728cb4
MD5 b9a8b363cb6d57fd587c5fc6777a3a4f
BLAKE2b-256 c8d777df034c2910866075e7db435471953ac55a16f88e564b3a7b096d5e959f

See more details on using hashes here.

File details

Details for the file rnadtu-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: rnadtu-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for rnadtu-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 6c0f5c38988c17cfca98c486ace4ba79b9abe09f7a70e050afdafb67275fb43c
MD5 ad530c4acb950df1eca66de77f204e40
BLAKE2b-256 27bbeffd877483b59ee6533bf5b944b5afe067f765e9f91fde4b10ff8a309850

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