|
Raptor 4.0.0-rc.1
A fast and space-efficient pre-filter
|
raptor update adds user bins to an existing HIBF, or removes them from it, without rebuilding the index from all input data. This is useful when a collection grows or shrinks over time, e.g. when new samples are added to a database periodically.
Updating needs spare technical bins to place new data into. raptor layout only reserves them if you ask for it:
--empty-bin-fraction sets the fraction of tmax that is kept empty in every IBF of the layout. The reserved bins cost space in the index, but they are what an insertion writes into, so choosing 0 gives an index that cannot be updated at all:
There is no way to retrofit this onto an existing index; the layout has to be recomputed and the index rebuilt. To check whether an existing index can be updated, run raptor inspect --index raptor.index (raptor inspect). An index that can be updated reports ## Track occupancy = true.
The larger the fraction, the more insertions the index absorbs before it has to be rebuilt, and the larger it is to begin with. 0.1 is a reasonable starting point.
raptor update never modifies its input. It reads the index given by --index and writes a new one to --output, which must not exist yet. Chaining updates therefore means passing the previous output as the next input:
An updated index is searched exactly like any other index:
Either a single sequence file, which is added as one user bin, or a file listing the files to add, one user bin per line:
The input file contains paths to the sequence data. Each line may contain multiple paths (separated by a whitespace).
Supported file extensions are (possibly followed by bz2, gz, or bgzf):
• embl
• fasta
• fa
• fna
• ffn
• faa
• frn
• fas
• fastq
• fq
• genbank
• gb
• gbk
• sam
Preprocessed input is supported as well:
See --output.
raptor prepare creates a minimiser.list file in the output directory. This file can be used as input for raptor layout and raptor build.The index and the files being inserted do not have to be of the same type: minimiser files can be inserted into an index built from sequence files and vice versa, as long as they were preprocessed with the same --kmer and --window values.
raptor build, insertion currently supports only one file per user bin. A line holding several paths is rejected with Currently not supporting multiple files per UB for insert.Inserting degrades an index over time: bins fill up beyond their target false positive rate, and IBFs grow past the tmax their layout assumed. Raptor repairs this automatically, and there are two ways to do so:
By default, the cheapest repair that fixes the problem is chosen. This flag forces a full rebuild whenever a repair is needed at all. It trades update time for index quality, which can pay off if you insert rarely and search often.
Prints a summary to stderr once the insertion has finished:
Full Rebuilds is at most 1: a full rebuild covers every user bin of the call that has not been inserted yet.
The IDs of the user bins to remove. A user bin ID is the position of its entry in the input file that the index was built from, starting at 0. The IDs are also listed in the header of a raptor search result:
Pass the option once per user bin.
Deleting does not renumber the remaining user bins. The path of a deleted user bin therefore still appears in the header of a search result, but the bin is never reported as a hit:
The technical bins that a deleted user bin occupied are reclaimed and reused by later insertions, so deleting and re-inserting does not permanently grow the index.
A full rebuild during raptor update insert (--no-partial-rebuild) treats the index as if the deleted user bins never existed: it drops them and renumbers the remaining user bins in their order. In the example above, bin3.fa becomes user bin 1:
raptor update insert decides by itself whether a full rebuild is needed. Once an index contains deleted user bins, an ID from before an insertion may therefore refer to a different user bin afterwards. Identify user bins by their path, as listed in the header of a search result or by raptor inspect --user-bins, rather than by their ID.
raptor inspect --index updated.index --detailed lists the deleted user bins (Structure).
--empty-bin-fraction greater than 0 (Preparing an updatable index).--kmer, --window, --fpr and --hash are taken from the index and cannot be changed by an update.raptor layout and raptor build may produce a smaller and faster index. raptor inspect reports how far the index has grown since it was last built from a layout (raptor inspect).