Skip to content

Commit

Permalink
Merge branch 'cBioPortal:master' into pairwise_plots
Browse files Browse the repository at this point in the history
  • Loading branch information
sowmiyaa-kumar authored Nov 12, 2024
2 parents be5cf3b + 72b9b09 commit c194966
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 64 deletions.
27 changes: 21 additions & 6 deletions .github/workflows/jitpack-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,29 @@ jobs:

- name: Get release tag
id: get_tag
run: echo "::set-output name=tag::${GITHUB_REF#refs/tags/}"
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Trigger JitPack Build
run: |
TAG=${{ steps.get_tag.outputs.tag }}
JITPACK_BUILD_URL="https://jitpack.io/com/github/cbioportal/cbioportal-frontend/$TAG/build.log"
echo "Triggering JitPack build for $TAG"
curl -I $JITPACK_BUILD_URL
- name: Notify success
run: echo "JitPack build triggered successfully."
MAX_RETRIES=10
RETRY_DELAY=30
COUNTER=0
while [ $COUNTER -lt $MAX_RETRIES ]; do
HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X POST "$JITPACK_BUILD_URL")
if [ "$HTTP_STATUS" -eq 200 ]; then
echo "Build triggered successfully for version ${TAG}."
exit 0
else
echo "Attempt $((COUNTER+1)) failed with status $HTTP_STATUS: Tag not found yet. Retrying in $RETRY_DELAY seconds..."
((COUNTER++))
sleep $RETRY_DELAY
fi
done
echo "Failed to trigger JitPack build after $MAX_RETRIES attempts."
exit 1
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cbioportal-frontend",
"private": true,
"version": "3.3.288",
"version": "3.3.289",
"workspaces": {
"packages": [
".",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-variant-view/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-variant-view",
"version": "0.3.117",
"version": "0.3.118",
"description": "cBioPortal Variant Viewer",
"main": "dist/index.js",
"module": "dist/index.es.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,21 @@ interface IFunctionalImpactData {
@observer
class FunctionalPrediction extends React.Component<IFunctionalPredictionProps> {
public getData(
genomeNexusData: VariantAnnotation | undefined
genomeNexusData: VariantAnnotation | undefined,
selectedTranscriptId?: string
): IFunctionalImpactData {
const mutationAssessor = genomeNexusData?.mutation_assessor;
const siftScore =
genomeNexusData &&
genomeNexusData.transcript_consequences &&
genomeNexusData.transcript_consequences[0].sift_score;
const siftPrediction =
genomeNexusData &&
genomeNexusData.transcript_consequences &&
genomeNexusData.transcript_consequences[0].sift_prediction;
const polyPhenScore =
genomeNexusData &&
genomeNexusData.transcript_consequences &&
genomeNexusData.transcript_consequences[0].polyphen_score;
const polyPhenPrediction =
genomeNexusData &&
genomeNexusData.transcript_consequences &&
genomeNexusData.transcript_consequences[0].polyphen_prediction;
const transcriptConsequence =
genomeNexusData && selectedTranscriptId
? genomeNexusData.transcript_consequences.find(
tc => tc.transcript_id === selectedTranscriptId
)
: undefined;

const siftScore = transcriptConsequence?.sift_score;
const siftPrediction = transcriptConsequence?.sift_prediction;
const polyPhenScore = transcriptConsequence?.polyphen_score;
const polyPhenPrediction = transcriptConsequence?.polyphen_prediction;

return {
mutationAssessor,
Expand Down
17 changes: 10 additions & 7 deletions src/pages/studyView/resources/FilesAndLinks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,19 @@ class FilesLinksTableComponent extends LazyMobXTable<{
const RECORD_LIMIT = 500;

function getResourceDataOfEntireStudy(studyIds: string[]) {
// Only handle the first studyId for now. Can be expanded to make a call per
// studyId.
const studyId = studyIds[0];
const allResources = internalClient.getAllStudyResourceDataInStudyPatientSampleUsingGET(
{
// Fetch resource data for each studyId, then return combined results
const allResources = studyIds.map(studyId =>
internalClient.getAllStudyResourceDataInStudyPatientSampleUsingGET({
studyId: studyId,
projection: 'DETAILED',
}
})
);

return Promise.all(allResources).then(allResources =>
_(allResources)
.flatMap()
.value()
);
return allResources;
}

function getResourceDataOfPatients(studyClinicalData: {
Expand Down
6 changes: 4 additions & 2 deletions src/shared/components/mutationTable/MutationTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,8 @@ export default class MutationTable<
return FunctionalImpactColumnFormatter.renderFunction(
d,
this.props.genomeNexusCache,
this.props.genomeNexusMutationAssessorCache
this.props.genomeNexusMutationAssessorCache,
this.props.selectedTranscriptId
);
} else {
return <span></span>;
Expand All @@ -917,7 +918,8 @@ export default class MutationTable<
d,
this.props.genomeNexusCache as GenomeNexusCache,
this.props
.genomeNexusMutationAssessorCache as GenomeNexusMutationAssessorCache
.genomeNexusMutationAssessorCache as GenomeNexusMutationAssessorCache,
this.props.selectedTranscriptId
),
headerRender: FunctionalImpactColumnFormatter.headerRender,
visible: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,8 @@ export default class FunctionalImpactColumnFormatter {
public static getData(
data: Mutation[],
siftPolyphenCache: GenomeNexusCache,
mutationAssessorCache: GenomeNexusMutationAssessorCache
mutationAssessorCache: GenomeNexusMutationAssessorCache,
selectedTranscriptId?: string
): FunctionalImpactData {
const siftPolyphenCacheData = FunctionalImpactColumnFormatter.getDataFromCache(
data,
Expand All @@ -471,10 +472,13 @@ export default class FunctionalImpactColumnFormatter {
: null;

const siftData = siftPolyphenCacheData
? this.getSiftData(siftPolyphenCacheData.data)
? this.getSiftData(siftPolyphenCacheData.data, selectedTranscriptId)
: undefined;
const polyphenData = siftPolyphenCacheData
? this.getPolyphenData(siftPolyphenCacheData.data)
? this.getPolyphenData(
siftPolyphenCacheData.data,
selectedTranscriptId
)
: undefined;
const mutationAssessor = mutationAssessorCacheData
? this.getMutationAssessorData(mutationAssessorCacheData.data)
Expand All @@ -496,17 +500,21 @@ export default class FunctionalImpactColumnFormatter {
return functionalImpactData;
}

public static getSiftData(siftDataCache: VariantAnnotation | null) {
public static getSiftData(
siftDataCache: VariantAnnotation | null,
selectedTranscriptId?: string
) {
let siftScore: number | undefined = undefined;
let siftPrediction: string | undefined = undefined;

if (
siftDataCache &&
!_.isEmpty(siftDataCache.transcript_consequences)
) {
siftScore = siftDataCache.transcript_consequences[0].sift_score;
siftPrediction =
siftDataCache.transcript_consequences[0].sift_prediction;
if (siftDataCache && selectedTranscriptId) {
// find transcript consequence that matches the selected transcript
const transcriptConsequence = siftDataCache.transcript_consequences.find(
tc => tc.transcript_id === selectedTranscriptId
);
if (transcriptConsequence) {
siftScore = transcriptConsequence.sift_score;
siftPrediction = transcriptConsequence.sift_prediction;
}
}

return {
Expand All @@ -515,19 +523,22 @@ export default class FunctionalImpactColumnFormatter {
};
}

public static getPolyphenData(polyphenDataCache: VariantAnnotation | null) {
public static getPolyphenData(
polyphenDataCache: VariantAnnotation | null,
selectedTranscriptId?: string
) {
let polyPhenScore: number | undefined = undefined;
let polyPhenPrediction: string | undefined = undefined;

if (
polyphenDataCache &&
!_.isEmpty(polyphenDataCache.transcript_consequences)
) {
polyPhenScore =
polyphenDataCache.transcript_consequences[0].polyphen_score;
polyPhenPrediction =
polyphenDataCache.transcript_consequences[0]
.polyphen_prediction;
if (polyphenDataCache && selectedTranscriptId) {
// find transcript consequence that matches the selected transcript
const transcriptConsequence = polyphenDataCache.transcript_consequences.find(
tc => tc.transcript_id === selectedTranscriptId
);
if (transcriptConsequence) {
polyPhenScore = transcriptConsequence.polyphen_score;
polyPhenPrediction = transcriptConsequence.polyphen_prediction;
}
}

return {
Expand All @@ -545,7 +556,8 @@ export default class FunctionalImpactColumnFormatter {
public static renderFunction(
data: Mutation[],
siftPolyphenCache: GenomeNexusCache | undefined,
mutationAssessorCache: GenomeNexusMutationAssessorCache | undefined
mutationAssessorCache: GenomeNexusMutationAssessorCache | undefined,
selectedTranscriptId?: string
) {
const showMutationAssessor = shouldShowMutationAssessor();

Expand All @@ -568,11 +580,13 @@ export default class FunctionalImpactColumnFormatter {
)}
{FunctionalImpactColumnFormatter.makeFunctionalImpactViz(
siftPolyphenCacheData,
FunctionalImpactColumnsName.SIFT
FunctionalImpactColumnsName.SIFT,
selectedTranscriptId
)}
{FunctionalImpactColumnFormatter.makeFunctionalImpactViz(
siftPolyphenCacheData,
FunctionalImpactColumnsName.POLYPHEN2
FunctionalImpactColumnsName.POLYPHEN2,
selectedTranscriptId
)}
</div>
);
Expand All @@ -581,13 +595,15 @@ export default class FunctionalImpactColumnFormatter {
public static download(
data: Mutation[],
siftPolyphenCache: GenomeNexusCache,
mutationAssessorCache: GenomeNexusMutationAssessorCache
mutationAssessorCache: GenomeNexusMutationAssessorCache,
selectedTranscriptId?: string
): string {
if (siftPolyphenCache || mutationAssessorCache) {
const functionalImpactData = FunctionalImpactColumnFormatter.getData(
data,
siftPolyphenCache,
mutationAssessorCache
mutationAssessorCache,
selectedTranscriptId
);
let downloadData = [];
if (functionalImpactData) {
Expand Down Expand Up @@ -626,7 +642,8 @@ export default class FunctionalImpactColumnFormatter {

private static makeFunctionalImpactViz(
cacheData: GenomeNexusCacheDataType | null,
column: FunctionalImpactColumnsName
column: FunctionalImpactColumnsName,
selectedTranscriptId?: string
) {
let status: TableCellStatus | null = null;

Expand All @@ -650,7 +667,8 @@ export default class FunctionalImpactColumnFormatter {
);
case FunctionalImpactColumnsName.SIFT:
functionalImpactData = FunctionalImpactColumnFormatter.getSiftData(
cacheData.data
cacheData.data,
selectedTranscriptId
);
return (
<Sift
Expand All @@ -660,7 +678,8 @@ export default class FunctionalImpactColumnFormatter {
);
case FunctionalImpactColumnsName.POLYPHEN2:
functionalImpactData = FunctionalImpactColumnFormatter.getPolyphenData(
cacheData.data
cacheData.data,
selectedTranscriptId
);
return (
<PolyPhen2
Expand Down

0 comments on commit c194966

Please sign in to comment.