Troubleshooting
This guide helps you resolve common issues with CheckRef.
Common Issues
1. No VCF Files Found
Error:
ERROR ~ No such variable: Exception evaluating property 'size' for java.util.ArrayListCause: No VCF files match the provided pattern
Solutions:
Check the file path is correct:
bashls /path/to/vcfs/*.vcf.gzUse absolute paths:
bash--targetVcfs "/full/path/to/vcfs/*.vcf.gz"Use quotes around glob patterns:
bash--targetVcfs "*.vcf.gz" # Correct --targetVcfs *.vcf.gz # May not workFor comma-separated files:
bash--targetVcfs "file1.vcf.gz,file2.vcf.gz,file3.vcf.gz"
2. No Reference Legend Files Found
Error:
ERROR ~ No reference legend files found with pattern: /path/*.legend.gzCause: No legend files found in reference directory
Solutions:
Verify reference directory exists and contains legend files:
bashls /path/to/reference/*.legend.gzCheck legend file pattern:
bash# If your legend files have different extension --legendPattern "*.legend.txt.gz" --legendPattern "*.leg.gz"Ensure files have .legend.gz extension or update pattern
3. Chromosome Naming Mismatch
Issue: VCF files are processed but no matches with legend files
Cause: Chromosome naming inconsistency
Example Problem:
- VCF files:
sample_chr1.vcf.gz(with 'chr' prefix) - Legend files:
ref_1.legend.gz(without 'chr' prefix)
Solutions:
Option A: Rename files to match:
bash# Add 'chr' prefix to legend files for f in *.legend.gz; do mv "$f" "chr_$f" doneOption B: Remove 'chr' prefix from VCF names:
bash# Remove 'chr' from VCF filenames for f in chr*.vcf.gz; do mv "$f" "${f#chr}" doneCheck chromosome in VCF header:
bashbcftools view -h sample.vcf.gz | grep "##contig"
4. Genome Build Mismatch
Message:
╔════════════════════════════════════════════╗
║ GENOME BUILD MISMATCH DETECTED ║
╚════════════════════════════════════════════╝Cause: VCF and legend files use different genome builds (e.g., hg19 vs hg38)
Evidence:
- REF alleles differ at the same position
- Example: Position 100000 is
Ain VCF butGin legend
Solutions:
Use matching genome builds - Ensure both files use same build
Convert genome build with liftOver:
bash# Install UCSC tools # Download chain file for hg19 to hg38 wget http://hgdownload.cse.ucsc.edu/goldenPath/hg19/liftOver/hg19ToHg38.over.chain.gz # Convert VCF to hg38 java -jar picard.jar LiftoverVcf \ I=input_hg19.vcf.gz \ O=output_hg38.vcf.gz \ CHAIN=hg19ToHg38.over.chain.gz \ REJECT=rejected_variants.vcf.gz \ R=hg38.fastaVerify genome build:
bash# Check VCF positions against known variants bcftools query -f '%CHROM\t%POS\t%REF\t%ALT\n' input.vcf.gz | head # Compare with reference # Positions should match between VCF and legend
5. VCF Validation Failures
Error: VCF file fails validation checks
Check validation report:
cat results/logs/validation/chr*_validation_report.txtCommon validation failures:
Empty or Corrupted VCF
Error: File is too small or corrupted
Solutions:
# Test gzip integrity
gunzip -t file.vcf.gz
# If corrupted, regenerate or re-download
# Check file size
ls -lh file.vcf.gz # Should be >100 bytesInvalid VCF Format
Error: Invalid VCF format
Solutions:
# Validate VCF with bcftools
bcftools view -h file.vcf.gz
# Check for common issues
# - Missing ##fileformat header
# - Malformed header lines
# - Invalid column structure
# Fix with bcftools
bcftools view file.vcf.gz -Oz -o fixed.vcf.gzNo Variant Data
Warning: File contains headers but no variants
Solutions:
# Check if VCF has data lines
bcftools view -H file.vcf.gz | wc -l
# If truly empty, chromosome may not have variants
# This is OK - CheckRef will skip it6. Docker/Singularity Issues
Docker Permission Denied
Error:
Got permission denied while trying to connect to the Docker daemon socketSolution:
# Add user to docker group
sudo usermod -aG docker $USER
# Log out and log back in
# Or use newgrp
newgrp dockerCannot Pull Container
Error: Failed to pull Docker image
Solutions:
Check Docker is running:
bashdocker psManually pull container:
bashdocker pull mamana/vcf-processing:latestCheck internet connection
Try Singularity instead:
bash-profile singularity # instead of docker
Singularity Not Found
Error: singularity: command not found
Solutions:
Load Singularity module (HPC):
bashmodule load singularityInstall Singularity
Use Docker instead:
bash-profile docker # instead of singularity
7. Memory or Resource Issues
Out of Memory
Error: Process killed due to memory limit
Solutions:
Increase memory for specific process:
groovy// custom.config process { withName: CHECK_ALLELE_SWITCH { memory = 16.GB // Increase from default 4GB } }Run with config:
bashnextflow run AfriGen-D/checkref \ --targetVcfs "*.vcf.gz" \ --referenceDir "/ref/" \ -c custom.config \ -profile docker
Process Timeout
Error: Process exceeded time limit
Solution:
// custom.config
process {
withName: CHECK_ALLELE_SWITCH {
time = 12.h // Increase from default 4h
}
}8. Nextflow Issues
Nextflow Version Too Old
Error: Nextflow version requirement not met
Solution:
# Update Nextflow
nextflow self-update
# Or install latest version
curl -s https://get.nextflow.io | bashJava Version Issues
Error: Nextflow requires Java 11 or later
Solution:
# Check Java version
java -version
# Install OpenJDK 11+
# Ubuntu/Debian
sudo apt-get install openjdk-11-jdk
# macOS
brew install openjdk@119. Verification Failures
Issue: Verification reports remaining switches after correction
Check verification report:
cat results/logs/verification/chr*_verification_results.txtPossible causes:
Build mismatch - Some sites couldn't be corrected
- Check for failed corrections in
correction_stats.txt
- Check for failed corrections in
Bug in correction - Report to developers
- Include verification report
- Include sample VCF and legend files
10. HPC/Cluster Issues
Jobs Not Submitting
Check cluster queue:
# SLURM
squeue -u $USER
# PBS
qstat -u $USER
# SGE
qstat -u $USERSolutions:
- Check queue name is correct in config
- Verify account/project settings
- Check cluster resource availability
Jobs Failing on HPC
Check job logs:
# Find SLURM logs
ls -la slurm-*.out
# Check for errors
grep -i error slurm-*.outCommon fixes:
Load required modules:
bashmodule load singularity module load java/11Set correct paths in config
Adjust resource requests
Getting Additional Help
1. Check Nextflow Log
# View full Nextflow log
less .nextflow.log
# Search for errors
grep ERROR .nextflow.log2. Check Process Logs
# Find work directory from error message
# Example: work/3a/f8b234abcd...
# Check stderr
cat work/3a/f8b234*/.command.err
# Check stdout
cat work/3a/f8b234*/.command.out
# Check the actual command
cat work/3a/f8b234*/.command.sh3. Enable Debug Mode
nextflow run AfriGen-D/checkref \
--targetVcfs "*.vcf.gz" \
--referenceDir "/ref/" \
-profile docker \
-with-trace \
-with-report \
-with-timeline4. Report an Issue
If you can't resolve the issue:
- Visit GitHub Issues
- Search for similar issues
- Create a new issue with:
- CheckRef version
- Nextflow version
- Error message
- Relevant log files
- Command used
- System information
5. Community Support
- Discussions: GitHub Discussions
- Helpdesk: helpdesk.afrigen-d.org
Debugging Tips
- Start small - Test with one chromosome first
- Use test profile - Verify installation works
- Check each input - Validate VCF and legend files separately
- Enable verbose logging - Use
-with-traceand-with-report - Don't delete work/ - Needed for debugging and resume
Next Steps
- Configuration - Advanced configuration
- Running - Execution best practices
- Examples - Working examples
