What Infercnv Is and Why You Might Need It
Infercnv is a command-line tool that detects copy number variations — segments of DNA that appear in different quantities across individuals — from single-cell RNA sequencing data. If you work with genomics research, bioinformatics, or cell biology, you may need to run this tool on your own machine rather than through a web interface.
The tool runs on Windows, macOS, and Linux systems, but the installation process differs slightly depending on your operating system and whether you already have the required programming environment set up. This guide walks through the most common installation paths.
Key Takeaways
- Infercnv requires Python 3.6 or later and several supporting libraries, which you can install together using a package manager like pip or conda.
- The fastest installation method on any operating system is through conda, which handles all dependencies automatically.
- If you use pip instead, you will need to install R and the Seurat package separately before Infercnv will run.
- After installation, you can verify the tool works by running a test command that displays the version number.
Installation Using Conda (Recommended)
Conda is a package manager that installs Infercnv and all its dependencies in one step, making it the simplest route for most users. If you do not have conda installed, download Miniconda (the lightweight version) from conda.io/miniconda. Follow the installer for your operating system and restart your terminal or command prompt when finished.
Once conda is ready, open your terminal or command prompt and run this command:
conda install -c bioconda infercnv
Conda will download Infercnv, Python, R, and all required libraries. This process typically takes 5 to 10 minutes depending on your internet speed. When the installation finishes, you can move directly to the verification step below.
Installation Using pip (If You Already Have R)
If you prefer pip or already have Python and R installed on your system, you can install Infercnv through pip. First, make sure you have Python 3.6 or later by opening your terminal and typing python --version. If the version is older, download a newer Python release from python.org.
Next, install Infercnv by running:
pip install infercnv
After pip finishes, you must also install the Seurat package in R, which Infercnv uses internally. Open R by typing R in your terminal, then run these commands inside the R console:
install.packages("devtools") devtools::install_github("satijalab/seurat", ref = "develop")
Exit R by typing quit() and pressing Enter. If you encounter errors during the Seurat installation, check that you have a C++ compiler installed — Windows users may need Rtools, and macOS users may need Xcode Command Line Tools.
Installation on Windows
Windows users should use conda, as it avoids the complexity of setting up a C++ compiler. After installing Miniconda for Windows, open the Anaconda Prompt (not the regular command prompt) and run the conda install command above.
If you must use pip on Windows, you will need to install Rtools before attempting the Seurat installation. Download Rtools from cran.r-project.org/bin/windows/Rtools, run the installer, and restart your computer. Then proceed with the pip and R installation steps.
Installation on macOS
macOS users with conda can follow the standard conda installation above. If you use pip, you may need Xcode Command Line Tools, which provide the C++ compiler required for some dependencies. Install them by opening Terminal and running:
xcode-select --install
A dialog will appear asking you to install the tools. Click Install and wait for the process to finish, which can take 10 to 20 minutes. After that, proceed with the pip installation steps above.
Installation on Linux
Linux users can use either conda or pip. If you use pip, make sure your system has a C++ compiler and development headers. On Ubuntu or Debian systems, run:
sudo apt-get install build-essential python3-dev
On Red Hat, CentOS, or Fedora systems, run:
sudo yum install gcc gcc-c++ python3-devel
After that, proceed with the pip installation steps. Conda users can skip these steps and run the conda install command directly.
Verifying Your Installation
After installation completes, verify that Infercnv is working by opening your terminal and running:
infercnv --version
The tool should print a version number, such as "1.3.1" or similar. If you see an error instead, the most common causes are that the installation did not finish completely or your terminal has not reloaded the updated environment. Try closing and reopening your terminal, then run the version command again.
If the error persists, check that you installed all dependencies. Conda users can verify by running conda list infercnv, which shows whether the package is present. Pip users should run pip show infercnv to check the installation path and version.
Frequently Asked Questions
Do I need to install R separately if I use conda?
No. Conda installs R automatically as part of the Infercnv package, so you do not need to download or set up R yourself. If you already have R installed, conda will use your existing installation or create a separate one for Infercnv depending on your conda configuration.
What if I get a "command not found" error after installation?
Your terminal has not reloaded the updated environment. Close the terminal completely and open a new one, then try the command again. On Windows, make sure you are using Anaconda Prompt if you installed through conda, not the regular command prompt.
Can I install Infercnv in a specific folder on my computer?
Conda and pip install to system-wide locations by default. If you want isolation, conda lets you create separate environments using conda create -n myenv -c bioconda infercnv, then activate it with conda activate myenv. This keeps Infercnv separate from other tools.
Which installation method is fastest?
Conda is fastest because it handles all dependencies in one step. Pip requires you to install R and Seurat separately, which adds 5 to 15 minutes depending on your system. If you do not already have R installed, conda saves significant time.