Make get_chromosomes species-agnostic with optional genome parameter#185
Open
LiudengZhang wants to merge 1 commit intoGenentech:mainfrom
Open
Make get_chromosomes species-agnostic with optional genome parameter#185LiudengZhang wants to merge 1 commit intoGenentech:mainfrom
LiudengZhang wants to merge 1 commit intoGenentech:mainfrom
Conversation
Add an optional genome parameter to get_chromosomes() so that shortcut names like "autosomes" resolve to the actual chromosomes in the genome (e.g. chr1-chr19 for mouse) instead of hardcoded human chr1-chr22. When no genome is provided, the function falls back to the existing human defaults for backward compatibility. Updated the two call sites in preprocess.py that already have genome objects (get_gc_matched_intervals, make_insertion_bigwig) to pass the genome through. Closes Genentech#167
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #167.
get_chromosomes("autosomes")currently returns hardcoded human chromosomes (chr1-chr22), which is incorrect for other species (e.g. mouse only has chr1-chr19).This adds an optional
genomeparameter. When provided, chromosome names are read from the genome's sizes file and filtered by pattern (chr\d+for autosomes), so the function works correctly for any species. When omitted, it falls back to the existing human defaults for backward compatibility.Updated the two call sites in
preprocess.pythat already have genome objects loaded (get_gc_matched_intervals,make_insertion_bigwig) to pass the genome through.Tests added:
test_get_chromosomes_with_genome: uses a fake mouse genome (chr1-19 + chrX/Y/M) to verify all three shortcuts resolve correctly