<jupyter_start><jupyter_text>Setting Environment Download "protdb" and "dnadb" folders from [here](https://drive.google.com/open?id=1WIsTMIvhL_J_7dBpqaiRBZZG7sVCqBNH) to examples folder.<jupyter_code>import sys
import os
sys.path.insert(0, '../source')
import DBUtility as DB
import iBLAST
import subprocess
import shlex

def execute_command(command):
    command_tokens = shlex.split(command)
    result = subprocess.run(command_tokens, stdout=subprocess.PIPE)
    print(result.stdout.decode('utf-8'))<jupyter_output><empty_output><jupyter_text>Creating Initial Database<jupyter_code>execute_command("rm incblast.db")
DB.initialize_database()
execute_command("blastdb_aliastool -dblist \"dnadb/nt.00 dnadb/nt.01\" -dbtype nucl -out dnadb/smallnt -title \"smallnt\"")<jupyter_output>2.6.0<jupyter_text>Run iBLAST at t = 0<jupyter_code>execute_command("python3 ../source/iBLAST.py \"blastn -db dnadb/smallnt -query dna-query-10.fasta -outfmt 5 -out dnadb/result.xml\"")<jupyter_output>blastn -db dnadb/smallnt -query dna-query-10.fasta -outfmt 5 -out dnadb/result.xml
program: blastn >
nucl search
dnadb/smallnt dna-query-10.fasta
No record found for this query. A fresh blast search will be performed
program: blastn >
nucl search


1<jupyter_text>Simulate Incremental Addition of Sequences<jupyter_code>execute_command("blastdb_aliastool -dblist \"dnadb/nt.00 dnadb/nt.01 dnadb/nt.02\" -dbtype nucl -out dnadb/smallnt -title \"smallnt\"")<jupyter_output><jupyter_text>Run iBLAST at t = 1<jupyter_code>execute_command("python3 ../source/iBLAST.py \"blastn -db dnadb/smallnt -query dna-query-10.fasta -outfmt 5 -out dnadb/result.xml\"")<jupyter_output>blastn -db dnadb/smallnt -query dna-query-10.fasta -outfmt 5 -out dnadb/result.xml
program: blastn >
nucl search
dnadb/smallnt dna-query-10.fasta
An existing record has been found. An incremental blast search will be performed
output file:  dnadb/result.xml
{'nt.01', 'nt.00'}
{'nt.02', 'nt.01', 'nt.00'}
{'nt.02'}
Command:  blastdb_aliastool -dbtype nucl -dblist "nt.02" -out dnadb/smallnt-delta -title dnadb/smallnt-delta

blastn -query dna-query-10.fasta -out dnadb/result.xml-delta.xml -db dnadb/smallnt-delta -outfmt 5

output file:  dnadb/result.xml
Received output file name:  dnadb/result.xml
Number of records: 10
Number of records: 10
Writing to Output File:  dnadb/result.xml
Done writing. going back to entry point.
{'fraction_non_alphanumeric': 0.12195121951219512, 'fraction_numerical': 0.025231286795626577, 'mean_word_length': 5.16321243523316, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 20, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '212473', 'license': 'CC0-1.0', 'n_tokens_mistral': 971, 'n_tokens_neox': 899, 'n_words': 206, 'path': 'examples/iBLAST Demonstration for blastn (Karlin-Altschul Statistics).ipynb', 'repo_name': 'tcoard/iBLAST', 'size': '2378'}