mutlof 1.0.0__tar.gz → 1.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mutlof-1.0.0 → mutlof-1.0.1}/PKG-INFO +3 -3
- mutlof-1.0.1/README.md +13 -0
- {mutlof-1.0.0 → mutlof-1.0.1}/mutlof/__init__.py +1 -1
- {mutlof-1.0.0 → mutlof-1.0.1}/mutlof/cli.py +1 -1
- {mutlof-1.0.0 → mutlof-1.0.1}/mutlof/codes.py +19 -0
- {mutlof-1.0.0 → mutlof-1.0.1}/mutlof/score.py +12 -4
- {mutlof-1.0.0 → mutlof-1.0.1}/mutlof.egg-info/PKG-INFO +3 -3
- {mutlof-1.0.0 → mutlof-1.0.1}/pyproject.toml +1 -1
- mutlof-1.0.0/README.md +0 -13
- {mutlof-1.0.0 → mutlof-1.0.1}/MANIFEST.in +0 -0
- {mutlof-1.0.0 → mutlof-1.0.1}/mutlof/model.py +0 -0
- {mutlof-1.0.0 → mutlof-1.0.1}/mutlof/proteins.py +0 -0
- {mutlof-1.0.0 → mutlof-1.0.1}/mutlof/tokens.py +0 -0
- {mutlof-1.0.0 → mutlof-1.0.1}/mutlof/weights/model_best.pt +0 -0
- {mutlof-1.0.0 → mutlof-1.0.1}/mutlof.egg-info/SOURCES.txt +0 -0
- {mutlof-1.0.0 → mutlof-1.0.1}/mutlof.egg-info/dependency_links.txt +0 -0
- {mutlof-1.0.0 → mutlof-1.0.1}/mutlof.egg-info/entry_points.txt +0 -0
- {mutlof-1.0.0 → mutlof-1.0.1}/mutlof.egg-info/requires.txt +0 -0
- {mutlof-1.0.0 → mutlof-1.0.1}/mutlof.egg-info/top_level.txt +0 -0
- {mutlof-1.0.0 → mutlof-1.0.1}/requirements.txt +0 -0
- {mutlof-1.0.0 → mutlof-1.0.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mutlof
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.1
|
|
4
4
|
Summary: Continuous LoF scores from a reference DNA FASTA and a MutCode table.
|
|
5
5
|
Requires-Python: >=3.10
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -9,7 +9,7 @@ Requires-Dist: biopython>=1.81
|
|
|
9
9
|
|
|
10
10
|
# MutLoF
|
|
11
11
|
|
|
12
|
-
Continuous LoF scores from a reference DNA FASTA and a MutCode table. Version 1.0.
|
|
12
|
+
Continuous LoF scores from a reference DNA FASTA and a MutCode table. Version 1.0.1.
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
15
|
pip install .
|
|
@@ -19,4 +19,4 @@ mutlof \
|
|
|
19
19
|
--output scores.tsv
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
`genes.fa` headers must match the `gene` column. An empty code list scores 0. The weights ship inside the package. Add `--device cuda` on a GPU.
|
|
22
|
+
`genes.fa` headers must match the `gene` column. A Rustaroo gene such as `tetM/tetM_0002` uses the `tetM` header, and the row's `reference_sha256` is checked against that sequence. An empty code list scores 0. The weights ship inside the package. Add `--device cuda` on a GPU.
|
mutlof-1.0.1/README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# MutLoF
|
|
2
|
+
|
|
3
|
+
Continuous LoF scores from a reference DNA FASTA and a MutCode table. Version 1.0.1.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
pip install .
|
|
7
|
+
mutlof \
|
|
8
|
+
--reference genes.fa \
|
|
9
|
+
--codes mutation_codes.tsv \
|
|
10
|
+
--output scores.tsv
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
`genes.fa` headers must match the `gene` column. A Rustaroo gene such as `tetM/tetM_0002` uses the `tetM` header, and the row's `reference_sha256` is checked against that sequence. An empty code list scores 0. The weights ship inside the package. Add `--device cuda` on a GPU.
|
|
@@ -89,6 +89,25 @@ def read_fasta(path: str | Path) -> dict[str, str]:
|
|
|
89
89
|
return sequences
|
|
90
90
|
|
|
91
91
|
|
|
92
|
+
def reference_dna(gene: str, sequences: dict[str, str]) -> str:
|
|
93
|
+
"""DNA for a MutCode gene name.
|
|
94
|
+
|
|
95
|
+
An exact FASTA header wins. Rustaroo stores ``family/sequence_id`` in the
|
|
96
|
+
gene column and the family name in the FASTA header, so otherwise the
|
|
97
|
+
longest ``/``-separated prefix that is a header is used.
|
|
98
|
+
"""
|
|
99
|
+
if gene in sequences:
|
|
100
|
+
return sequences[gene]
|
|
101
|
+
prefix = gene
|
|
102
|
+
while True:
|
|
103
|
+
prefix, separator, _member = prefix.rpartition("/")
|
|
104
|
+
if not separator:
|
|
105
|
+
break
|
|
106
|
+
if prefix in sequences:
|
|
107
|
+
return sequences[prefix]
|
|
108
|
+
raise KeyError(gene)
|
|
109
|
+
|
|
110
|
+
|
|
92
111
|
def read_code_table(path: str | Path) -> list[dict[str, str]]:
|
|
93
112
|
"""MutCode TSV or a LoF matrix. Gzip is accepted."""
|
|
94
113
|
import gzip
|
|
@@ -7,7 +7,14 @@ from pathlib import Path
|
|
|
7
7
|
|
|
8
8
|
import torch
|
|
9
9
|
|
|
10
|
-
from mutlof.codes import
|
|
10
|
+
from mutlof.codes import (
|
|
11
|
+
apply_edits,
|
|
12
|
+
parse_codes,
|
|
13
|
+
read_code_table,
|
|
14
|
+
read_fasta,
|
|
15
|
+
reference_dna,
|
|
16
|
+
sha256_seq,
|
|
17
|
+
)
|
|
11
18
|
from mutlof.model import LoFModel, load_model
|
|
12
19
|
from mutlof.proteins import protein_features, translate_dna
|
|
13
20
|
from mutlof.tokens import encode_protein, featurize_dna
|
|
@@ -51,9 +58,10 @@ def score_table(
|
|
|
51
58
|
prepared: list[dict[str, torch.Tensor] | None] = []
|
|
52
59
|
for row in rows:
|
|
53
60
|
gene = row["gene"]
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
61
|
+
try:
|
|
62
|
+
reference = reference_dna(gene, sequences)
|
|
63
|
+
except KeyError:
|
|
64
|
+
raise KeyError(f"{gene} is not in {reference_fasta}") from None
|
|
57
65
|
digest = row["reference_sha256"]
|
|
58
66
|
if digest and sha256_seq(reference) != digest.lower():
|
|
59
67
|
raise ValueError(f"{gene}: reference FASTA does not match reference_sha256")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mutlof
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.1
|
|
4
4
|
Summary: Continuous LoF scores from a reference DNA FASTA and a MutCode table.
|
|
5
5
|
Requires-Python: >=3.10
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -9,7 +9,7 @@ Requires-Dist: biopython>=1.81
|
|
|
9
9
|
|
|
10
10
|
# MutLoF
|
|
11
11
|
|
|
12
|
-
Continuous LoF scores from a reference DNA FASTA and a MutCode table. Version 1.0.
|
|
12
|
+
Continuous LoF scores from a reference DNA FASTA and a MutCode table. Version 1.0.1.
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
15
|
pip install .
|
|
@@ -19,4 +19,4 @@ mutlof \
|
|
|
19
19
|
--output scores.tsv
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
`genes.fa` headers must match the `gene` column. An empty code list scores 0. The weights ship inside the package. Add `--device cuda` on a GPU.
|
|
22
|
+
`genes.fa` headers must match the `gene` column. A Rustaroo gene such as `tetM/tetM_0002` uses the `tetM` header, and the row's `reference_sha256` is checked against that sequence. An empty code list scores 0. The weights ship inside the package. Add `--device cuda` on a GPU.
|
mutlof-1.0.0/README.md
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# MutLoF
|
|
2
|
-
|
|
3
|
-
Continuous LoF scores from a reference DNA FASTA and a MutCode table. Version 1.0.0.
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
pip install .
|
|
7
|
-
mutlof \
|
|
8
|
-
--reference genes.fa \
|
|
9
|
-
--codes mutation_codes.tsv \
|
|
10
|
-
--output scores.tsv
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
`genes.fa` headers must match the `gene` column. An empty code list scores 0. The weights ship inside the package. Add `--device cuda` on a GPU.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|