apriha / snps

tools for reading, writing, merging, and remapping SNPs
BSD 3-Clause "New" or "Revised" License
100 stars 19 forks source link

added parallelizer in '_write_vcf' Writer method #127

Closed gabrielmotaa closed 3 years ago

gabrielmotaa commented 3 years ago

When saving a file to vcf format for the first time, the code downloads the fasta files in the resources/fasta folder. I noticed that this process was taking a long time, even with the parallelize=True option pass to the SNPs class. Checking the code for the Writer class, I've discovered that the _write_vcf method was responsible for calling another method, which in turn, call other functions to download the reference files.

With this little change, I brought the Parallelizer from the SNPs class to the Writer and significantly improved download times.