Troubleshooting Guide
This guide helps you diagnose and resolve common issues when using modtector.
Table of Contents
Installation Issues
Rust Not Found
Problem: rustc: command not found or cargo: command not found
Solutions:
Install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh source ~/.cargo/env
Check PATH:
echo $PATH export PATH="$HOME/.cargo/bin:$PATH"
Verify installation:
rustc --version cargo --version
Build Failures
Problem: cargo build fails with compilation errors
Solutions:
Update Rust:
rustup updateClean and rebuild:
cargo clean cargo build --release
Check dependencies:
cargo checkInstall build tools (Linux):
sudo apt-get install build-essential pkg-config libssl-dev
Permission Errors
Problem: Permission denied during installation
Solutions:
Check permissions:
ls -la target/
Fix permissions:
chmod -R 755 target/
Use user directory:
cargo install --path . --force
Data Processing Issues
BAM File Issues
Problem: BAM file cannot be read or processed
Solutions:
Check BAM file:
samtools view -H sample.bam samtools flagstat sample.bam
Validate BAM file:
samtools quickcheck sample.bam
Check file format:
file sample.bamRe-index BAM file:
samtools index sample.bam
Reference Sequence Issues
Problem: Reference FASTA file cannot be read
Solutions:
Check FASTA file:
head -20 reference.fa samtools faidx reference.fa
Validate format:
file reference.faCheck sequence names:
grep ">" reference.fa
Low Coverage
Problem: Insufficient read depth for analysis
Solutions:
Check coverage:
samtools depth sample.bam | awk '{sum+=$3} END {print sum/NR}'
Filter low coverage:
modtector plot -M mod.csv -U unmod.csv -o plots/ -d 10
Increase sequencing depth:
Re-sequence with higher depth
Use more sensitive parameters
Alignment Quality Issues
Problem: Poor alignment quality affecting results
Solutions:
Check alignment quality:
samtools view sample.bam | head -100
Filter alignments:
samtools view -q 20 -b sample.bam > sample_filtered.bam
Check mapping rate:
samtools flagstat sample.bam
Performance Issues
Slow Processing
Problem: modtector runs very slowly
Solutions:
Increase threads:
modtector count -b sample.bam -f reference.fa -o output.csv -t 8
Use windowing:
modtector count -b sample.bam -f reference.fa -o output.csv -w 1000
Optimize system:
Use SSD storage
Increase RAM
Close other applications
High CPU Usage
Problem: modtector uses too much CPU
Solutions:
Reduce threads:
modtector count -b sample.bam -f reference.fa -o output.csv -t 2
Monitor usage:
top -p $(pgrep modtector)
Use nice command:
nice -n 10 modtector count -b sample.bam -f reference.fa -o output.csv
Disk I/O Issues
Problem: High disk usage or slow I/O
Solutions:
Use faster storage:
Move data to SSD
Use local storage instead of network
Optimize file operations:
modtector count -b sample.bam -f reference.fa -o /tmp/output.csv
Monitor disk usage:
iostat -x 1
Output Quality Issues
Poor Normalization
Problem: Normalization results look incorrect
Solutions:
Try different methods:
modtector norm -i input.csv -o output_percentile.csv -m percentile28 modtector norm -i input.csv -o output_winsor.csv -m winsor90 modtector norm -i input.csv -o output_boxplot.csv -m boxplot
Adjust parameters:
modtector norm -i input.csv -o output.csv -m winsor90 --bases AC
Check input data:
head -100 input.csv
Low Reactivity Scores
Problem: Reactivity scores are too low or inconsistent
Solutions:
Check data quality:
modtector plot -M mod.csv -U unmod.csv -o plots/ -c 0.1
Try different methods:
modtector reactivity -M mod.csv -U unmod.csv -O output.csv -s ding modtector reactivity -M mod.csv -U unmod.csv -O output.csv -s rouskin
Adjust parameters:
modtector reactivity -M mod.csv -U unmod.csv -O output.csv --pseudocount 0.5
Poor Evaluation Scores
Problem: AUC, F1-score, or other metrics are low
Solutions:
Check structure file:
head -20 structure.dp
Try different signal types:
modtector evaluate -r reactivity.csv -s structure.dp -o results/ -g gene_id -t stop modtector evaluate -r reactivity.csv -s structure.dp -o results/ -g gene_id -t mutation modtector evaluate -r reactivity.csv -s structure.dp -o results/ -g gene_id -t both
Disable auto-shift:
modtector evaluate -r reactivity.csv -s structure.dp -o results/ -g gene_id --no-auto-shift
Check base matching:
modtector evaluate -r reactivity.csv -s structure.dp -o results/ -g gene_id --no-base-matching
Memory and Resource Issues
Out of Memory
Problem: modtector runs out of memory
Solutions:
Reduce threads:
modtector count -b sample.bam -f reference.fa -o output.csv -t 1
Use windowing:
modtector count -b sample.bam -f reference.fa -o output.csv -w 500
Increase swap space:
sudo swapon -s sudo fallocate -l 8G /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile
Monitor memory usage:
free -h top -p $(pgrep modtector)
Disk Space Issues
Problem: Not enough disk space for output files
Solutions:
Check disk space:
df -h du -sh *
Clean up old files:
rm -f *.tmp rm -f old_*.csv
Use compression:
gzip *.csvMove to different location:
modtector count -b sample.bam -f reference.fa -o /path/to/large/disk/output.csv
File Format Issues
CSV Format Problems
Problem: CSV files cannot be read or have incorrect format
Solutions:
Check CSV format:
head -5 file.csv file file.csv
Validate CSV:
python -c "import pandas as pd; pd.read_csv('file.csv')"
Fix encoding:
iconv -f utf-8 -t utf-8 file.csv > file_fixed.csv
Structure File Issues
Problem: Secondary structure file cannot be read
Solutions:
Check structure format:
head -20 structure.dp
Validate dot-bracket notation:
Ensure proper parentheses matching
Check for invalid characters
Verify sequence length matches
Convert format if needed:
# Convert from other formats to dot-bracket # (Use appropriate conversion tool)
BAM Index Issues
Problem: BAM file index is missing or corrupted
Solutions:
Check for index:
ls -la sample.bam*
Create index:
samtools index sample.bam
Recreate index:
rm sample.bam.bai samtools index sample.bam
Getting Help
Log Files
Check log files for detailed error information:
# Check if log file was created
ls -la *.log
# View log content
cat modtector.log
# Search for errors
grep -i error modtector.log
grep -i warning modtector.log
Debug Mode
Enable verbose output for debugging:
# Use log file
modtector count -b sample.bam -f reference.fa -o output.csv -l debug.log
# Check system resources
htop
iostat -x 1
Common Error Messages
“BAM file not found”
Check file path and permissions
Verify file exists:
ls -la sample.bam
“Reference sequence not found”
Check FASTA file path
Verify file format:
head -5 reference.fa
“Insufficient memory”
Reduce thread count
Use windowing
Increase system memory
“Low coverage”
Check sequencing depth
Adjust coverage thresholds
Filter low-quality positions
“Poor alignment quality”
Check BAM file quality
Filter alignments by quality
Re-align if necessary
Reporting Issues
When reporting issues, include:
System information:
uname -a rustc --version cargo --version
Command used:
modtector count -b sample.bam -f reference.fa -o output.csv -t 4
Error messages:
cat modtector.logData information:
BAM file size and type
Reference sequence information
System resources (RAM, CPU, disk)
Expected vs actual behavior:
What you expected to happen
What actually happened
Any error messages or warnings
Community Support
GitHub Issues: Report bugs and request features
Documentation: Check this guide and other docs
Examples: Look at example workflows
Forums: Join community discussions
Professional Support
For critical issues or commercial support:
Contact the development team
Consider professional bioinformatics services
Check for commercial support options
Prevention Tips
Best Practices
Validate inputs:
Check BAM file quality
Verify reference sequences
Ensure proper file formats
Monitor resources:
Check available memory
Monitor disk space
Watch CPU usage
Use appropriate parameters:
Match thread count to system
Choose suitable normalization methods
Set appropriate thresholds
Keep backups:
Save intermediate results
Document parameters used
Version control your workflows
Test with small datasets:
Start with subset of data
Verify pipeline works
Scale up gradually
Regular Maintenance
Update software:
rustup update cargo update
Clean up files:
cargo clean rm -f *.tmp
Check system health:
df -h free -h
This troubleshooting guide should help you resolve most common issues. If you encounter problems not covered here, please refer to the Getting Help section for additional support options.