biofiles 0.0.10__tar.gz → 0.0.12__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.
- {biofiles-0.0.10 → biofiles-0.0.12}/PKG-INFO +3 -2
- biofiles-0.0.12/biofiles/fai.py +23 -0
- {biofiles-0.0.10 → biofiles-0.0.12}/biofiles/types/alignment.py +9 -1
- {biofiles-0.0.10 → biofiles-0.0.12}/biofiles/types/sequence.py +7 -0
- {biofiles-0.0.10 → biofiles-0.0.12}/biofiles/utility/feature.py +1 -1
- {biofiles-0.0.10 → biofiles-0.0.12}/biofiles.egg-info/PKG-INFO +3 -2
- {biofiles-0.0.10 → biofiles-0.0.12}/biofiles.egg-info/SOURCES.txt +1 -0
- {biofiles-0.0.10 → biofiles-0.0.12}/pyproject.toml +1 -1
- {biofiles-0.0.10 → biofiles-0.0.12}/LICENSE +0 -0
- {biofiles-0.0.10 → biofiles-0.0.12}/README.md +0 -0
- {biofiles-0.0.10 → biofiles-0.0.12}/biofiles/__init__.py +0 -0
- {biofiles-0.0.10 → biofiles-0.0.12}/biofiles/bam.py +0 -0
- {biofiles-0.0.10 → biofiles-0.0.12}/biofiles/common.py +0 -0
- {biofiles-0.0.10 → biofiles-0.0.12}/biofiles/fasta.py +0 -0
- {biofiles-0.0.10 → biofiles-0.0.12}/biofiles/gff.py +0 -0
- {biofiles-0.0.10 → biofiles-0.0.12}/biofiles/gtf.py +0 -0
- {biofiles-0.0.10 → biofiles-0.0.12}/biofiles/repeatmasker.py +0 -0
- {biofiles-0.0.10 → biofiles-0.0.12}/biofiles/types/__init__.py +0 -0
- {biofiles-0.0.10 → biofiles-0.0.12}/biofiles/types/feature.py +0 -0
- {biofiles-0.0.10 → biofiles-0.0.12}/biofiles/types/repeat.py +0 -0
- {biofiles-0.0.10 → biofiles-0.0.12}/biofiles/utility/__init__.py +0 -0
- {biofiles-0.0.10 → biofiles-0.0.12}/biofiles/utility/cli.py +0 -0
- {biofiles-0.0.10 → biofiles-0.0.12}/biofiles.egg-info/dependency_links.txt +0 -0
- {biofiles-0.0.10 → biofiles-0.0.12}/biofiles.egg-info/top_level.txt +0 -0
- {biofiles-0.0.10 → biofiles-0.0.12}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: biofiles
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.12
|
4
4
|
Summary: Pure-Python, zero-dependency collection of bioinformatics-related file readers and writers
|
5
5
|
Author-email: Tigran Saluev <tigran@saluev.com>
|
6
6
|
Maintainer-email: Tigran Saluev <tigran@saluev.com>
|
@@ -36,6 +36,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
36
36
|
Requires-Python: >=3.10
|
37
37
|
Description-Content-Type: text/markdown
|
38
38
|
License-File: LICENSE
|
39
|
+
Dynamic: license-file
|
39
40
|
|
40
41
|
# biofiles
|
41
42
|
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import sys
|
2
|
+
from typing import Iterator
|
3
|
+
|
4
|
+
from biofiles.common import Reader
|
5
|
+
from biofiles.types.sequence import SequenceDescription
|
6
|
+
|
7
|
+
|
8
|
+
class FAIReader(Reader):
|
9
|
+
def __iter__(self) -> Iterator[SequenceDescription]:
|
10
|
+
for line in self._input:
|
11
|
+
sequence_id, length_str, byte_offset_str, _, _ = line.rstrip("\n").split(
|
12
|
+
"\t"
|
13
|
+
)
|
14
|
+
yield SequenceDescription(
|
15
|
+
id=sequence_id, length=int(length_str), byte_offset=int(byte_offset_str)
|
16
|
+
)
|
17
|
+
|
18
|
+
|
19
|
+
if __name__ == "__main__":
|
20
|
+
for path in sys.argv[1:]:
|
21
|
+
with FAIReader(path) as reader:
|
22
|
+
for seq_desc in reader:
|
23
|
+
print(seq_desc)
|
@@ -1,7 +1,15 @@
|
|
1
1
|
from dataclasses import dataclass
|
2
2
|
|
3
3
|
|
4
|
-
__all__ = [
|
4
|
+
__all__ = [
|
5
|
+
"Alignment",
|
6
|
+
"BAMFlag",
|
7
|
+
"BAMTag",
|
8
|
+
"CIGAR",
|
9
|
+
"CIGAROpKind",
|
10
|
+
"CIGAROperation",
|
11
|
+
"ReferenceSequence",
|
12
|
+
]
|
5
13
|
|
6
14
|
from enum import IntFlag
|
7
15
|
|
@@ -183,7 +183,7 @@ class FeatureReader(Reader):
|
|
183
183
|
|
184
184
|
def _finalize_other(self, draft: FeatureDraft, result: Features) -> Feature:
|
185
185
|
parent_id = self._extract_parent_id(draft)
|
186
|
-
parent = result.by_id
|
186
|
+
parent = result.by_id.get(parent_id) if parent_id is not None else None
|
187
187
|
|
188
188
|
return Feature(
|
189
189
|
sequence_id=draft.sequence_id,
|
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: biofiles
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.12
|
4
4
|
Summary: Pure-Python, zero-dependency collection of bioinformatics-related file readers and writers
|
5
5
|
Author-email: Tigran Saluev <tigran@saluev.com>
|
6
6
|
Maintainer-email: Tigran Saluev <tigran@saluev.com>
|
@@ -36,6 +36,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
36
36
|
Requires-Python: >=3.10
|
37
37
|
Description-Content-Type: text/markdown
|
38
38
|
License-File: LICENSE
|
39
|
+
Dynamic: license-file
|
39
40
|
|
40
41
|
# biofiles
|
41
42
|
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|