Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make clicking on introns in gene glyph select the mRNA #460

Merged
merged 4 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
if (!position) {
return
}
const { layoutIndex, layoutRow } = position
const { featureRow, layoutIndex, layoutRow } = position

Check warning on line 178 in packages/jbrowse-plugin-apollo/src/LinearApolloDisplay/glyphs/BoxGlyph.ts

View check run for this annotation

Codecov / codecov/patch

packages/jbrowse-plugin-apollo/src/LinearApolloDisplay/glyphs/BoxGlyph.ts#L178

Added line #L178 was not covered by tests
const { bpPerPx, displayedRegions, offsetPx } = lgv
const displayedRegion = displayedRegions[layoutIndex]
const { refName, reversed } = displayedRegion
Expand All @@ -191,7 +191,7 @@
coord: reversed ? max : min,
regionNumber: layoutIndex,
})?.offsetPx ?? 0) - offsetPx
const top = layoutRow * apolloRowHeight
const top = (layoutRow + featureRow) * apolloRowHeight

Check warning on line 194 in packages/jbrowse-plugin-apollo/src/LinearApolloDisplay/glyphs/BoxGlyph.ts

View check run for this annotation

Codecov / codecov/patch

packages/jbrowse-plugin-apollo/src/LinearApolloDisplay/glyphs/BoxGlyph.ts#L194

Added line #L194 was not covered by tests
const widthPx = length / bpPerPx

const featureType = `Type: ${feature.type}`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,32 @@
): AnnotationFeature | undefined {
const featureInThisRow: AnnotationFeature[] = featuresForRow(feature)[row]
for (const f of featureInThisRow) {
let featureObj
if (bp >= f.min && bp <= f.max && f.parent) {
return f
featureObj = f

Check warning on line 296 in packages/jbrowse-plugin-apollo/src/LinearApolloDisplay/glyphs/GeneGlyph.ts

View check run for this annotation

Codecov / codecov/patch

packages/jbrowse-plugin-apollo/src/LinearApolloDisplay/glyphs/GeneGlyph.ts#L296

Added line #L296 was not covered by tests
}
if (!featureObj) {
continue

Check warning on line 299 in packages/jbrowse-plugin-apollo/src/LinearApolloDisplay/glyphs/GeneGlyph.ts

View check run for this annotation

Codecov / codecov/patch

packages/jbrowse-plugin-apollo/src/LinearApolloDisplay/glyphs/GeneGlyph.ts#L299

Added line #L299 was not covered by tests
}
if (
featureObj.type === 'CDS' &&
featureObj.parent &&
featureObj.parent.type === 'mRNA'

Check warning on line 304 in packages/jbrowse-plugin-apollo/src/LinearApolloDisplay/glyphs/GeneGlyph.ts

View check run for this annotation

Codecov / codecov/patch

packages/jbrowse-plugin-apollo/src/LinearApolloDisplay/glyphs/GeneGlyph.ts#L303-L304

Added lines #L303 - L304 were not covered by tests
) {
const { cdsLocations } = featureObj.parent
for (const cdsLoc of cdsLocations) {
for (const loc of cdsLoc) {

Check warning on line 308 in packages/jbrowse-plugin-apollo/src/LinearApolloDisplay/glyphs/GeneGlyph.ts

View check run for this annotation

Codecov / codecov/patch

packages/jbrowse-plugin-apollo/src/LinearApolloDisplay/glyphs/GeneGlyph.ts#L306-L308

Added lines #L306 - L308 were not covered by tests
if (bp >= loc.min && bp <= loc.max) {
return featureObj

Check warning on line 310 in packages/jbrowse-plugin-apollo/src/LinearApolloDisplay/glyphs/GeneGlyph.ts

View check run for this annotation

Codecov / codecov/patch

packages/jbrowse-plugin-apollo/src/LinearApolloDisplay/glyphs/GeneGlyph.ts#L310

Added line #L310 was not covered by tests
}
}
}

// If mouse position is in the intron region, return the mRNA
return featureObj.parent

Check warning on line 316 in packages/jbrowse-plugin-apollo/src/LinearApolloDisplay/glyphs/GeneGlyph.ts

View check run for this annotation

Codecov / codecov/patch

packages/jbrowse-plugin-apollo/src/LinearApolloDisplay/glyphs/GeneGlyph.ts#L316

Added line #L316 was not covered by tests
}
// If mouse position is in a feature that is not a CDS, return the feature
return featureObj

Check warning on line 319 in packages/jbrowse-plugin-apollo/src/LinearApolloDisplay/glyphs/GeneGlyph.ts

View check run for this annotation

Codecov / codecov/patch

packages/jbrowse-plugin-apollo/src/LinearApolloDisplay/glyphs/GeneGlyph.ts#L319

Added line #L319 was not covered by tests
}
return feature
}
Expand Down