PhenoTips » Developer Guide » Pedigree Editor: JSON Import/Export

Pedigree Editor: JSON Import/Export

This documentation page is still a draft.

The pedigree editor can import and export from/to the following "simple" JSON format (which is different from the "complete" JSON format used internally. 

A pedigree in "simple JSON" format is represented by a (JSON) array of (JSON) objects, each object representing one person.


    { "name": "f11", "sex": "female", "lifeStatus": "deceased" },
    { "name": "m11", "sex": "male" },
    { "name": "f12", "sex": "female", "disorders": [603235, "custom disorder"] },
    { "name": "m12", "sex": "male" },
    { "name": "m21", "sex": "male", "mother": "f11", "father": "m11" },
    { "name": "f21", "sex": "female", "mother": "f12", "father": "m12" },
    { "name": "ch1", "sex": "female", "mother": "f21", "father": "m21", "disorders": [603235], "proband": true }

The connections between persons are established by mother and father properties, which should point to a valid other person in the pedigree. The value of the mother and father links is matched with the following properties of other persons, in this order: id, externalId, name, firstName.

Both mother and father properties are optional, but all nodes in a pedigree should be connected by some path (e.g. f11 and f12 are connected by the f11 -> m21 -> ch1 -> f21 -> f12 path), so in a pedigree with more than one person at least some nodes should have some mother and/or father links. When one of the links is present and the other one is missing, the missing parent will be represented by a blank placeholder person on import.


Each node should have at least one of: id, externalId, name, firstName defined. All other properties are optional.
string or number (default: none). If two nodes with the same ID are found an error is reported. If present, this id is used only for the purpose of linking nodes to each other and is not recorded in the imported pedigree. Use "externalId" if an ID should be stored
boolean (default: true for the first object, false for all other objects. If a person is explicitly indicated as a proband, the first object also defaults to false. If more than one node is indicated as a proband only the first one is considered ot be one) 
name or firstName
string (default: none). If both are defined firstName is used as first name and name is used for mother/father link checks only.
string (default: none)
string (default: none)
string (default: none)
string (default: none)
one of male or m, female or f, unknown or u (default: unknown)
integer. All children of the same parents with the same twin group are considered twins. (default: none)
boolean. (only applicable for twins)
boolean (default: false)
boolean (default: false)
an object with the following fields: decade, year, month, day e.g.: {"decade":"2010s","year":2014,"month":5,"day":9}(default: none)
same as birthDate
string (default: none) pedigree node number as of last renumbering
boolean (default: false) false if proband lost contact with the given individual
integer. When present and not 0 this individual is treated as a person group
one of alive, deceased, aborted, miscarriage, stillborn, unborn (default: alive. If death date is given status defaults to deceased and overwrites the explicitly given status if it were alive)
array of strings, e.g. ["Cantonese","European"]. (default: none)
array of strings or integers (a string representing an integer is considered to be an integer), integers treated as OMIM IDs, string as custom disorder names. (default: none)
array of strings, which are either treated as HPO ids (if parse correctly) or custom terms, e.g. hpoTerms:["HP:0012743","HP:0000593","HP:0000769"]. (default: none)
array of strings (treated as gene names, e.g. ["BRCA3","BRCA","PABPC3"]). (default: none)
object with each cancer as a separate property, e.g. "cancers":{"Breast":{"affected":true},"Melanoma":{"affected":true,"ageAtDiagnosis":"1"},"Lung": {"affected":true,"ageAtDiagnosis":"45","notes":"Lung cancer related  notes"}}. (default: none)
one of <blank>, carrier, affected, presymptomatic, uncertain. If a disorder is given, default is affected, otherwise default is <blank>.