Skip to content

Commit

Permalink
Merge pull request #82 from aertslab/fix_resizing_chromsizes
Browse files Browse the repository at this point in the history
Fix change_regions_width not using Genome chromsizes
  • Loading branch information
LukasMahieu authored Dec 19, 2024
2 parents 7435c23 + 1356aca commit a7ad41c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/crested/pp/_regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ def _check_input_params(chromsizes_file):
chromsizes = _read_chromsizes(chromsizes_file)
elif conf.genome:
chromsizes = conf.genome.chrom_sizes
else:
chromsizes = None

centers = (adata.var["start"] + adata.var["end"]) / 2
half_width = width / 2
Expand All @@ -85,7 +87,7 @@ def _check_input_params(chromsizes_file):
)

# Check if regions are within the chromosome boundaries
if chromsizes_file is not None:
if chromsizes is not None:
regions_to_keep = list(adata.var_names.copy())
for idx, row in adata.var.iterrows():
chr_name = row["chr"]
Expand Down

0 comments on commit a7ad41c

Please sign in to comment.