Skip to content

Commit 4a86785

Browse files
authored
fix: Make genome assembly optional. Use builtin chromsizes by default (#20)
1 parent 30003c3 commit 4a86785

File tree

4 files changed

+22
-9
lines changed

4 files changed

+22
-9
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
---
88

9+
## [1.0.5] - December 29, 2025
10+
11+
### Updated
12+
- "assembly" argument is optional. Assembly is inferred from Cooler if possible, with fallback to optional argument.
13+
14+
---
15+
916
## [1.0.4] - October 31, 2025
1017

1118
### Added

jointly_hic/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.0.4"
1+
__version__ = "1.0.5"

jointly_hic/core/decomposer.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,13 @@ def partition(self) -> np.ndarray:
146146
return self._partition
147147

148148
def get_chromosome_sizes(self) -> pd.Series:
149-
"""Download chromosome sizes using bioframe."""
150-
chromosome_sizes = bioframe.fetch_chromsizes(self.configuration.assembly.lower())
149+
"""Obtain chromosome sizes from cooler or using bioframe."""
150+
if self.configuration.assembly.lower() == "unknown":
151+
chromosome_sizes = Cooler(
152+
f"{self.configuration.mcools[0]}::/resolutions/{self.configuration.resolution}"
153+
).chromsizes
154+
else:
155+
chromosome_sizes = bioframe.fetch_chromsizes(self.configuration.assembly.lower())
151156
# chromosome_sizes is a pandas Series with chromosome names as index and chromosome sizes as values
152157
# Filter to only the first chrom_limit chromosomes
153158
chromosome_sizes = chromosome_sizes.iloc[: self.configuration.chrom_limit]

jointly_hic/parser.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,6 @@ def configure_embed_parser(self, embed_parser):
8585
required=True,
8686
type=int,
8787
)
88-
embed_parser.add_argument(
89-
"--assembly",
90-
help="Genome assembly name (UCSC or NCBI) used for alignment (e.g. hg38, mm10, ce11)",
91-
required=True,
92-
type=str,
93-
)
9488
embed_parser.add_argument(
9589
"--output",
9690
help="Prefix for output files (Default: output_<datetime>)",
@@ -149,6 +143,13 @@ def configure_embed_parser(self, embed_parser):
149143
type=int,
150144
default=10000,
151145
)
146+
embed_parser.add_argument(
147+
"--assembly",
148+
help="Optional genome assembly name (UCSC or NCBI) used for alignment (e.g. hg38, mm10, ce11)",
149+
required=False,
150+
type=str,
151+
default="unknown",
152+
)
152153
embed_parser.set_defaults(func=self.run_embedding)
153154

154155
def configure_post_process_parser(self, post_process_parser):

0 commit comments

Comments
 (0)