Package: pypolca
pypolcapypolcais a Standalone Python re-implementation of the POLCA polisher from theMaSuRCA genome assembly and analysis toolkit.Quick Start# creates conda environment with pypolca 
conda create -n pypolca_env pypolca

# activates conda environment
conda activate pypolca_env

# runs pypolca
pypolca run -a <genome> -1 <R1 short reads file> -2 <R2 short reads file> -t <threads> -o <output directory>Table of ContentspypolcaQuick StartTable of ContentsDescriptionNote of Caution for Large (e.g. Eukaryotic) GenomesInstallationCondaPipSourceUsageBenchmarkingCitationDescriptionpypolcais a python reimplenetation of the POLCA polisher from theMaSuRCA genome assembly and analysis toolkitthat was made for inclusion into the hybrid bacterial genome assembly toolhybracter.It was written for a number of reasons:MaSuRCA is only available on Linux, not for MacOS.The originalpolca.shscript from MaSuRCA was difficult to use because you could not specify an output directory. Additionally, due to its shell implementation, both FASTQ read files needed to be input together as a stringTo usepolca.sh, you need to install the entire MaSuRCA assembly toolkit.POLCA is recommended for long-read first bacterial assembly polishing (seethis paper) and I wanted to include it for MacOS and Linux in my assembly toolhybracter.Note: I neither guarantee nor desire thatpypolcawill give identical results to POLCA implemented in MaSuRCA. This is because of the different versions offreebayesand Samtools that might be used as a dependency.In testing,pypolcav0.2.0 (running Freebayes v1.3.6 and Samtools v1.18) was extremely similar, but not identical to POLCA (running Freebayes v1.3.1-dirty and Samtools v0.1.20). Please seebenchmarkingfor more details.I have decided to use the newest versions of freebayes and Samtools possible rather than the version installed with MaSuRCA, for ease of maintenance and particularly because the version of Samtools used is a major version behind and the CLI has changed.Note of Caution for Large (e.g. Eukaryotic) GenomesI have implemetedpypolcapredominantly for the use-case of polishing long-read bacterial genome assemblies with short reads. Therefore, I decided not to implement the batched multiprocessing of freebayes included in POLCA, because it was a lot of work for no benefit for most bacterial genomes.However, this is certainly not true for larger genomes such as eukaryotic organisms.pypolcashould be a lot slower than POLCA for such organisms if you run both with more than 1 thread.I do not intend to implement multiprocessing but if someone wants to feel free to make a PR.InstallationInstallation from conda is recommended as this will install all non-python dependencies.Condapypolcawill soon be available on bioconda.conda install -c bioconda pypolcaPipYou can also install the Python components ofpypolcawith pip.pip install pypolcaSourceAlternatively, the development version ofpypolcacan be installed manually via github.git clone https://github.com/gbouras13/pypolca.git
cd pypolca
pip install -e .
pypolca -hIf you have installpypolcawith pip or from source, you will then need to install the external dependencies separately, which can be found inbuild/environment.yamlbwa>=0.7.17Samtools>=1.18freebayes>=1.3.1,<1.3.7UsageUsage: pypolca [OPTIONS] COMMAND [ARGS]...

Options:
  -h, --help     Show this message and exit.
  -V, --version  Show the version and exit.

Commands:
  citation  Print the citations for polca
  run       Python implementation of the POLCA polisher from MaSuRCAUsage: pypolca run [OPTIONS]

  Python implementation of the POLCA polisher from MaSuRCA

Options:
  -h, --help               Show this message and exit.
  -V, --version            Show the version and exit.
  -a, --assembly PATH      Path to assembly contigs or scaffolds.  [required]
  -1, --reads1 PATH        Path to polishing reads R1 FASTQ. Can be FASTQ or
                           FASTQ gzipped. Required.  [required]
  -2, --reads2 PATH        Path to polishing reads R2 FASTQ. Can be FASTQ or
                           FASTQ gzipped. Optional. Only use -1 if you have
                           single end reads.
  -t, --threads INTEGER    Number of threads.  [default: 1]
  -o, --output PATH        Output directory path  [default: output_polca]
  -f, --force              Force overwrites the output directory
  --min_alt INTEGER        Minimum alt allele count to make a change
                           [default: 2]
  --min_ratio FLOAT        Minimum alt allele to ref allele ratio to make a
                           change  [default: 2.0]
  --careful                Equivalent to --min_alt 4 --min_ratio 3
  -n, --no_polish          do not polish, just create vcf file, evaluate the
                           assembly and exit
  -m, --memory_limit TEXT  Memory per thread to use in samtools sort, set to
                           2G or more for large genomes  [default: 2G]
  -p, --prefix TEXT        prefix for output files  [default: polca]The polished output FASTA will be{prefix}_corrected.fastain the specified output directory and the POLCA report will be the textfile{prefix}.reportBenchmarkingPlease seebenchmarkingfor more details. As can be seen,pypolcav0.2.0 was extremely similar, but not identical to POLCA.CitationPlease citepypolcain your paper using:Bouras G, Wick RR (2023) pypolca: Standalone Python reimplementation of the genome polishing tool POLCA.https://github.com/gbouras13/pypolca.Zimin AV, Salzberg SL (2020) The genome polishing tool POLCA makes fast and accurate corrections in genome assemblies. PLoS Comput Biol 16(6): e1007981.https://doi.org/10.1371/journal.pcbi.1007981.