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

added tissue based tmp normalization

parent 03cb5ebd
Branches
Tags
No related merge requests found
...@@ -72,11 +72,11 @@ ...@@ -72,11 +72,11 @@
*ngIf="getExpressionScore() != null" *ngIf="getExpressionScore() != null"
[ngClass]="{ 'text-normal': drugstoneConfig.smallStyle }" [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="is-capitalized"> {{ getExpressionScore() | number }}</span>
<span <span
class="icon has-text-info" 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'" [tooltipStyleClass]="'drgstn drgstn-tooltip drgstn-tooltip-left'"
tooltipPosition="left" tooltipPosition="left"
> >
......
...@@ -426,7 +426,7 @@ export class NetworkComponent implements OnInit { ...@@ -426,7 +426,7 @@ export class NetworkComponent implements OnInit {
proteinNodes.push(element); proteinNodes.push(element);
} }
}); });
this.netex.tissueExpressionGenes(this.selectedTissue, proteinNodes).subscribe((response) => { this.netex.tissueExpressionGenes(this.selectedTissue, proteinNodes).subscribe(async (response) => {
this.expressionMap = response; this.expressionMap = response;
const updatedNodes = []; const updatedNodes = [];
this.nodeRenderer = pieChartContextRenderer; this.nodeRenderer = pieChartContextRenderer;
...@@ -443,7 +443,13 @@ export class NetworkComponent implements OnInit { ...@@ -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 = {}; const exprMap = {};
for (const [drugstoneId, expressionlvl] of Object.entries(this.expressionMap)) { for (const [drugstoneId, expressionlvl] of Object.entries(this.expressionMap)) {
networkIdMapping[drugstoneId].forEach(networkId => { networkIdMapping[drugstoneId].forEach(networkId => {
......
...@@ -47,6 +47,13 @@ export class NetexControllerService { ...@@ -47,6 +47,13 @@ export class NetexControllerService {
return this.http.post('https://api.digest-validation.net/set', payload).toPromise(); 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> { public tissueExpressionGenes(tissue: Tissue, nodes: Node[]): Observable<any> {
/** /**
* Returns the expression in the given tissue for given nodes and cancerNodes * 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.
Please register or to comment