Installation
Attention
The scDesign3Py package is developed based on rpy2 and utilize the R interpreter on user’s computer.
Step 1: Install R
Instruction for installing R can be found at r-project.
If R has been installed, this step can be skipped.
Step 2: Install scDesign3 R package (optional)
Run the following code in R console.
if (!require("devtools", quietly = TRUE))
install.packages("devtools")
devtools::install_github("SONGDONGYUAN1994/scDesign3")
Note
Even if you forget to install the scDesign3 R package, the interface will try to install scDesign3 automatically, which may cost extra time when importing the package for the first time. However, if there’s unexpected error occurred during automatical installation, please install the scDesign3 R package manually in R.
Step 3: Specify R_HOME
When installing scDesign3Py, rpy2
package will be installed using pip. To make sure rpy2
can be correctly installed, you need to first specify the intended R interpreter by add the corresponding R_HOME
to SYSTEM variable.
To get R_HOME
, run the following code in R console.
R.home()
For linux users
Please specify the R_HOME
before you install the rpy2
!
export R_HOME=your_R_HOME_path
For windows users
Please specify the R_HOME
before you use the package and it’s fine to set the SYSTEM variable after installing the rpy2
.
setx R_HOME "your_R_HOME_path"
Or from GUI
Press Windows + R to open the Windows Run prompt.
Type in sysdm.cpl and click OK.
Open the Advanced tab and click on the Environment Variables button in the System Properties window.
Click the New… button under the user-specific section.
Set variable name as R_HOME and value as your_R_HOME_path.
Step 4: Install scDesign3Py
To install the latest version from Github,
run:
git clone https://github.com/DILIU899/scDesign3Py.git
cd scDesign3Py
pip install .
Or quick install from PyPI:
pip install scDesign3Py
Note
If there’s any problem in installing rpy2, please refer to rpy2 installation tutorial.
Check for installation
Run the following code in python:
import scDesign3Py
If successfully installed and imported, the R loacation will be printed.