Taxonomy and Molecular Function Classification¶
See the FAQ for dependencies, checkpoints and runtime configuration.
1) SupKTax classification¶
- Purpose: Classify gene sequences using the official SupKTax checkpoint.
- Prediction method: Run the official LucaOneTasks
SupKTaxmulticlass checkpoint directly, returning thetop_khighest-probability labels fromlabel.txt. - API:
dnakit.predictions.predict_sequence_properties(inputs[required], config=PropertyPredictionConfig(model="lucaone", task="supktax", model_source_path=...)[required], backend[optional]) - Input:
BiologicalSequencewithsequence_type="gene". Interpret labels using the checkpoint’slabel.txt. - Output: Returns
PropertyPredictionResult; each entry inrecordshas predictionoutput_names, numericvalues, and related metadata. - Example code:
from dnakit.predictions import (
BiologicalSequence,
PropertyPredictionConfig,
predict_sequence_properties,
)
result = predict_sequence_properties(
[BiologicalSequence("gene-1", "ATGGCC" * 100, "gene")],
config=PropertyPredictionConfig(
model="lucaone",
task="supktax",
model_source_path="/opt/LucaOneTasks",
top_k=5,
),
)
output = result.records[0].output
print(output.values.shape)
print(output.output_names)
- Example output (schematic structure):
2) GenusTax classification¶
- Purpose: Classify gene sequences using the official GenusTax checkpoint.
- Prediction method: Run the official LucaOneTasks
GenusTaxmulticlass checkpoint directly, returning the Top-k labels by probability. - API:
dnakit.predictions.predict_sequence_properties(inputs[required], config=PropertyPredictionConfig(model="lucaone", task="genustax", model_source_path=...)[required], backend[optional]) - Input:
BiologicalSequencewithsequence_type="gene". The LucaOneTasks README swaps the natural-language taxonomic levels for SupKTax/GenusTax, so use the actuallabel.txtto interpret results. - Output: Returns
PropertyPredictionResult; each entry inrecordshas predictionoutput_names, numericvalues, and related metadata. - Example code:
from dnakit.predictions import (
BiologicalSequence,
PropertyPredictionConfig,
predict_sequence_properties,
)
result = predict_sequence_properties(
[BiologicalSequence("gene-1", "ATGGCC" * 100, "gene")],
config=PropertyPredictionConfig(
model="lucaone",
task="genustax",
model_source_path="/opt/LucaOneTasks",
top_k=5,
),
)
output = result.records[0].output
print(output.values.shape)
print(output.metadata["predicted_label"])
- Example output (schematic structure):
3) Species classification¶
- Purpose: Predict the species class of a gene sequence.
- Prediction method: Run the official LucaOneTasks
SpeciesTaxmulticlass checkpoint directly, returning Top-k species labels and probabilities. - API:
dnakit.predictions.predict_sequence_properties(inputs[required], config=PropertyPredictionConfig(model="lucaone", task="speciestax", model_source_path=...)[required], backend[optional]) - Input:
BiologicalSequencewithsequence_type="gene"; usetop_kto set the number of labels returned. - Output: Returns
PropertyPredictionResult; each entry inrecordshas predictionoutput_names, numericvalues, and related metadata. - Example code:
from dnakit.predictions import (
BiologicalSequence,
PropertyPredictionConfig,
predict_sequence_properties,
)
result = predict_sequence_properties(
[BiologicalSequence("gene-1", "ATGGCC" * 100, "gene")],
config=PropertyPredictionConfig(
model="lucaone",
task="speciestax",
model_source_path="/opt/LucaOneTasks",
top_k=5,
),
)
output = result.records[0].output
print(output.values.shape)
print(output.output_names)
- Example output (schematic structure):
4) Prokaryotic protein subcellular localization¶
- Purpose: Predict subcellular localization classes for prokaryotic proteins.
- Prediction method: Run the official LucaOneTasks
ProtLocmulticlass checkpoint directly, returning Top-k localization labels and probabilities. - API:
dnakit.predictions.predict_sequence_properties(inputs[required], config=PropertyPredictionConfig(model="lucaone", task="protein_location", model_source_path=...)[required], backend[optional]) - Input:
BiologicalSequencewithsequence_type="protein". - Output: Returns
PropertyPredictionResult; each entry inrecordshas predictionoutput_names, numericvalues, and related metadata. - Example code:
from dnakit.predictions import (
BiologicalSequence,
PropertyPredictionConfig,
predict_sequence_properties,
)
result = predict_sequence_properties(
[
BiologicalSequence(
"protein-1",
"MAMAPRTEINSTRING" * 10,
"protein",
)
],
config=PropertyPredictionConfig(
model="lucaone",
task="protein_location",
model_source_path="/opt/LucaOneTasks",
top_k=5,
),
)
output = result.records[0].output
print(output.values.shape)
print(output.output_names)
- Example output (schematic structure):
5) ncRNA families¶
- Purpose: Predict the family of a noncoding RNA sequence.
- Prediction method: Run the official LucaOneTasks
ncRNAFammulticlass checkpoint directly, returning Top-k family labels and probabilities. - API:
dnakit.predictions.predict_sequence_properties(inputs[required], config=PropertyPredictionConfig(model="lucaone", task="ncrna_family", model_source_path=...)[required], backend[optional]) - Input:
BiologicalSequencewithsequence_type="gene". DNA or RNA alphabets are accepted; the official task pipeline handlesU. - Output: Returns
PropertyPredictionResult; each entry inrecordshas predictionoutput_names, numericvalues, and related metadata. - Example code:
from dnakit.predictions import (
BiologicalSequence,
PropertyPredictionConfig,
predict_sequence_properties,
)
result = predict_sequence_properties(
[BiologicalSequence("ncrna-1", "AUGCUA" * 100, "gene")],
config=PropertyPredictionConfig(
model="lucaone",
task="ncrna_family",
model_source_path="/opt/LucaOneTasks",
top_k=5,
),
)
output = result.records[0].output
print(output.values.shape)
print(output.output_names)
- Example output (schematic structure):
6) Human versus worm sequence classification¶
- Purpose: Classify a sequence as human or Caenorhabditis elegans.
- Method: Load the fully fine-tuned backbone and classification head, valid-bin mean-pool the final embeddings, and return 2 softmax probabilities. No training or fine-tuning occurs at runtime.
- API:
dnakit.predictions.predict_enformer_benchmark(inputs[required], task="demo_human_or_worm"[required], checkpoint_dir or checkpoint_path[optional]) - Input:
BiologicalSequenceorDNARecord; A/C/G/T and IUPAC ambiguity symbols are accepted, and biological bases are never silently truncated. - Output: Returns
PropertyPredictionResult; each entry inrecordshas predictionoutput_names, numericvalues, and related metadata. - Example code:
from dnakit.predictions import BiologicalSequence, predict_enformer_benchmark
result = predict_enformer_benchmark(
[BiologicalSequence("sequence-1", "ACGT" * 50)],
task="demo_human_or_worm",
checkpoint_dir="/data/enformer-checkpoints",
device="cuda",
)
output = result.records[0].output
print(output.output_names)
print(output.values)
print(output.metadata["predicted_label"])
- Example output (values vary with sequence and checkpoint):