Installation guide · Data add-ons
DNA fragment index
Build a DNA fragment index, so searches of short DNA look up their matches.
With a DNA fragment index, exact and near-exact searches of short DNA, such as primers and probes, look each query up in place of reading every stored sequence, with the same results. The user guide's DNA fragments says which searches use it, and how long finding their matches took through it on the hosted service's server. Each index is of one DNA set, such as Patent DNA, of one snapshot or delta. fragindex, in the image, builds it from the set's sequences.fasta with no network connection.
An index takes about 70% of the disk of its sequences.fasta. Its build needs a quarter of a byte of memory for each letter of the set, plus 7 GB with the command below. A near-exact search also writes the stored sequences the index finds to the data volume while it runs, up to BIOSEQUENCE_MAX_OUTPUT_BYTES. One that would write more reads every stored sequence instead.
Make the folder, then an index of the snapshot's set in it. --out names a folder that does not exist yet:
docker run --rm -v sequences-data:/data --entrypoint mkdir conductscience/sequences:<version> -p /data/dna-index
docker run --rm -v sequences-data:/data --entrypoint fragindex conductscience/sequences:<version> \
build --fasta /data/corpora/<snapshotId>/patent_nucl/sequences.fasta --first-ordinal 1 \
--out /data/dna-index/<snapshotId>-patent_nucl --threads 4 --buffer-gb 6
Then one of each delta that adds sequences to the set. --first-ordinal is the set's firstOrdinal in the delta's manifest.json:
docker run --rm -v sequences-data:/data --entrypoint fragindex conductscience/sequences:<version> \
build --fasta /data/deltas/<snapshotId>/<deltaId>/patent_nucl/sequences.fasta --first-ordinal <N> \
--out /data/dna-index/<deltaId>-patent_nucl --threads 4 --buffer-gb 6
Set BIOSEQUENCE_DNA_INDEX=/data/dna-index, then remove the container and start it again. The log then says DNA fragments of 15 to 50 bases are looked up in the DNA fragment index in /data/dna-index and names the index folders. An index added later, such as a new delta's, needs no restart. A search uses the index only when each file it reads has one. Until a new delta has its own, a search of it reads every stored sequence, as without the setting.
On several servers, a worker with no index reads every stored sequence, with the same results. Give each worker its own copy of the folder and the setting.
Guide version 1.63.0 · For Sequences 0.155.0