Repository navigation
Track merged guides, fix the measured-gene lookup, and carry the annotation tables - #15
Merged
Merged
Conversation
Two library entries of one spacer are one feature in any reference built on the spacer, and their reads land together. This library has 12 such pairs, each a 20-mer and the same spacer with a 5' G added for U6 transcription. They cannot be separated, and not for want of a better reference: the leader ends in a poly-G run, so the extra base is indistinguishable from the leader's own, and splitcode extracts a fixed 20 nt anchored on the scaffold, which both entries yield identically. Cell Ranger keeps all 43,778 features and assigns the 21-mer zero reads in every one of the 12 pairs; its counts for those guides are the 20-mer's alone. So the spacer stays what the reads can resolve, and the table says which guides carry a sum: `oligo` records what was ordered, `n_oligos` how many entries share the spacer. Above one, a guide is not comparable with one ordered once. Both columns travel into guide_metadata.tsv. Measured on the hiPSC-to-EC library: 24 entries flagged over 12 spacers, and 33,164 of 43,778 entries carry an extra 5' base, so oligo differs from spacer for three quarters of the library. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
chr:start-end is what a genome browser takes, and a browser is 1-based, so an element named that way starts one base after the BED row it came from. A pairs table that concatenated the BED's own columns is 0-based, and the exact string match between them found nothing: all 26 validated enhancers of the hiPSC-to-EC library carried no putative_target_genes, silently, until someone asked where the target genes had gone. The lookup now falls back to that one offset. Only that direction: the reverse does not arise from the convention and would risk matching the element next door. On the library, 180 of 340 enhancer guides gain a gene. The other 160 are 14 elements the BED marks e2g_validated but which have no row in the pairs table, so their genes are missing from the source rather than from the join. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
guide.var holds the IGVF columns, and the signed distances, promoter transcripts and other-gene-type overlaps were nowhere in the object. They cannot go in var either: guide_gene_annotation.tsv is one row per guide per site per gene, 45,501 for 43,766 guides, and collapsing it would force a rule on multi-site guides that nothing downstream asked for. So both tables are carried whole in mod['guide'].uns, by --guide-annotation and --element-mapping. Nothing is decided; the rows are there to be joined. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Three things, each its own commit.
oligoandn_oligosTwo library entries of one spacer are one feature in any reference built on
the spacer, and their reads land together. This library has 12 such pairs,
each a 20-mer and the same spacer with a 5' G.
They cannot be separated, and not for want of a better reference. The leader
ends in a poly-G run, so the extra base is indistinguishable from the
leader's own, and splitcode extracts a fixed 20 nt anchored on the scaffold,
which both entries yield identically. Cell Ranger keeps all 43,778 features
and assigns the 21-mer zero reads in all 12 pairs -- its counts for those
guides are the 20-mer's alone, so the extra feature buys nothing.
So
spacerstays what the reads can resolve and the feature count stays43,766.
oligorecords what was ordered,n_oligossays how many entriesshare the spacer, and above one a guide is not comparable with one ordered
once. Both reach
guide_metadata.tsv, and soguide.var.Measured: 24 entries flagged over 12 spacers; 33,164 of 43,778 entries carry
an extra 5' base, so
oligodiffers fromspacerfor three quarters of thelibrary.
The measured-gene lookup
chr:start-endis browser notation and therefore 1-based, while a pairstable built from a BED's own columns is 0-based. The exact string match
between them found nothing, so all 26 validated enhancers carried no
putative_target_genes-- silently.180 of 340 enhancer guides now gain a gene. The remaining 160 are 14 elements
the BED marks
e2g_validatedthat have no row in the pairs table at all.The annotation tables in
guide.unsThe signed distances, promoter transcripts and other-gene-type overlaps were
nowhere in the MuData. They cannot go in
var: the annotation is one row perguide per site per gene, 45,501 for 43,766 guides. Both tables are now
carried whole under
--guide-annotationand--element-mapping, decidingnothing.
730 tests pass.
🤖 Generated with Claude Code