Skip to content

Commit

Permalink
Split up individual.ts
Browse files Browse the repository at this point in the history
Split up individual.ts
  • Loading branch information
SanjeevLakhwani committed Jan 30, 2025
1 parent a153d6a commit 77e4f11
Show file tree
Hide file tree
Showing 6 changed files with 169 additions and 154 deletions.
2 changes: 1 addition & 1 deletion src/js/features/reference/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { OntologyTerm } from '@/types/ontology';
import type { OntologyTerm } from '@/types/clinphen/ontology';

// See also: https://github.com/bento-platform/bento_reference_service/blob/main/bento_reference_service/models.py

Expand Down
37 changes: 37 additions & 0 deletions src/js/types/clinphen/experiments.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import type { OntologyTerm } from '@/types/clinphen/ontology';
import type { Instrument } from '@/types/clinphen/resources';

type ExperimentResult = {
id: number;
identifier: string;
description: string;
filename: string;
url: string;
genome_assembly_id: string;
file_format: string;
data_output_type: string;
creation_date: string;
created: string;
updated: string;
};

export type Experiment = {
id: string;
experiment_results?: ExperimentResult[];
instrument: Instrument;
biosample_individual: {
id: string;
};
study_type: string;
experiment_type: string;
experiment_ontology: OntologyTerm[];
molecule?: string;
molecule_ontology?: OntologyTerm[];
library_strategy?: string;
library_source?: string;
library_selection?: string;
created: string;
updated: string;
biosample: string;
dataset: string;
};
File renamed without changes.
31 changes: 31 additions & 0 deletions src/js/types/clinphen/phenopackets.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import type { OntologyTerm } from '@/types/clinphen/ontology';
import type {
Biosample,
Disease,
Interpretation,
Measurement,
MedicalAction,
MetaData,
} from '@/types/clinphen/resources';

type PhenotypicFeature = {
type: OntologyTerm;
created: string;
updated: string;
excluded: boolean;
phenopacket: string;
};

export type Phenopacket = {
id: string;
phenotypic_features?: PhenotypicFeature[];
interpretations?: Interpretation[];
diseases?: Disease[];
created: string;
updated: string;
measurements?: Measurement[];
medical_actions?: MedicalAction[];
meta_data: MetaData;
dataset: string;
biosamples?: Biosample[];
};
97 changes: 97 additions & 0 deletions src/js/types/clinphen/resources.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import type { Experiment } from '@/types/clinphen/experiments';
import type { OntologyTerm } from '@/types/clinphen/ontology';

export type Instrument = {
id: number;
identifier: string;
created: string;
updated: string;
};

export type Biosample = {
id: string;
experiments?: Experiment[];
created: string;
updated: string;
sampled_tissue?: {
id: string;
label: string;
};
procedure?: {
code: OntologyTerm;
};
};

export type Diagnosis = {
id: string;
genomic_interpretations: unknown[];
disease: unknown | null;
extra_properties: unknown | null;
};

export type Interpretation = {
id: string;
created: string;
updated: string;
progress_status: string;
summary: string;
diagnosis: Diagnosis;
};

export type Disease = {
id: number;
created: string;
updated: string;
term: OntologyTerm;
excluded: boolean;
};

export type MeasurementValue = {
quantity?: {
unit: OntologyTerm;
value: number;
};
complex_value?: {
typed_quantities: {
type: OntologyTerm;
quantity: {
unit: OntologyTerm;
value: number;
};
}[];
};
};

export type Measurement = {
assay: OntologyTerm;
value?: MeasurementValue;
};

export type Treatment = {
agent: OntologyTerm;
};

export type MedicalAction = {
treatment?: Treatment;
adverse_events?: OntologyTerm[];
treatment_target?: OntologyTerm;
};

export type MetaDataResource = {
id: string;
name: string;
namespace_prefix: string;
url: string;
version: string;
iri_prefix: string;
created: string;
updated: string;
};

export type MetaData = {
resources: MetaDataResource[];
created: string;
updated: string;
created_by: string;
phenopacket_schema_version: string;
};
156 changes: 3 additions & 153 deletions src/js/types/individual.ts
Original file line number Diff line number Diff line change
@@ -1,156 +1,6 @@
import type { OntologyTerm } from './ontology';

type ExperimentResult = {
id: number;
identifier: string;
description: string;
filename: string;
url: string;
genome_assembly_id: string;
file_format: string;
data_output_type: string;
creation_date: string;
created: string;
updated: string;
};

type Instrument = {
id: number;
identifier: string;
created: string;
updated: string;
};

type Experiment = {
id: string;
experiment_results?: ExperimentResult[];
instrument: Instrument;
biosample_individual: {
id: string;
};
study_type: string;
experiment_type: string;
experiment_ontology: OntologyTerm[];
molecule?: string;
molecule_ontology?: OntologyTerm[];
library_strategy?: string;
library_source?: string;
library_selection?: string;
created: string;
updated: string;
biosample: string;
dataset: string;
};

type Biosample = {
id: string;
experiments?: Experiment[];
created: string;
updated: string;
sampled_tissue?: {
id: string;
label: string;
};
procedure?: {
code: OntologyTerm;
};
};

type PhenotypicFeature = {
type: OntologyTerm;
created: string;
updated: string;
excluded: boolean;
phenopacket: string;
};

type Diagnosis = {
id: string;
genomic_interpretations: unknown[];
disease: unknown | null;
extra_properties: unknown | null;
};

type Interpretation = {
id: string;
created: string;
updated: string;
progress_status: string;
summary: string;
diagnosis: Diagnosis;
};

type Disease = {
id: number;
created: string;
updated: string;
term: OntologyTerm;
excluded: boolean;
};

type MeasurementValue = {
quantity?: {
unit: OntologyTerm;
value: number;
};
complex_value?: {
typed_quantities: {
type: OntologyTerm;
quantity: {
unit: OntologyTerm;
value: number;
};
}[];
};
};

type Measurement = {
assay: OntologyTerm;
value?: MeasurementValue;
};

type Treatment = {
agent: OntologyTerm;
};

type MedicalAction = {
treatment?: Treatment;
adverse_events?: OntologyTerm[];
treatment_target?: OntologyTerm;
};

type MetaDataResource = {
id: string;
name: string;
namespace_prefix: string;
url: string;
version: string;
iri_prefix: string;
created: string;
updated: string;
};

type MetaData = {
resources: MetaDataResource[];
created: string;
updated: string;
created_by: string;
phenopacket_schema_version: string;
};

type Phenopacket = {
id: string;
phenotypic_features?: PhenotypicFeature[];
interpretations?: Interpretation[];
diseases?: Disease[];
created: string;
updated: string;
measurements?: Measurement[];
medical_actions?: MedicalAction[];
meta_data: MetaData;
dataset: string;
biosamples?: Biosample[];
};
import type { OntologyTerm } from './clinphen/ontology';
import type { Biosample } from './clinphen/resources';
import type { Phenopacket } from '@/types/clinphen/phenopackets';

export type IndividualRootObject = {
id: string;
Expand Down

0 comments on commit 77e4f11

Please sign in to comment.