Skip to content
Snippets Groups Projects
Commit 7f605910 authored by AndiMajore's avatar AndiMajore
Browse files

added tissue based tmp normalization

parent 03cb5ebd
No related branches found
No related tags found
No related merge requests found
......@@ -72,11 +72,11 @@
*ngIf="getExpressionScore() != null"
[ngClass]="{ 'text-normal': drugstoneConfig.smallStyle }"
>
<b><span>Expression:</span></b>
<b><span>Median tissue expression (TPM):</span></b>
<span class="is-capitalized"> {{ getExpressionScore() | number }}</span>
<span
class="icon has-text-info"
pTooltip="Tissue expression data is provided by the GTEx project. Unit is transcript per million."
pTooltip="Median expression data is provided by the GTEx project. Unit is TPM (transcript per million)."
[tooltipStyleClass]="'drgstn drgstn-tooltip drgstn-tooltip-left'"
tooltipPosition="left"
>
......
......@@ -426,7 +426,7 @@ export class NetworkComponent implements OnInit {
proteinNodes.push(element);
}
});
this.netex.tissueExpressionGenes(this.selectedTissue, proteinNodes).subscribe((response) => {
this.netex.tissueExpressionGenes(this.selectedTissue, proteinNodes).subscribe(async (response) => {
this.expressionMap = response;
const updatedNodes = [];
this.nodeRenderer = pieChartContextRenderer;
......@@ -443,7 +443,13 @@ export class NetworkComponent implements OnInit {
});
}
});
const maxExpr = Math.max(...Object.values(this.expressionMap));
let maxExpr = 1_000_000;
await this.netex.maxTissueExpression(this.selectedTissue).then(response => {
maxExpr = response.max;
}).catch(err => {
console.error(err);
maxExpr = Math.max(...Object.values(this.expressionMap));
});
const exprMap = {};
for (const [drugstoneId, expressionlvl] of Object.entries(this.expressionMap)) {
networkIdMapping[drugstoneId].forEach(networkId => {
......@@ -501,7 +507,7 @@ export class NetworkComponent implements OnInit {
}
public getGradient(nodeId: string) {
return (Object.keys(this.gradientMap).length && this.gradientMap[nodeId] != null) ? this.gradientMap[nodeId] : 1.0;
return (Object.keys(this.gradientMap).length && this.gradientMap[nodeId] != null) ? this.gradientMap[nodeId] : 1.0;
}
/**
......@@ -542,7 +548,7 @@ export class NetworkComponent implements OnInit {
this.nodeRenderer
)
),
updatedNodes.push(node);
updatedNodes.push(node);
}
this.nodeData.nodes.update(updatedNodes);
this.loadingScreen.stateUpdate(false);
......
......@@ -47,6 +47,13 @@ export class NetexControllerService {
return this.http.post('https://api.digest-validation.net/set', payload).toPromise();
}
public maxTissueExpression(tissue: Tissue): Promise<any> {
const params = new HttpParams()
.set('tissue', tissue.drugstoneId);
return this.http.get(environment.backend + 'tissue_max_expression/', {params}).toPromise();
}
public tissueExpressionGenes(tissue: Tissue, nodes: Node[]): Observable<any> {
/**
* Returns the expression in the given tissue for given nodes and cancerNodes
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment