Optimized modcall runtime and ensured multithread safety.
Changes
MethFastaParser Utilizing New Structure:
Revised the storage structure of references fasta to include chromosome length information, facilitating chromosome processing in the correct numerical order (chr1, chr2, chr3) instead of lexicographical order (chr1, chr11, chr12).
This change not only eliminates the need to recalculate chromosome lengths but also enhances execution efficiency in a multithreaded environment.
Modifications in MethBamParser:
Introduced an additional parameter int numThreads in the function detectMeth. This change allows for dynamic allocation of threads based on the processing requirements, improving the handling of multi-threaded operations.
Thread Safety Measures:
Split the writeResultVCF function into two parts: exportResult and writeResultVCF.
exportResult: Handles the processing results for each chromosome, preparing data for VCF file writing.
writeResultVCF: Tasked with the actual writing of data into the VCF file, ensuring the integrity and sequentiality of output.
Changes in ModCallProcess:
New Function - setModcallNumThreads :Implemented to intelligently allocate threads between chromosome processing and BAM parsing tasks.
Testing
This test compares the run times with the develop branch (commit f46509bba8bcb27e9812fbc3aacb6738f351df75), performing modcall at 10x to 60x scale using 20 threads. The time format is mm:ss.
Summary
Optimized modcall runtime and ensured multithread safety.
Changes
Testing
This test compares the run times with the develop branch (commit f46509bba8bcb27e9812fbc3aacb6738f351df75), performing modcall at 10x to 60x scale using 20 threads. The time format is
mm:ss
.