R Installation
Prerequisites
- R >= 3.6.1
- Seurat >= 3.1.4
- RcppML >= 0.5.6
Method 1: Install from GitHub
# Install devtools if not already installed
if (!require("devtools")) {
install.packages("devtools")
}
# Install UCASpatial from GitHub
devtools::install_github('https://github.com/BIGHanLab/UCASpatial/')
Method 2: Download and Source
# Download UCASpatial_v1.R from GitHub
# Then source it in your working directory
source('/DataPath/UCASpatial_v1.R')
Verify Installation
# Test if UCASpatial is properly loaded
tryCatch({
UCASpatial_deconv
print("UCASpatial successfully installed!")
}, error = function(e) {
print("UCASpatial not properly installed")
})
Python Installation
Installation Steps
# Download UCASpatial_ds_R1.py from GitHub
# Place it in your working directory
# Install required dependencies
pip install scanpy pandas numpy scikit-learn
# Import UCASpatial in your Python script
import UCASpatial_ds_R1
Verify Installation
# Test if UCASpatial is properly loaded
try:
ucas = UCASpatial_ds_R1.UCASpatial()
print("UCASpatial successfully installed!")
except Exception as e:
print(f"Installation error: {e}")