mhcflow 0.2.2__tar.gz → 0.2.3__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.
@@ -24,3 +24,6 @@ wheels/
24
24
  .tox/
25
25
 
26
26
  _version.py
27
+
28
+ ## documentation
29
+ site/
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: mhcflow
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: MHC Class I and II workflow with fisher, realigner and typer.
5
5
  Project-URL: Source, https://github.com/svm-zhang/mhcflow
6
6
  Project-URL: Documentation, https://svm-zhang.github.io/mhcflow/
7
7
  Project-URL: Issues, https://github.com/svm-zhang/mhcflow/issues
8
- Author-email: simo <svm.zhang@gmail.com>
9
- Maintainer-email: Simo Zhang <svm.zhang@gmail.com>
8
+ Author-email: simo <me@simovz.me>
9
+ Maintainer-email: Simo Zhang <me@simovz.me>
10
10
  License: MIT
11
11
  Keywords: bioinformatics, genomics, sequencing, HLA typing
12
12
  Classifier: Development Status :: 4 - Beta
@@ -18,6 +18,7 @@ Classifier: Programming Language :: Python :: 3.10
18
18
  Classifier: Programming Language :: Python :: 3.11
19
19
  Classifier: Programming Language :: Python :: 3.12
20
20
  Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
21
22
  Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
22
23
  Classifier: Topic :: Software Development :: Libraries
23
24
  Requires-Python: >=3.10
@@ -31,7 +32,6 @@ Description-Content-Type: text/markdown
31
32
 
