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
Use oncokb biological data without token #3182
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good in general, just a minor comment for one of the computed values
return this.store.oncoKbInfo.result | ||
? this.store.oncoKbInfo.result.publicInstance | ||
: ONCOKB_DEFAULT_INFO_PUBLIC_INSTANCE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it possible here to just do:
return this.store.oncoKbInfo.result | |
? this.store.oncoKbInfo.result.publicInstance | |
: ONCOKB_DEFAULT_INFO_PUBLIC_INSTANCE; | |
return this.store.usingOncoKbPublicInstance; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh good catch. This is must been there before I wrote the method in store
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i feel like it's odd to have something in all caps that is not a string or number constant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I never thought about restricting all caps to string and number constants. We already have similar default values in react-mutation-mapper
though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to airbnb javascript style guideline, it seems okay to have all caps for other types of constants as well: https://github.com/airbnb/javascript/#naming--uppercase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, ONCOKB_DEFAULT_INFO_PUBLIC_INSTANCE
is a boolean variable: https://github.com/cBioPortal/cbioportal-frontend/pull/3182/files#diff-c27e93a0aa919b85e6be54dc7efb1c85R33
Having the name instance
for a boolean variable is a bit confusing here.
0f8e55b
to
9731897
Compare
@@ -14,6 +14,7 @@ export interface IOncoKbTooltipProps { | |||
hugoSymbol: string; | |||
isCancerGene: boolean; | |||
geneNotExist: boolean; | |||
usingPublicInstance: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets keek this usingPublicOncoKBInstance
@zhx828 I'm curious why we have to call the info service to find out whether we're using public instance or now. Code looks fine. I do wonder if this bit of state (using public instance) or not is kind of a global state and could be read directly off the stores (which have reference to the appstore) by components rather than passed down to them though the component heirarchy. The downside of this might be that "leaf" components would need reference to the stores, but perhaps they already have it? If so, then maybe this could be accomplished with less code change. Just an idea. |
@alisman thanks for the suggestion. There are two ways of implementing this as I know.
|
@zhx828 @alisman Having access to a global state info might be a handicap for modularity though. For example, if one day we want to move OncoKB related components into a separate package, importing a dependency from |
@@ -39,6 +40,7 @@ export type AnnotationProps = { | |||
hotspotData?: RemoteData<IHotspotIndex | undefined>; | |||
oncoKbData?: RemoteData<IOncoKbData | Error | undefined>; | |||
oncoKbCancerGenes?: RemoteData<CancerGene[] | Error | undefined>; | |||
usingOncoKbPublicInstance: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we also rename this to usingPublicOncoKbInstance
for consistency?
@@ -8,12 +8,16 @@ import { IndicatorQueryResp } from 'oncokb-ts-api-client'; | |||
import OncoKbSummaryTable from '../oncokb/OncoKbSummaryTable'; | |||
|
|||
type OncoKbTrackTooltipProps = { | |||
usingOncoKbPublicInstance: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one too?
usingOncoKbPublicInstance: boolean; | |
usingPublicOncoKbInstance: boolean; |
@zhx828 not sure i understand @zhx828 @onursumer on issue of global state, understood. sounds like you made the right decision |
@alisman I doubt the status, whether it's a public oncokb instance, will change. But it does not feel right to me when a portal backend state relies on an API and that API call needs to be triggered when the portal is deployed. What if at that time, the endpoint failed, should we manage to refetch the info? @jjgao @alisman @onursumer any thoughts? |
OncoKB no longer requires a token to be used for biological data. But if the clinical data is needed, the user will need to configure the proper token. Change OncoKB Card interface based on whether the oncokb instance is public Disable the levels column in oncokb track if the instance is public Signed-off-by: Hongxin Zhang <hongxin@cbio.mskcc.org>
cdd1859
to
4f9c432
Compare
This is a part of fix for oncokb/oncokb#1975
Here is the tooltip when portal connects to the public instance: