Store the LD-sketch sample axis once and drop it on emptied sketches - #586
Merged
Merged
Conversation
genotypeDelayedArray copied handle@sampleIds into GhSeed@dn[[2]], read by nothing but the dimnames() method. The sample axis is an anonymous projection dimension (LD is a variant x variant statistic), so the copy is dead weight in every serialized sketch. Store only the variant axis; derive the sample axis from getSampleIds(handle) in dimnames(). Also empty sampleIds and nSamples in .emptyGenotypeHandle (reached only via .emptySketch), so a skipped-region sketch is a consistent 0 x 0 instead of 0 x 10000.
The dedup change makes .emptyGenotypeHandle empty the sample axis too, so an emptied sketch is 0 x 0 rather than 0 x nSamples. The test that pinned emptying as keeping the sample columns no longer holds; assert the new contract instead (both axes empty, panel identity preserved).
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.
An LD-sketch
GhSeedstored the panel sample ids twice:genotypeDelayedArraycopiedhandle@sampleIdsintoGhSeed@dn[[2]], read by nothing but thedimnames()method. The sample axis is an anonymous projection dimension (LD is a variant x variant statistic), so the copy is pure overhead.genotypeDelayedArraystores only the variant axis;dimnames(GhSeed)derives the sample axis fromgetSampleIds(handle)on read.handle@sampleIdsbecomes the single copy and every reader is byte-identical..emptyGenotypeHandlenow empties the sample axis too (sampleIds -> character(0),nSamples -> 0L), so an emptied sketch is a consistent0 x 0. It is reached only via.emptySketch(the empty / PIP-skip path), so surviving regions and QTL handles are untouched.Validation (real chr21 ADSP panel + AD_Bellenguez, whole-SoS run, baseline vs fixed): both arms
SOS_EXIT=0; surviving-region fine-mapping is byte-identical (max abs PIP diff0e+00, same 28 loci, identical CS); a PIP-skipped region drops from 75 KB to 1.5 KB (0 x 0, no sample names). New unit tests intest_genotypeHandle.R.