32
33
  [![PyPI version](https://img.shields.io/pypi/v/mhcflow)](https://pypi.org/project/mhcflow/)
33
34
  ![Python versions](https://img.shields.io/pypi/pyversions/mhcflow)
34
- [![PyPI Downloads](https://img.shields.io/pypi/dm/mhcflow)](https://pypistats.org/packages/mhcflow)
35
35
  ![License](https://img.shields.io/pypi/l/mhcflow)
36
36
 
37
37
  MHC class I and II typing workflow including fishing, realigning, and typing that
@@ -2,7 +2,6 @@
2
2
 
3
3
  [![PyPI version](https://img.shields.io/pypi/v/mhcflow)](https://pypi.org/project/mhcflow/)
4
4
  ![Python versions](https://img.shields.io/pypi/pyversions/mhcflow)
5
- [![PyPI Downloads](https://img.shields.io/pypi/dm/mhcflow)](https://pypistats.org/packages/mhcflow)
6
5
  ![License](https://img.shields.io/pypi/l/mhcflow)
7
6
 
8
7
  MHC class I and II typing workflow including fishing, realigning, and typing that
@@ -10,7 +10,7 @@ description = "MHC Class I and II workflow with fisher, realigner and typer."
10
10
  readme = {file="README.md", content-type = "text/markdown"}
11
11
  keywords = ["bioinformatics, genomics, sequencing, HLA typing"]
12
12
  authors = [
13
- { name = "simo", email = "svm.zhang@gmail.com" }
13
+ { name = "simo", email = "me@simovz.me" }
14
14
  ]
15
15
  classifiers = [
16
16
  "Development Status :: 4 - Beta",
@@ -22,6 +22,7 @@ classifiers = [
22
22
  "Programming Language :: Python :: 3.11",
23
23
  "Programming Language :: Python :: 3.12",
24
24
  "Programming Language :: Python :: 3.13",
25
+ "Programming Language :: Python :: 3.14",
25
26
  "Topic :: Scientific/Engineering :: Bio-Informatics",
26
27
  "Topic :: Software Development :: Libraries"
27
28
  ]
@@ -36,7 +37,7 @@ urls.Documentation = "https://svm-zhang.github.io/mhcflow/"
36
37
  urls.Issues = "https://github.com/svm-zhang/mhcflow/issues"
37
38
  license = "MIT"
38
39
  maintainers = [
39
- { name = "Simo Zhang", email = "svm.zhang@gmail.com" }
40
+ { name = "Simo Zhang", email = "me@simovz.me" }
40
41
  ]
41
42
  dynamic = ["version"]
42
43
  requires-python = ">= 3.10"
@@ -44,11 +45,10 @@ requires-python = ">= 3.10"
44
45
  [project.scripts]
45
46
  mhcflow = "mhcflow:run_mhcflow"
46
47
 
47
- [tool.rye]
48
- managed = true
49
- dev-dependencies = [
50
- "tox>=4.24.2",
48
+ [dependency-groups]
49
+ dev = [
51
50
  "mypy>=1.15.0",
51
+ "zensical>=0.0.23",
52
52
  ]
53
53
 
54
54
  [tool.hatch]
@@ -56,7 +56,6 @@ metadata.allow-direct-references = true
56
56
  build.targets.sdist.include = [
57
57
  "/src",
58
58
  "/tests",
59
- "/tox.ini"
60
59
  ]
61
60
  build.targets.wheel.packages = ["src/mhcflow"]
62
61
  build.hooks.vcs.version-file = "src/mhcflow/_version.py"
@@ -0,0 +1,24 @@
1
+ # file generated by vcs-versioning
2
+ # don't change, don't track in version control
3
+ from __future__ import annotations
4
+
5
+ __all__ = [
6
+ "__version__",
7
+ "__version_tuple__",
8
+ "version",
9
+ "version_tuple",
10
+ "__commit_id__",
11
+ "commit_id",
12
+ ]
13
+
14
+ version: str
15
+ __version__: str
16
+ __version_tuple__: tuple[int | str, ...]
17
+ version_tuple: tuple[int | str, ...]
18
+ commit_id: str | None
19
+ __commit_id__: str | None
20
+
21
+ __version__ = version = '0.2.3'
22
+ __version_tuple__ = version_tuple = (0, 2, 3)
23
+
24
+ __commit_id__ = commit_id = None
@@ -55,7 +55,7 @@ def _bam2fq_from_idx(
55
55
  # each idx file will be input to samtools view -N
56
56
  qnames = idx_df["qnames"].unique().to_numpy()
57
57
  qnames_batches = np.array_split(qnames, nproc)
58
- idxs = []
58
+ idxs: list[_PathLike] = []
59
59
  for i in range(len(qnames_batches)):
60
60
  qname_batch_fspath = outdir / f"{sm}.fisher.idxs.{i}.txt"
61
61
  pl.DataFrame({"qnames": qnames_batches[i]}).write_csv(
@@ -3,34 +3,34 @@ import json
3
3
  import sys
4
4
  from collections.abc import Sequence
5
5
  from dataclasses import dataclass, field
6
+ from pathlib import Path
7
+ from typing import TypeAlias
6
8
 
7
9
  from tinyscibio import BAMetadata, _PathLike, parse_path
8
10
 
9
11
  from .logger import logger
10
12
 
13
+ _PathOrPaths: TypeAlias = _PathLike | list[_PathLike]
14
+
11
15
 
12
16
  @dataclass
13
17
  class FileManifest:
14
- _inputs: dict[str, _PathLike | Sequence[_PathLike]] = field(
15
- default_factory=dict, init=False
16
- )
17
- _outputs: dict[str, _PathLike | Sequence[_PathLike]] = field(
18
- default_factory=dict, init=False
19
- )
18
+ _inputs: dict[str, _PathOrPaths] = field(default_factory=dict, init=False)
19
+ _outputs: dict[str, _PathOrPaths] = field(default_factory=dict, init=False)
20
20
  _aux: dict[str, _PathLike] = field(default_factory=dict, init=False)
21
- _intermediates: dict[str, _PathLike | Sequence[_PathLike]] = field(
21
+ _intermediates: dict[str, _PathOrPaths] = field(
22
22
  default_factory=dict, init=False
23
23
  )
24
- _intermediate_aux: dict[str, _PathLike | Sequence[_PathLike]] = field(
24
+ _intermediate_aux: dict[str, _PathOrPaths] = field(
25
25
  default_factory=dict, init=False
26
26
  )
27
27
 
28
28
  @property
29
- def inputs(self) -> dict[str, _PathLike | Sequence[_PathLike]]:
29
+ def inputs(self) -> dict[str, _PathOrPaths]:
30
30
  return self._inputs
31
31
 
32
32
  @property
33
- def outputs(self) -> dict[str, _PathLike | Sequence[_PathLike]]:
33
+ def outputs(self) -> dict[str, _PathOrPaths]:
34
34
  return self._outputs
35
35
 
36
36
  @property
@@ -38,34 +38,26 @@ class FileManifest:
38
38
  return self._aux
39
39
 
40
40
  @property
41
- def intermediate_aux(self) -> dict[str, _PathLike | Sequence[_PathLike]]:
41
+ def intermediate_aux(self) -> dict[str, _PathOrPaths]:
42
42
  return self._intermediate_aux
43
43
 
44
44
  @property
45
- def intermediates(self) -> dict[str, _PathLike | Sequence[_PathLike]]:
45
+ def intermediates(self) -> dict[str, _PathOrPaths]:
46
46
  return self._intermediates
47
47
 
48
- def _register_inputs(
49
- self, **kwargs: _PathLike | Sequence[_PathLike]
50
- ) -> None:
48
+ def _register_inputs(self, **kwargs: _PathOrPaths) -> None:
51
49
  self._inputs.update(**kwargs)
52
50
 
53
- def _register_outputs(
54
- self, **kwargs: _PathLike | Sequence[_PathLike]
55
- ) -> None:
51
+ def _register_outputs(self, **kwargs: _PathOrPaths) -> None:
56
52
  self._outputs.update(**kwargs)
57
53
 
58
54
  def _register_aux(self, **kwargs: _PathLike) -> None:
59
55
  self._aux.update(**kwargs)
60
56
 
61
- def _register_intermediate(
62
- self, **kwargs: _PathLike | Sequence[_PathLike]
63
- ) -> None:
57
+ def _register_intermediate(self, **kwargs: _PathOrPaths) -> None:
64
58
  self._intermediates.update(**kwargs)
65
59
 
66
- def _register_intermediate_aux(
67
- self, **kwargs: _PathLike | Sequence[_PathLike]
68
- ) -> None:
60
+ def _register_intermediate_aux(self, **kwargs: _PathOrPaths) -> None:
69
61
  self._intermediate_aux.update(**kwargs)
70
62
 
71
63
  @classmethod
@@ -162,11 +154,14 @@ def _verify_prev_run(fm: FileManifest, overwrite: bool = False) -> bool:
162
154
 
163
155
  logger.info("Verify manifest from previous run.")
164
156
  done = parse_path(fm.aux.get("done", ""))
165
- intermediate_dones = []
157
+ intermediate_dones: list[_PathLike] = []
166
158
  for k, v in fm.intermediate_aux.items():
167
159
  if not k.endswith("done") and not k.endswith("dones"):
168
160
  continue
169
- intermediate_dones += v if isinstance(v, list) else [v]
161
+ if isinstance(v, list):
162
+ intermediate_dones.extend(v)
163
+ else:
164
+ intermediate_dones.append(v)
170
165
  not_exists = [
171
166
  str(f) for f in intermediate_dones if not parse_path(f).exists()
172
167
  ]
@@ -1,21 +0,0 @@
1
- # file generated by setuptools-scm
2
- # don't change, don't track in version control
3
-
4
- __all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
5
-
6
- TYPE_CHECKING = False
7
- if TYPE_CHECKING:
8
- from typing import Tuple
9
- from typing import Union
10
-
11
- VERSION_TUPLE = Tuple[Union[int, str], ...]
12
- else:
13
- VERSION_TUPLE = object
14
-
15
- version: str
16
- __version__: str
17
- __version_tuple__: VERSION_TUPLE
18
- version_tuple: VERSION_TUPLE
19
-
20
- __version__ = version = '0.2.2'
21
- __version_tuple__ = version_tuple = (0, 2, 2)
mhcflow-0.2.2/tox.ini DELETED
@@ -1,20 +0,0 @@
1
- [tox]
2
- requires =
3
- tox>=4
4
- env_list = type
5
- skip_missing_interpreters = true
6
-
7
- [gh-actions]
8
- python =
9
- 3.10: type
10
- 3.11: type
11
- 3.12: type
12
- 3.13: type
13
-
14
-
15
- [testenv:type]
16
- description = "Run type checker on code base"
17
- deps =
18
- mypy>=1.11
19
- types-requests>=2.32
20
- commands = mypy "src{/}mhcflow"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes