v2: retrained on scaled+deduplicated benchmark (host 0.995/0.993, engineered 0.909/0.874, 5-class 0.69); add read-filter CLI
Browse files
README.md
CHANGED
|
@@ -26,10 +26,10 @@ model-index:
|
|
| 26 |
split: test
|
| 27 |
metrics:
|
| 28 |
- type: roc_auc
|
| 29 |
-
value: 0.
|
| 30 |
name: AUROC (test)
|
| 31 |
- type: roc_auc
|
| 32 |
-
value: 0.
|
| 33 |
name: AUROC (novel taxa)
|
| 34 |
- task:
|
| 35 |
type: text-classification
|
|
@@ -40,10 +40,10 @@ model-index:
|
|
| 40 |
split: test
|
| 41 |
metrics:
|
| 42 |
- type: roc_auc
|
| 43 |
-
value: 0.
|
| 44 |
name: AUROC (test)
|
| 45 |
- type: roc_auc
|
| 46 |
-
value: 0.
|
| 47 |
name: AUROC (novel taxa)
|
| 48 |
- task:
|
| 49 |
type: text-classification
|
|
@@ -54,13 +54,13 @@ model-index:
|
|
| 54 |
split: test
|
| 55 |
metrics:
|
| 56 |
- type: accuracy
|
| 57 |
-
value: 0.
|
| 58 |
name: Accuracy (test, 5-class)
|
| 59 |
---
|
| 60 |
|
| 61 |
# dna-origin-classifier
|
| 62 |
|
| 63 |
-
A reference-free, alignment-free classifier that labels a DNA
|
| 64 |
human, other eukaryote, bacterial, viral, or engineered/synthetic. It uses no alignment and no
|
| 65 |
sequence database. One fixed k-mer featurizer feeds three linear heads.
|
| 66 |
|
|
@@ -90,22 +90,34 @@ clf.host_score(seq) # higher = more human/host-like
|
|
| 90 |
clf.engineered_score(seq) # higher = more likely engineered/synthetic
|
| 91 |
```
|
| 92 |
|
| 93 |
-
|
|
|
|
|
|
|
| 94 |
|
| 95 |
## Evaluation
|
| 96 |
|
| 97 |
Measured from the published weights on the test and novel-taxa splits of
|
| 98 |
-
[dna-origin-benchmark](https://huggingface.co/datasets/phanerozoic/dna-origin-benchmark)
|
|
|
|
| 99 |
|
| 100 |
| task | head | test | novel taxa |
|
| 101 |
|---|---|---|---|
|
| 102 |
-
| human vs non-host | `host` | 0.
|
| 103 |
-
| engineered vs natural | `engineered` | 0.
|
| 104 |
|
| 105 |
-
Five-class origin accuracy on the held-out test split: 0.
|
| 106 |
human/eukaryote boundary is the hardest case and accounts for most of the five-class error; the
|
| 107 |
binary `host` head is the right tool when the question is human versus non-host.
|
| 108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
## Calibration
|
| 110 |
|
| 111 |
The heads output linear margins, not calibrated probabilities. Use the argmax of `logits` for
|
|
@@ -114,15 +126,16 @@ read the raw values as probabilities.
|
|
| 114 |
|
| 115 |
## Training data
|
| 116 |
|
| 117 |
-
All heads are fit on the train split of `dna-origin-benchmark`
|
| 118 |
-
|
|
|
|
| 119 |
|
| 120 |
## References
|
| 121 |
|
| 122 |
- **Benchmark, splits, and baselines:** [phanerozoic/dna-origin-benchmark](https://huggingface.co/datasets/phanerozoic/dna-origin-benchmark).
|
| 123 |
- **Comparison model:** [HuggingFaceBio/Carbon-8B](https://huggingface.co/HuggingFaceBio/Carbon-8B), an 8B-parameter genomic language model evaluated zero-shot on the same splits. This classifier shares no weights or outputs with it and is not a derivative.
|
| 124 |
- **Method lineage:** k-mer naive-Bayes sequence classification, as in the RDP Classifier (Wang et al., 2007), and k-mer "genomic signatures" of composition (Karlin & Burge, 1995).
|
| 125 |
-
- **
|
| 126 |
|
| 127 |
## License
|
| 128 |
|
|
|
|
| 26 |
split: test
|
| 27 |
metrics:
|
| 28 |
- type: roc_auc
|
| 29 |
+
value: 0.995
|
| 30 |
name: AUROC (test)
|
| 31 |
- type: roc_auc
|
| 32 |
+
value: 0.993
|
| 33 |
name: AUROC (novel taxa)
|
| 34 |
- task:
|
| 35 |
type: text-classification
|
|
|
|
| 40 |
split: test
|
| 41 |
metrics:
|
| 42 |
- type: roc_auc
|
| 43 |
+
value: 0.909
|
| 44 |
name: AUROC (test)
|
| 45 |
- type: roc_auc
|
| 46 |
+
value: 0.874
|
| 47 |
name: AUROC (novel taxa)
|
| 48 |
- task:
|
| 49 |
type: text-classification
|
|
|
|
| 54 |
split: test
|
| 55 |
metrics:
|
| 56 |
- type: accuracy
|
| 57 |
+
value: 0.692
|
| 58 |
name: Accuracy (test, 5-class)
|
| 59 |
---
|
| 60 |
|
| 61 |
# dna-origin-classifier
|
| 62 |
|
| 63 |
+
A reference-free, alignment-free classifier that labels a DNA sequence by its source:
|
| 64 |
human, other eukaryote, bacterial, viral, or engineered/synthetic. It uses no alignment and no
|
| 65 |
sequence database. One fixed k-mer featurizer feeds three linear heads.
|
| 66 |
|
|
|
|
| 90 |
clf.engineered_score(seq) # higher = more likely engineered/synthetic
|
| 91 |
```
|
| 92 |
|
| 93 |
+
A read-filter CLI (`dna_filter.py`) wraps the host head for FASTQ/FASTA input in two modes:
|
| 94 |
+
host depletion (pathogen enrichment) and human removal (privacy). Requires only `numpy` and
|
| 95 |
+
`safetensors`.
|
| 96 |
|
| 97 |
## Evaluation
|
| 98 |
|
| 99 |
Measured from the published weights on the test and novel-taxa splits of
|
| 100 |
+
[dna-origin-benchmark](https://huggingface.co/datasets/phanerozoic/dna-origin-benchmark)
|
| 101 |
+
(24,950 fragments, 382 organisms, cluster-level splits):
|
| 102 |
|
| 103 |
| task | head | test | novel taxa |
|
| 104 |
|---|---|---|---|
|
| 105 |
+
| human vs non-host | `host` | 0.995 | 0.993 |
|
| 106 |
+
| engineered vs natural | `engineered` | 0.909 | 0.874 |
|
| 107 |
|
| 108 |
+
Five-class origin accuracy on the held-out test split: 0.692 (random baseline 0.20). The
|
| 109 |
human/eukaryote boundary is the hardest case and accounts for most of the five-class error; the
|
| 110 |
binary `host` head is the right tool when the question is human versus non-host.
|
| 111 |
|
| 112 |
+
## Comparison with database tools
|
| 113 |
+
|
| 114 |
+
Run on the same splits, Kraken2 against the RefSeq Standard-8 database reaches host sensitivity
|
| 115 |
+
0.972 and specificity 1.000 on databased taxa, so on organisms present in a database it is at
|
| 116 |
+
least as strong. The difference is on sequence absent from every database (the benchmark's
|
| 117 |
+
`undatabased` split): Kraken2 classifies 0% of it and BLAST 6.6%, while this classifier calls
|
| 118 |
+
100% of it (97% as non-human), because it needs no reference. It is also reference-free and about
|
| 119 |
+
50,000x smaller than an 8 GB database index.
|
| 120 |
+
|
| 121 |
## Calibration
|
| 122 |
|
| 123 |
The heads output linear margins, not calibrated probabilities. Use the argmax of `logits` for
|
|
|
|
| 126 |
|
| 127 |
## Training data
|
| 128 |
|
| 129 |
+
All heads are fit on the train split of `dna-origin-benchmark`: RefSeq coding sequences across
|
| 130 |
+
~370 taxa, NCBI synthetic-construct and vector records, synonymous recodings, and environmental
|
| 131 |
+
metagenome fragments.
|
| 132 |
|
| 133 |
## References
|
| 134 |
|
| 135 |
- **Benchmark, splits, and baselines:** [phanerozoic/dna-origin-benchmark](https://huggingface.co/datasets/phanerozoic/dna-origin-benchmark).
|
| 136 |
- **Comparison model:** [HuggingFaceBio/Carbon-8B](https://huggingface.co/HuggingFaceBio/Carbon-8B), an 8B-parameter genomic language model evaluated zero-shot on the same splits. This classifier shares no weights or outputs with it and is not a derivative.
|
| 137 |
- **Method lineage:** k-mer naive-Bayes sequence classification, as in the RDP Classifier (Wang et al., 2007), and k-mer "genomic signatures" of composition (Karlin & Burge, 1995).
|
| 138 |
+
- **Database tools compared:** Kraken2 (taxonomic classification against a sequence database) and Synsor (alignment-free engineered-DNA detection).
|
| 139 |
|
| 140 |
## License
|
| 141 |
|