File

src/app/models/bimodal.model.ts

Index

Properties

Constructor

constructor(name: string, group: number, x: number, y: number, fontSize: number, notes: string, organName: string, ontologyId: string, color: string, nodeSize: number, proteinPresence)
Parameters :
Name Type Optional
name string No
group number No
x number No
y number No
fontSize number No
notes string No
organName string No
ontologyId string No
color string No
nodeSize number No
proteinPresence No

Properties

Optional bType
Type : string
color
Type : string
Optional degree
Type : number
fontSize
Type : number
group
Type : number
groupName
Type : string
id
Type : number
Default value : 0
Optional indegree
Type : Set<Degree>
isNew
Type : boolean
Optional label
Type : string
name
Type : string
nodeSize
Type : number
notes
Type : string
ontologyId
Type : string
organName
Type : string
Optional outdegree
Type : Set<Degree>
pathColor
Type : string
problem
Default value : false
proteinPresence
Type : PROTEIN_PRESENCE
Optional references
Type : Reference[]
sources
Type : number[]
targets
Type : number[]
type
Type : string
x
Type : number
y
Type : number
import { PROTEIN_PRESENCE, Reference } from './sheet.model';
import { Degree, NODE_TYPE } from './tree.model';

const groupNameMapper = {
  1: 'Anatomical Structures',
  2: 'Cell Types',
  3: 'Biomarkers',
};

export class BMNode {
  name: string;
  ontologyId: string;
  group: number;
  groupName: string;
  fontSize: number;
  x: number;
  y: number;
  id = 0;
  color: string;
  nodeSize: number;
  targets: number[];
  sources: number[];

  problem = false;
  pathColor: string;
  isNew: boolean;
  type: string;
  degree?: number;
  indegree?: Set<Degree>;
  outdegree?: Set<Degree>;
  label?: string;
  bType?: string;
  proteinPresence: PROTEIN_PRESENCE;
  references?: Reference[];
  notes: string;
  organName: string;

  constructor(
    name: string,
    group: number,
    x: number,
    y: number,
    fontSize: number,
    notes: string,
    organName: string,
    ontologyId = '',
    color = '#E41A1C',
    nodeSize = 300,
    proteinPresence = PROTEIN_PRESENCE.UNKNOWN,
  ) {
    this.name = name;
    this.group = group;
    this.fontSize = fontSize;
    this.x = x;
    this.y = y;
    this.color = color;
    this.nodeSize = nodeSize === 0 ? 50 : nodeSize;
    this.targets = [];
    this.sources = [];
    this.groupName = groupNameMapper[group as keyof typeof groupNameMapper];
    this.ontologyId = ontologyId;
    this.pathColor = '#ccc';
    this.isNew = false;
    this.type = NODE_TYPE.BM;
    this.label = '';
    this.notes = notes;
    this.organName = organName;
    this.proteinPresence = proteinPresence;
  }
}

export interface Link {
  s: number;
  t: number;
}

export interface DD {
  name: string;
}

export interface ASCTD {
  nodes: BMNode[];
  links: Link[];
  compareDD?: DD[];
  searchIds?: number[];
}

export const bimodalSortOptions = ['Alphabetically', 'Degree'];
export const bimodalBSizeOptions = ['None', 'Degree'];
export const bimodalCTSizeOptions = ['None', 'Degree', 'Indegree', 'Outdegree'];
export const bimodalBTypeOptions = ['All', 'Gene', 'Protein', 'Lipids', 'Metabolites', 'Proteoforms'];

export interface BimodalConfig {
  CT: {
    sort: string;
    size: string;
  };
  BM: {
    sort: string;
    size: string;
    type: string;
  };
}

export interface BimodalData {
  nodes: BMNode[];
  links: Link[];
  config: BimodalConfig;
}

results matching ""

    No results matching ""