Sequence and variant search using BIGSI

More documentation on BIGSI can be found at https://bigsi.readme.io/.

curl -H "Content-Type: application/json" -X POST -d '{"type":"sequence","query":{"seq":"CGGTCAGTCCGTTTGTTCTTGTGGCGAGTGTTGCCGTTTTCTTG", "threshold":0.9} }' localhost:8080/search

Example result:

{"type": "sequence", "result": {"ERR017683": {"percent_kmers_found": 100.0}, "ERR1149371": {"percent_kmers_found": 90.0}, "ERR1163331": {"percent_kmers_found": 100.0}, "query": {"seq": "CGGTCAGTCCGTTTGTTCTTGTGGCGAGTGTTGCCGTTTTCTTG", "threshold": 0.9}}}
curl -H "Content-Type: application/json" -X POST -d '{"type":"dna-variant", "query": {"ref":"T","alt":"A","pos":99} }' localhost:8080/search

DNA variant search requires three parameters. ref (the reference base), alt (the alternate base) and position in reference NC_000962.3. ref must be one of {"A","T","C","G"}, and alt one of {"A","T","C","G","X"}, the four amino acid and "X" for any other base.

Example result:
genotype can be one of {0/0, 0/1, 1/1}.
0/0=homozygous reference
0/1=heterozygous reference (mixed call)
1/1=heterozygous reference

{"type": "dna-variant", "result": {"T99A": {"SRR1229544": {"genotype": "1/0"}, "SRR1232058": {"genotype": "1/1"}, "SRR3725001": {"genotype": "1/1"},  "query": {"ref": "T", "alt": "A", "pos": 99}}}
curl -H "Content-Type: application/json" -X POST -d '{"type":"protein-variant", "query": {"ref":"S","alt":"L","pos":450,"gene":"rpoB"} }' localhost:8080/search

Protein variant search requires four parameters. The gene of interest (from https://www.ncbi.nlm.nih.gov/nuccore/NC_000962.3). ref (the reference amino acid), alt (the alternate base) and position in reference NC_000962.3. ref must be one of {"A","R","N","D","C","E","Q","G","H","I","L","K","M","F","P","S","T","W","Y","V"}, and alt one of {"A","R","N","D","C","E","Q","G","H","I","L","K","M","F","P","S","T","W","Y","V","X"}, all single letter amino acid codes and "X" for any other amino acid.
e.g. curl -H "Content-Type: application/json" -X POST -d '{"type":"protein-variant", "query":{"ref":"S","alt":"X","pos":450,"gene":"rpoB"} }' localhost:8080/search would query for all possible alternates to rpoB_S450.

Example result:

{"type": "protein-variant", "result": {"rpoB_S450L": {"SRR1229544": {"genotype": "0/0", "aa_mut": "S450L", "variant": "TCG761154CTG", "gene": "rpoB"}, "SRR1792504": {"genotype": "0/0", "aa_mut": "S450L", "variant": "TCG761154CTG", "gene": "rpoB"}, "SRR1173815": {"genotype": "0/0", "aa_mut": "S450L", "variant": "TCG761154CTG", "gene": "rpoB"}, "ERR133938": {"genotype": "0/0", "aa_mut": "S450L", "variant": "TCG761154CTG", "gene": "rpoB"}, "ERR550906": {"genotype": "1/1", "aa_mut": "S450L", "variant": "TCG761154TTG", "gene": "rpoB"}, "ERR1213887": {"genotype": "1/1", "aa_mut": "S450L", "variant": "TCG761154TTG", "gene": "rpoB"}}, "query": {"ref": "S", "alt": "L", "pos": 450, "gene": "rpoB"}}}