Installation Guide
This guide provides detailed instructions for installing modtector on different operating systems.
System Requirements
Minimum Requirements
Operating System: Linux, macOS, or Windows
Memory: 4 GB RAM (8 GB recommended for large datasets)
Storage: 2 GB free space
CPU: Multi-core processor recommended for parallel processing
Required Dependencies
Rust: Version 1.70 or higher
Cargo: Included with Rust installation
Installing Rust
Linux/macOS
Install Rust using rustup (recommended):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env
Verify installation:
rustc --version
cargo --version
Windows
Download and run rustup installer:
Visit https://rustup.rs/
Download and run
rustup-init.exeFollow the installation prompts
Verify installation:
rustc --version
cargo --version
Installing modtector
Method 1: Build from Source (Recommended)
Clone the repository:
git clone https://github.com/TongZhou2017/modtector.git
cd modtector
Build the project:
# Debug build (faster compilation)
cargo build
# Release build (optimized performance)
cargo build --release
Verify installation:
./target/release/modtector --version
./target/release/modtector --help
Method 2: Install via Cargo
Install directly from crates.io:
cargo install modtector
Alternatively, you can install a specific version:
cargo install modtector --version 0.15.4
Note: The latest version is available on crates.io.
Dependencies
modtector uses the following Rust crates:
[dependencies]
rust-htslib = "0.47.0" # BAM file processing
bio = "2.0.1" # Bioinformatics utilities
plotters = "0.3" # Plotting and visualization
csv = "1.3" # CSV file handling
rayon = "1.8" # Parallel processing
clap = "4.5" # Command-line argument parsing
chrono = "0.4" # Date and time handling
rand = "0.8" # Random number generation
These dependencies will be automatically downloaded and compiled during the build process.
Platform-Specific Notes
Linux
Ubuntu/Debian: May require additional packages:
sudo apt-get update
sudo apt-get install build-essential pkg-config libssl-dev
CentOS/RHEL: May require:
sudo yum groupinstall "Development Tools"
sudo yum install pkgconfig openssl-devel
macOS
Xcode Command Line Tools: Required for compilation:
xcode-select --install
Windows
Visual Studio Build Tools: Required for compilation
Git: Required for cloning the repository
Verification
After installation, verify that modtector is working correctly:
# Check version
modtector --version
# Check available commands
modtector --help
# Test with a simple command
modtector count --help
Troubleshooting
Common Issues
Rust not found:
Ensure Rust is properly installed and in your PATH
Run
source ~/.cargo/env(Linux/macOS) or restart terminal
Build failures:
Update Rust:
rustup updateClean build:
cargo clean && cargo build --release
Permission errors:
Ensure you have write permissions in the installation directory
Use
sudoif necessary (not recommended for development)
Memory issues during compilation:
Increase swap space or available RAM
Use
cargo buildinstead ofcargo build --releasefor initial testing
Getting Help
If you encounter issues during installation:
Check the Troubleshooting Guide
Search existing issues on the GitHub repository
Create a new issue with detailed error information on GitHub
Next Steps
After successful installation:
Read the Quick Start Guide
Explore the User Guide
Try the Examples
Uninstallation
To remove modtector:
If installed via cargo:
cargo uninstall modtector
If built from source:
# Simply delete the cloned directory
rm -rf modtector
Remove Rust (optional):
rustup self uninstall