Initializes a Conda environment named 'seuratextend' which includes all necessary Python packages for running `scVelo`, `Palantir`, and `CellRank` via `SeuratExtend`. This function is ideal for users setting up their analytical environment for the first time or those who need to ensure they have a compatible environment setup.

create_condaenv_seuratextend(force = FALSE)

Arguments

force

Logical; if TRUE, removes any existing 'seuratextend' environment before creating a new one. Default is FALSE. Use this parameter to force recreation of the environment if a previous installation was interrupted or incomplete.

Value

Does not return any value; it creates and configures a new Conda environment.

Details

When you run functions from `SeuratExtend` that require Python integrations, such as `scVelo`, `Palantir`, or `CellRank`, you might need a specific set of Python packages installed. This function facilitates the setup of a Conda environment specifically tailored for these tools, managed through `reticulate`.

The environment setup is automatic and checks your operating system to configure appropriately. It is currently supported and tested on: * Windows (Intel/AMD processors) * macOS (both Intel-based and Apple Silicon/M-series processors) * Linux (Ubuntu 20.04)

The function automatically detects Apple Silicon (M1/M2/M3/M4) Macs and uses the appropriate configuration.

## Known macOS Issues and Workarounds

Users on macOS may encounter specific issues due to memory management between R and Python:

* **Intel Macs**: When using R Markdown in RStudio with Python tools like scVelo, the R session may crash. To work around this issue, use regular .R script files instead of R Markdown files.

* **Apple Silicon (M1/M2/M3/M4)**: If any R objects are loaded in the session before calling Python functions (particularly operations like PCA on AnnData objects), the R session may crash. This is a known memory management issue between R and Python on macOS.

**Solution**: Start with a fresh R session and call `activate_python()` at the beginning of your workflow before loading any R objects. This initializes the Python environment first and prevents memory-related crashes. After this initialization, all scVelo-related functions should work properly.

If force=TRUE is used, any existing 'seuratextend' environment will be removed before creating a new one. This can be useful when: * A previous installation was interrupted * Required dependencies were not properly installed * You need to reset the environment to a clean state * You encounter persistent environment-related errors

Examples

if (FALSE) {
# Standard installation
create_condaenv_seuratextend()

# Force recreation of the environment
create_condaenv_seuratextend(force = TRUE)
}