Skip to content

Commit

Permalink
enabled searching for Germline in the protein change column (fix cBio…
Browse files Browse the repository at this point in the history
…Portal/cbioportal#4180)

Signed-off-by: Onur Sumer <s.onur.sumer@gmail.com>
  • Loading branch information
onursumer committed May 11, 2018
1 parent 8826743 commit c9e5c82
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/shared/components/mutationTable/MutationTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,7 @@ export default class MutationTable<P extends IMutationTableProps> extends React.
render: ProteinChangeColumnFormatter.renderWithMutationStatus,
download: ProteinChangeColumnFormatter.getTextValue,
sortBy:(d:Mutation[])=>ProteinChangeColumnFormatter.getSortValue(d),
filter: (d:Mutation[], filterString:string, filterStringUpper:string) =>
ProteinChangeColumnFormatter.getTextValue(d).toUpperCase().indexOf(filterStringUpper) > -1
filter: ProteinChangeColumnFormatter.getFilterValue
};

this._columns[MutationTableColumnType.MUTATION_TYPE] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,19 @@ export default class ProteinChangeColumnFormatter
return textValue;
}

public static getFilterValue(data:Mutation[], filterString:string, filterStringUpper:string): boolean
{
let filterValue = ProteinChangeColumnFormatter.getDisplayValue(data);
const mutationStatus:string|null = MutationStatusColumnFormatter.getData(data);

if (mutationStatus && mutationStatus.toLowerCase().includes("germline")) {
filterValue = `${filterValue}${mutationStatus}`;
}

return filterValue.toUpperCase().indexOf(filterStringUpper) > -1;
}


public static getDisplayValue(data:Mutation[]):string
{
// same as text value
Expand Down

0 comments on commit c9e5c82

Please sign in to comment.