{"id":19154478,"url":"https://github.com/bcgsc/ntedit","last_synced_at":"2025-07-11T18:34:13.906Z","repository":{"id":45954938,"uuid":"160230725","full_name":"bcgsc/ntEdit","owner":"bcgsc","description":"✏️ Genome assembly polishing \u0026 SNV detection","archived":false,"fork":false,"pushed_at":"2025-02-21T05:24:15.000Z","size":33860,"stargazers_count":68,"open_issues_count":0,"forks_count":9,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-05-20T04:03:06.108Z","etag":null,"topics":["bloom-filter","c-plus-plus","draft-genome","polishing","variant-detection"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bcgsc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-12-03T17:45:09.000Z","updated_at":"2025-03-28T20:27:33.000Z","dependencies_parsed_at":"2023-10-25T18:42:52.241Z","dependency_job_id":"de17e85c-7b8e-4747-a4fe-c21c3e750223","html_url":"https://github.com/bcgsc/ntEdit","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/bcgsc/ntEdit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcgsc%2FntEdit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcgsc%2FntEdit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcgsc%2FntEdit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcgsc%2FntEdit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bcgsc","download_url":"https://codeload.github.com/bcgsc/ntEdit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcgsc%2FntEdit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264870552,"owners_count":23676262,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bloom-filter","c-plus-plus","draft-genome","polishing","variant-detection"],"created_at":"2024-11-09T08:27:00.742Z","updated_at":"2025-07-11T18:34:13.895Z","avatar_url":"https://github.com/bcgsc.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Release](https://img.shields.io/github/release/bcgsc/ntEdit.svg)](https://github.com/bcgsc/ntEdit/releases)\n[![Downloads](https://img.shields.io/github/downloads/bcgsc/ntEdit/total?logo=github)](https://github.com/bcgsc/ntEdit/releases/download/v1.4.3/ntEdit_v1-4-3.tar.gz)\n[![Conda](https://img.shields.io/conda/dn/bioconda/ntedit?label=Conda)](https://anaconda.org/bioconda/ntedit)\n[![Issues](https://img.shields.io/github/issues/bcgsc/ntEdit.svg)](https://github.com/bcgsc/ntEdit/issues)\n[![link](https://img.shields.io/badge/ntEdit-manuscript-brightgreen)](http://dx.doi.org/10.1093/bioinformatics/btz400)\nThank you for your [![Stars](https://img.shields.io/github/stars/bcgsc/ntEdit.svg)](https://github.com/bcgsc/ntEdit/stargazers)\n\n![Logo](https://github.com/bcgsc/ntEdit/blob/master/ntedit-logo.png)\n\n# ntEdit\n\n## Fast, lightweight, scalable genome sequence polishing and SNV detection \u0026 annotation \n### 2018-current\n\n\n## Contents\n\n1. [Description](#description)\n2. [Implementation and requirements](#implementation)\n3. [Install](#install)\n4. [Dependencies](#dependencies)\n5. [Documentation](#docs)\n6. [Citing ntEdit](#citing)\n7. [Credits](#credits)\n8. [How to run ntEdit](#howto)\n9. [Running ntEdit](#run)\n10. [ntEdit polishing options](#options)\n11. [Soft-mask option](#soft)\n12. [SNV mode](#snv)\n13. [VCF input option](#clinvarvcf)\n14. [Test data](#test)\n15. [Algorithm](#how)\n16. [Output files](#output)\n17. [License](#license)\n\n## Description \u003ca name=description\u003e\u003c/a\u003e\n\nntEdit is a fast and scalable genomics application for polishing genome sequence assembly drafts. \nIt simplifies polishing, variant detection and \"haploidization\" of gene and genome sequences with its re-usable Bloom filter design.\nAlthough it was originally designed as a general-purpose polishing tool, initally aimed at improving genome sequences by fixing base mismatches and frame shift errors with the help of more base-accurate short sequencing reads, ntEdit can also be used for polishing with long reads and to \"finish\" genome sequence assembly projects (refer to \u003ca href=\"https://github.com/bcgsc/goldPolish\" target=\"_blank\"\u003eGoldPolish\u003c/a\u003e and the \u003ca href=\"https://github.com/bcgsc/ntedit_sealer_protocol\" target=\"_blank\"\u003entedit+sealer genome assembly finishing protocol\u003c/a\u003e, respectively).\n\nWe anticipate that ntEdit will find further applications in the rapid mapping of single nucleotide variants, as demonstrated below with the genome of SARS-CoV-2, the highly transmissible pathogenic coronavirus, and etiological agent of COVID-19. Additionally, for researchers delving into the intricate roots of genetic lineages within large cohort data, we encourage the utilization of \u003ca href=\"https://github.com/bcgsc/ntroot\" target=\"_blank\"\u003entRoot, an ancestry prediction framework\u003c/a\u003e built upon the ntEdit engine. It offers a comprehensive analysis of genetic heritage, employing sequence alignment-free algorithms to unveil ancestral connections and provide insights into genetic ancestry within diverse populations.\n\n```diff\n! NOTE: In v1.3.1 onwards, the parameter k is automatically detected from supplied Bloom filters\n```\n  \n![SARS-CoV-2 evolution in human hosts](https://bcgsc.github.io/SARS2/fig1.png?raw=true)\n**SARS-CoV-2 evolution in human hosts**. ntEdit v1.3.4 was used to map nucleotide variation between the first published coronavirus isolate from Wuhan in early January 2020 and over 1,500,000 SARS-CoV-2 genomes sampled from around the globe during the COVID-19 pandemic. \u003ca href=\"https://bcgsc.github.io/SARS2\" target=\"_blank\"\u003eAdditional (\u0026 interactive) timemaps are available\u003c/a\u003e.\n\n\n## Implementation and requirements \u003ca name=implementation\u003e\u003c/a\u003e\n\nntEdit v1.2.0 and subsequent versions are written in C++. \n\n(We compiled with gcc 5.5.0)\n\n\n## Install \u003ca name=install\u003e\u003c/a\u003e\n\nClone and enter the ntEdit directory.\n\u003cpre\u003e\ngit clone https://github.com/bcgsc/ntEdit.git\ncd ntEdit\n\u003c/pre\u003e\nCompile ntEdit.\n\u003cpre\u003e\nmeson setup build --prefix=/path/to/ntedit/install/dir\ncd build\nninja install\n\u003c/pre\u003e\n\n\n## Dependencies \u003ca name=dependencies\u003e\u003c/a\u003e\n\n1. ntStat (v1.0.0+, https://github.com/bcgsc/ntstat)\n2. BloomFilter utilities (provided in ./lib)\n3. kseq (provided in ./lib)\n4. [meson](https://mesonbuild.com/)\n5. [ninja](https://ninja-build.org/)\n6. [btllib](https://github.com/bcgsc/btllib)\n7. [snakemake](https://snakemake.readthedocs.io/en/stable/)\n8. python 3.9+\n\n```diff\n! NOTE: ntEdit v2.1.0+ IS ONLY compatible with ntStat release v1.0.0+\n```\nWe recommend installing ntEdit and its dependencies, using conda: \n\u003cpre\u003e\nconda install -c bioconda ntedit\n\u003c/pre\u003e\n\n\n## Documentation \u003ca name=docs\u003e\u003c/a\u003e\n\nRefer to the README.md file on how to install and run ntEdit.\nOur [manuscript](http://dx.doi.org/10.1093/bioinformatics/btz400) contains information about the software and its performance.\n![ntEdit ISMB poster](https://github.com/bcgsc/ntEdit/blob/master/ntedit_ismb2019.png)\nThis ISMB2019 poster contains additional information, benchmarks and results. \n\n\n## Citing ntEdit \u003ca name=citing\u003e\u003c/a\u003e\n\nThank you for your [![Stars](https://img.shields.io/github/stars/bcgsc/ntEdit.svg)](https://github.com/bcgsc/ntEdit/stargazers) and for using, developing and promoting this free software!\n\nIf you use ntEdit in your research, please cite:\n\n[ntEdit: scalable genome sequence polishing](http://dx.doi.org/10.1093/bioinformatics/btz400)\n\u003cpre\u003e\nntEdit: scalable genome sequence polishing.\nWarren RL, Coombe L, Mohamadi H, Zhang J, Jaquish B, Isabel N, Jones SJM, Bousquet J, Bohlmann J, Birol I.\nBioinformatics. 2019 Nov 1;35(21):4430-4432. doi: 10.1093/bioinformatics/btz400.\n\u003c/pre\u003e\n[![link](https://img.shields.io/badge/ntEdit-manuscript-brightgreen)](http://dx.doi.org/10.1093/bioinformatics/btz400)\n\n\nThe experimental data described in our paper can be downloaded from: http://www.bcgsc.ca/downloads/btl/ntedit/\n\n\n## Credits \u003ca name=credits\u003e\u003c/a\u003e\n\nntedit (concept, algorithm design and prototype): Rene Warren\n\nnthash: Hamid Mohamadi, Parham Kazemi\n\nntstat: Parham Kazemi\n\nC++ implementation: Jessica Zhang, Rene Warren, Johnathan Wong\n\nIntegration tests: Murathan T Goktas\n\nntEdit workflow: Johnathan Wong and Lauren Coombe\n\n\n## How to run ntEdit \u003ca name=howto\u003e\u003c/a\u003e\n\nGeneral ntEdit usage:\n```\nrun-ntedit --help\nusage: run-ntedit [-h] {polish,snv} ...\n\nntEdit: Fast, lightweight, scalable genome sequence polishing and SNV detection \u0026 annotation\n\npositional arguments:\n  {polish,snv}  ntEdit can be run in polishing or SNV modes.\n    polish      Run ntEdit polishing\n    snv         Run ntEdit SNV mode (Experimental)\n\noptional arguments:\n  -h, --help    show this help message and exit\n```\n\n### Running in polishing mode \u003ca name=run\u003e\u003c/a\u003e\n```\nrun-ntedit polish --help\nusage: run-ntedit polish [-h] --draft DRAFT --reads READS [-i {0,1,2,3,4,5}] [-d {0,1,2,3,4,5,6,7,8,9,10}] [-x X] [--cap CAP] [-m {0,1,2}] [-a {0,1}] -k K\n                         [-l L] [--cutoff CUTOFF] [--solid] [-t T] [-z Z] [-y Y] [-j J] [-X X] [-Y Y] [-v] [-V] [-n] [-f]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --draft DRAFT         Draft genome assembly. Must be specified with exact FILE NAME. Ex: --draft myDraft.fa (FASTA, Multi-FASTA, and/or gzipped compatible),\n                        REQUIRED\n  --reads READS         Prefix of reads file(s). All files in the working directory with the specified prefix will be used for polishing (fastq, fasta, gz),\n                        REQUIRED\n  -i {0,1,2,3,4,5}      Maximum number of insertion bases to try, range 0-5, [default=5]\n  -d {0,1,2,3,4,5,6,7,8,9,10}\n                        Maximum number of deletions bases to try, range 0-10, [default=5]\n  -x X                  k/x ratio for the number of k-mers that should be missing, [default=5.000]\n  --cap CAP             Cap for the number of base insertions that can be made at one position[default=k*1.5]\n  -m {0,1,2}            Mode of editing, range 0-2, [default=0] 0: best substitution, or first good indel 1: best substitution, or best indel 2: best edit\n                        overall (suggestion that you reduce i and d for performance)\n  -a {0,1}              Soft masks missing k-mer positions having no fix (1 = yes, default = 0, no)\n  -k K                  k-mer size, REQUIRED\n  -l L                  input VCF file with annotated variants (e.g., clinvar.vcf)\n  --cutoff CUTOFF       The minimum coverage of k-mers in output Bloom filter [default=2, ignored if solid=True]\n  --solid               Output the solid k-mers (non-erroneous k-mers), [default=False]\n  -t T                  Number of threads [default=4]\n  -z Z                  Minimum contig length [default=100]\n  -y Y                  k/y ratio for the number of edited k-mers that should be present, [default=9.000]\n  -j J                  controls size of k-mer subset. When checking subset of k-mers, check every jth k-mer [default=3]\n  -X X                  Ratio of number of k-mers in the k subset that should be missing in orderto attempt fix (higher=stringent) [default=0.5, if -Y is\n                        specified]\n  -Y Y                  Ratio of number of k-mers in the k subset that should be present to accept an edit (higher=stringent) [default=0.5, if -X is specified]\n  -v                    Verbose mode, [default=False]\n  -V, --version         show program's version number and exit\n  -n, --dry-run         Print out the commands that will be executed\n  -f, --force           Run all ntEdit steps, regardless of existing output files\n```\n\n### Running ntEdit in SNV mode\n```\nrun-ntedit snv --help\nusage: run-ntedit snv [-h] [--reference REFERENCE] [--reads READS] [--genome GENOME [GENOME ...]] -k K [-l L] [--cutoff CUTOFF] [--solid] [-t T] [-z Z] [-y Y]\n                      [-j J] [-X X] [-Y Y] [-v] [-V] [-n] [-f]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --reference REFERENCE\n                        Reference genome assembly for SNV calling (FASTA, Multi-FASTA, and/or gzipped compatible), REQUIRED\n  --reads READS         Prefix of input reads file(s) for variant calling. All files in the working directory with the specified prefix will be used for\n                        polishing (fastq, fasta, gz)\n  --genome GENOME [GENOME ...]\n                        Genome assembly file(s) for detecting SNV on --reference\n  -k K                  k-mer size, REQUIRED\n  -l L                  input VCF file with annotated variants (e.g., clinvar.vcf)\n  --cutoff CUTOFF       The minimum coverage of k-mers in output Bloom filter [default=2, ignored if solid=True]\n  --solid               Output the solid k-mers (non-erroneous k-mers), [default=False]\n  -t T                  Number of threads [default=4]\n  -z Z                  Minimum contig length [default=100]\n  -y Y                  k/y ratio for the number of edited k-mers that should be present, [default=9.000]\n  -j J                  controls size of k-mer subset. When checking subset of k-mers, check every jth k-mer [default=3]\n  -X X                  Ratio of number of k-mers in the k subset that should be missing in orderto attempt fix (higher=stringent) [default=0.5, if -Y is specified]\n  -Y Y                  Ratio of number of k-mers in the k subset that should be present to accept an edit (higher=stringent) [default=0.5, if -X is specified]\n  -v                    Verbose mode, [default=False]\n  -V, --version         show program's version number and exit\n  -n, --dry-run         Print out the commands that will be executed\n  -f, --force           Run all ntEdit steps, regardless of existing output files\n```\n\n#### Example ntEdit command - polishing the draft `ecoliWithMismatches001Indels0001.fa` in solid mode using input reads `my_reads_1.fq.gz` and `my_reads_2.fq.gz` using a k-mer size of 55 and 48 threads\n```\nrun-ntedit polish --draft ecoliWithMismatches001Indels0001.fa --reads my_reads -k 55 -t 48 --solid\n```\n\n#### Example ntEdit command - same experimental set-up as above, but using a k-mer coverage cutoff of 2\n```\nrun-ntedit polish --draft ecoliWithMismatches001Indels0001.fa --reads my_reads -k 55 -t 48 --cutoff 2\n```\n\n## Tips for running ntEdit\n- For more advanced users, please see the help documentation for the `ntedit` executable, which has information about additional options\n  - More information about the secondary Bloom filter mode is available on our [wiki page](https://github.com/bcgsc/ntEdit/wiki/ntEdit-Secondary-Bloom-filter)\n- `--solid mode` will work well ONLY if you have sufficient read coverage (\u003e30X). Otherwise, set the kmer coverage threshold to --cutoff 2 (\u003e=20X) or --cutoff 1 (\u003c20X)\n  - solid mode will output non-error kmers, as determined by ntCard. Use this option only when you don't wish to set the threshold (--cutoff) manually\n\n\n## ntEdit polishing options \u003ca name=options\u003e\u003c/a\u003e\nThe ntEdit polishing option (or editing mode) is only used in polishing mode, and is controlled by `-m`\n\u003cpre\u003e\nMode 0: (default)\n\tntEdit will try to substitute the last base of an incorrect k-mer with a different ATGC base. If that k-mer is found in the bloom filter and has enough subset support, ntEdit will then try the other substitution bases and then choose the best substitution fix. However, if the substituion was not found, then ntEdit will try all indels of max length (-i) and (-d) starting with that substitution base and make edit based on the first accepted indel. \n\nMode 1: \n\tntEdit will try to substitute the last base of an incorrect k-mer with a different ATGC base. If that k-mer is found in the bloom filter and has enough subset support, ntEdit will then try the other substitution bases and then choose the best substitution fix. However, if the substitution was nto found,t hen ntEdit will try all indels of max length (-i) and (-d) starting witht hat substitution base and make edit based on the best accepted indel. \n\nMode 2: \n\tntEdit will choose the best substitution or indel for each incorrect k-mer. Since this can be very computationally expensive because ntEdit tries every combination possible, it is recommended that you reduce (-i) and (-d). \n\u003c/pre\u003e\n\n*We recommend running ntEdit polishing in Mode 1 (or 0)\n\n\n## ntEdit -a (soft mask) \u003ca name=soft\u003e\u003c/a\u003e\nSee https://github.com/bcgsc/ntedit_sealer_protocol and https://github.com/bcgsc/goldrush-edit for genome polishing pipelines that make use of this mode\n\n\u003cpre\u003e\nVersion 1.3.5 implements a new option (-a), which controls soft-masking (lower case) nucleotides in the supplied input [draft genome] sequence when its kmers are not found in the primary Bloom filter, and with no possible fix found in that filter (and optionally within a coverage slice provided by the secondary Bloom filter).  \n\nThis option is useful for flagging unpolished/unresolved genomic regions, those with no equivalent in the supplied Bloom filter(s).\n\nThe nucleotide soft-masking effectively \"paints a target\" for other polishers/genome analysis software.\n\nThis strategy is used in the ntedit_sealer_protocol and GoldPolish [a.k.a. goldrush-edit] (URLs above)\n\u003c/pre\u003e\n\n## ntEdit SNV mode \u003ca name=snv\u003e\u003c/a\u003e \n\n\nThis mode can be useful for identifying unresolved genomic regions, those with no equivalent in the supplied Bloom filter(s).\n\nVersion 1.3+ implements a new mode (`run-ntedit snv`) to help detect simple base variation in genome sequences.\n\nIt works by overriding the kmer absence verification stage of ntEdit, effectively testing every base position for possible alternate k kmers. At the moment, ntEdit only reports possible base substitutions (no indels), along with the number of supported kmers (the latter is NOT a proxy for read/kmer coverage). In our tests on simulated (C. elegans, H. sapiens) and experimental (GIAB, HG001/HG004), we find k52/k55 (-j 3 -- see below) to give the best performance.\n\nCaveats: Variations occurring within 2*k are not reported. Because kmers are shorter and have less sequence context than reads and read pairs, kmer variations that occur within a genomic allele (intra allelic) may be reported. In order to minimize false discovery, we recommend using a secondary Bloom filter built with repeat kmers (see details on the -e Secondary Bloom filter option below). \n\nThis option is provided as a convenience feature, implemented to do a quick and dirty variant detection analysis on large genomes. It is a basic presence/absence detector based on kmer subsets. For robust variant identification, we recommend statistically principled approaches.\n\nVCF output (v1.3.2+ _variants.vcf): We assume a diploid genome for reporting on the possible genotype (GT). Users working on polyploid genomes should chose to ignore the last two columns of the VCF file (ie. FORMAT INTEGRATION)\n\n\n\n## ntEdit SNV -l input VCF file with annotated variants \u003ca name=clinvarvcf\u003e\u003c/a\u003e\n\nThis handy option is used to supply a VCF input file to ntEdit, for cross-referencing base variants.\nFor instance, users may wish to identify annotated clinical variants in their genomics datasets.\nFor this, users would build Bloom filters with their read datasets using ntStat and run \nntEdit in -s 1 mode, with the reference human genome as (-f) input.\nNote: it will also work in polishing mode on single nucleotide variants, but is\nof limited value since only homozygously divergent sites (i.e., with completely absent k-mers and k*k-mer) are reported in polishing mode. \n\nWe recommend the use of clinvar resources:\n\nhttps://www.ncbi.nlm.nih.gov/clinvar/\n\nhttps://ftp.ncbi.nlm.nih.gov/pub/clinvar/vcf_GRCh38/\n\ne.g., clinvar_20250623.vcf.gz\n\nNote: If you use clinvar, you MUST ensure you use GRCh38 AND that the chromosome IDs in the \nheaders of your supplied (--reference) GRCH38 FASTA file matches that of clinvar's (e.g. \u003e1 in FASTA and 1 in ClinVar VCF's #CHROM column).\nIf you use any other VCF files as (-l) input, ensure consistency with FASTA headers.\n\nexample command:\n```\nrun-ntedit snv --reference GRCh38.fa --reads HG004 -k 50 -t 48 -l clinvar_20230813.vcf\n```\nwhere the input reads have the prefix `HG004`\n\nThe SNV mode can also work on an input draft assembly:\n```\nrun-ntedit snv --reference GRCh38.fa --genome HG004.asm.fa -k 50 -t 48 -l clinvar_20230813.vcf\n```\n\n\n\n### Test data \u003ca name=test\u003e\u003c/a\u003e\nThe demo script will use the installed ntEdit binary. Please ensure that the ntEdit binary is in your PATH.\n\u003cpre\u003e\nexport PATH=/path/to/ntEdit:$PATH\n\u003c/pre\u003e\nRunning the demo\n\u003cpre\u003e\nGo to ./demo\n(cd demo)\n\u003c/pre\u003e\n\nrun:\n```\n./runme.sh\n```\n\nntEdit will polish an _E. coli_ genome sequence with ~0.001 substitution error rate and ~0.0001 indel rate\n\nExpected files will be:\n```\nntedit_k25_changes.tsv\nntedit_k25_edited.fa\n```\n\nCompare with:\n```\necoli_ntedit_k25_changes.tsv\necoli_ntedit_k25_edited.fa\n```\n\n\n## Algorithm - how it works \u003ca name=how\u003e\u003c/a\u003e\n\n![Logo](https://github.com/bcgsc/ntEdit/blob/master/figS1.png)\nSequence reads are first shredded into kmers using ntStat, keeping track of kmer multiplicity. The kmers that pass coverage thresholds (using ntStat, --cutoff option builds a filter with kmers having a coverage higher than cutoff) are used to construct a Bloom filter (BF). The draft assembly is supplied to ntEdit (--draft option, fasta file), along with the BF and sequences are read sequentially. Sequence strings are shredded into words of length k (kmers) at a specified value (-k option in versions before v1.3.1.  In newer releases, k is detected automatically from the main Bloom filter) matching that used to build the BF, and each kmer from 5’ to 3’ queries the BF data structure for presence/absence (step 1). When a kmer is not found in the filter, a subset (Sk) of overlapping k kmers (defined by k over three, k/3) containing the 3’-end base is queried for absence (step 2). The subset Sk, representing a subsampling of k kmers obtained by sliding over 3 bases at a time over k bases, is chosen to minimize the number of checks against the Bloom filter. Of this subset, when the number of absent (-) kmers matches or exceeds a threshold defined by Sk- \u003e= k/x (-x option), representing the majority of kmers in Sk, editing takes place (step 3 and beyond), otherwise step 1 resumes. In the former case, the 3’-end base is permuted to one of the three alternate bases (step 3), and the subset (Sk_alt) containing the change is assessed for Bloom filter presence (+). When that number matches or exceeds the threshold defined by Sk_alt+ \u003e= k/y (-y option), which means the base substitution qualifies, it is tracked along with the number of supported kmers and the remaining alternate 3’-end base substitutions are also assessed (ie. resuming step 3 until all bases inspected). If the edit does not qualify, then a cycle of base insertion(s) and deletion(s) of up to –i and –d bases begins (step 4, -i option and step 5, -d option, respectively). As is the case for the substitutions, a subset of k kmers containing the indel change is tested for presence. If there are no qualifying changes, then the next alternate 3’-end base is inspected as per above; otherwise the change is applied to the sequence string and the next assembly kmer is inspected (step 1). The process is repeated until a qualifying change or until no suitable edits are found. In the latter case, we go back to step 1. When a change is made, the position on the new sequence is tracked, along with an alternate base with lesser or equal k kmer subset support, when applicable. Currently, ntEdit only tracks cases when edits are made (steps 3-5), and does not flag unedited, missing draft kmers (steps 1-2).  \n\n\n## Output files \u003ca name=output\u003e\u003c/a\u003e\n\n|Output files|                    Description|\n|---|---|\n|_changes.tsv                 | tab-separated file; ID      bpPosition+1    OriginalBase    NewBase Support k-mers (out of k/j)   AlternateNewBase   Alt.Support k-mers   eg. U00096.3_MG1655_k12     117     A       T       9|\n|_edited.fa                   | fasta file; contains the polished genome assembly |\n|_variants.vcf                   | vcf file; contains variant calls |\n\nnote: ntEdit will polish input sequences in upper or lowercase bases. The case of bases in the input sequence IS preserved in the FASTA output, unless a fix is made by ntEdit (i.e., lower-case bases will remain lower-cased UNLESS a change is made).\n\n\n## License \u003ca name=license\u003e\u003c/a\u003e\n\n\nntEdit Copyright (c) 2018-current British Columbia Cancer Agency Branch.  All rights reserved.\n\nntEdit is released under the GNU General Public License v3\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, version 3.\n \nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n \nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n \nFor commercial licensing options, please contact\nPatrick Rebstein \u003cprebstein@bccancer.bc.ca\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcgsc%2Fntedit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbcgsc%2Fntedit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcgsc%2Fntedit/lists"}