Skip to content

Conversation

@alisman
Copy link
Collaborator

@alisman alisman commented Nov 18, 2025

@alisman alisman added the bug label Nov 18, 2025
@alisman alisman requested a review from onursumer November 18, 2025 22:15
@alisman alisman marked this pull request as ready for review November 18, 2025 22:15
Copy link
Member

@onursumer onursumer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just added a couple of minor suggestions

Comment on lines +614 to +619
const alteredKeys = data.trackData!.reduce((acc, next) => {
if (isAltered(next)) {
acc.add(next.uid);
}
return acc;
}, new Set<string>());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor thing but I find it more readable when we do filter and map instead of reduce.

Suggested change
const alteredKeys = data.trackData!.reduce((acc, next) => {
if (isAltered(next)) {
acc.add(next.uid);
}
return acc;
}, new Set<string>());
const alteredKeys = new Set<string>(data.trackData!.filter(isAltered).map(d => d.uid));

Comment on lines +647 to +657
const alteredEntities = sampleMode
? _(data.cases.samples)
.entries()
.filter(e => !!e[1].length)
.map(e => e[0])
.value()
: _(data.cases.patients)
.entries()
.filter(e => !!e[1].length)
.map(e => e[0])
.value();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This way we would avoid the duplicate .entries().filter(...).map(...).value() part

Suggested change
const alteredEntities = sampleMode
? _(data.cases.samples)
.entries()
.filter(e => !!e[1].length)
.map(e => e[0])
.value()
: _(data.cases.patients)
.entries()
.filter(e => !!e[1].length)
.map(e => e[0])
.value();
const alteredEntities = _(sampleMode ? data.cases.samples : data.cases.patients)
.entries()
.filter(e => !!e[1].length)
.map(e => e[0])
.value()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Oncoprint shows 200% frequency

2 participants