Skip to content
Snippets Groups Projects
Commit 33deb84b authored by Ibrahim Roshan Kunnakkattu's avatar Ibrahim Roshan Kunnakkattu
Browse files

added interaction type model

parent e32961ec
No related branches found
No related tags found
1 merge request!5Refactored code for diplaying aggregated ligand interactions
......@@ -28,6 +28,16 @@ namespace Model {
Internal
}
export interface interactionTypeData {
atom: string;
residue: string;
count: number;
}
export interface aggregatedInteractionData{
[key: string]: interactionTypeData[]
}
export class InteractionTypeUtil {
public static parse(value: string) {
if (value === 'atom_atom') return InteractionType.AtomAtom;
......@@ -499,7 +509,7 @@ namespace Model {
}
export class LigandIntx{
data: any;
data: aggregatedInteractionData;
contactTypes: string[];
filteredData: any;
......@@ -510,26 +520,18 @@ namespace Model {
}
private getAtomResidueObj(x: string[]){
return {
"atom": x[0],
"AA": x[1],
"count": x[2]
}
}
private getFilteredData(){
const filteredData = new Array();
const dataContactTypes = Object.keys(this.data);
if(this.contactTypes.includes('TOTAL')){
for (const contactType of dataContactTypes){
filteredData.push(...this.data[contactType].map(this.getAtomResidueObj));
filteredData.push(...this.data[contactType]);
}
}
else{
for (const contactType of this.contactTypes){
if (dataContactTypes.includes(contactType)){
filteredData.push(...this.data[contactType].map(this.getAtomResidueObj));
filteredData.push(...this.data[contactType]);
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment