Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import {Component, computed, input} from '@angular/core';
import {ReferenceEntity} from "../../../model/graph/reference-entity/reference-entity.model";
import {EntityService} from "../../../services/entity.service";
import {isArray, isString} from "lodash";
import {NgClass, TitleCasePipe} from "@angular/common";
import {StructureViewerComponent} from "../../tabs/molecule-tab/structure-viewer/structure-viewer.component";
import {DatabaseIdentifier} from "../../../model/graph/database-identifier.model";
import {MatIconButton} from "@angular/material/button";
import {MatIcon} from "@angular/material/icon";
import {UrlStateService} from "../../../services/url-state.service";
import {MatTooltip} from "@angular/material/tooltip";
import {DataStateService} from "../../../services/data-state.service";
import {Labels} from "../../../constants/constants";
import {StructureService} from "../../../services/structure.service";
import {MoleculeType} from "../../tabs/molecule-tab/molecule-tab.component";
import { Component, computed, input } from '@angular/core';
import { ReferenceEntity } from '../../../model/graph/reference-entity/reference-entity.model';
import { EntityService } from '../../../services/entity.service';
import { isArray, isString } from 'lodash';
import { NgClass, TitleCasePipe } from '@angular/common';
import { StructureViewerComponent } from '../../tabs/molecule-tab/structure-viewer/structure-viewer.component';
import { DatabaseIdentifier } from '../../../model/graph/database-identifier.model';
import { MatIconButton } from '@angular/material/button';
import { MatIcon } from '@angular/material/icon';
import { UrlStateService } from '../../../services/url-state.service';
import { MatTooltip } from '@angular/material/tooltip';
import { DataStateService } from '../../../services/data-state.service';
import { Labels } from '../../../constants/constants';
import { StructureService } from '../../../services/structure.service';
import { MoleculeType } from '../../tabs/molecule-tab/molecule-tab.component';

@Component({
selector: 'cr-external-reference',
Expand All @@ -25,11 +25,10 @@ import {MoleculeType} from "../../tabs/molecule-tab/molecule-tab.component";
MatIconButton,
MatTooltip,
NgClass,
StructureViewerComponent
]
StructureViewerComponent,
],
})
export class ExternalReferenceComponent {

readonly referenceEntity = input.required<ReferenceEntity>();
readonly xRefs = input<DatabaseIdentifier[]>([]);

Expand All @@ -42,22 +41,28 @@ export class ExternalReferenceComponent {
moleculeType = computed(() => {
const entity = this.referenceEntity();
return entity ? entity.moleculeType : null;
})

hasStructure = computed(() => this.moleculeType() === MoleculeType.PROTEIN || this.moleculeType() === MoleculeType.CHEMICAL);
});

hasStructure = computed(() =>
[
MoleculeType.CHEMICAL,
MoleculeType.CHEMICAL_DRUG,
MoleculeType.PROTEIN,
].includes(this.moleculeType() as MoleculeType)
);

constructor(private entity: EntityService,
private state: UrlStateService,
public data: DataStateService,
private structure: StructureService) {
}
constructor(
private entity: EntityService,
private state: UrlStateService,
public data: DataStateService,
private structure: StructureService
) {}

protected readonly isString = isString;
protected readonly isArray = isArray;

onSelect() {
this.state.select.set(this.referenceEntity().stId!)
this.state.select.set(this.referenceEntity().stId!);
}

protected readonly Labels = Labels;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h3> 📋 Reactome Knowledgebase Details </h3>
<p>Loading details of {{ state.select() || state.pathwayId() }}</p>
</div>
} @else if (obj()) {
<cr-description-tab [obj]="obj()!" [analysisResult]="analysis.result()"></cr-description-tab>
<cr-description-tab [obj]="obj()!" [analysisResult]="analysis.result()" [showReactionDiagram]="false"></cr-description-tab>
}
</ng-template>
</mat-tab>
Expand Down
Loading
Loading