Skip to content

Commit

Permalink
Move from panogram to open-pedigree
Browse files Browse the repository at this point in the history
  • Loading branch information
dconlan committed Dec 13, 2019
1 parent ca1b38d commit f80b274
Show file tree
Hide file tree
Showing 1,192 changed files with 19,357 additions and 38,722 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.buildpath
.idea
.project
.settings
7 changes: 3 additions & 4 deletions PedigreeEditorExternalModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ function redcap_data_entry_form ($project_id, $record, $instrument, $event_id, $

// At one stage these things were going to be in the settings for the editor
// maybe in the future they will be exposed.
$hpoEditorPage = 'panogram/localEditor.html?mode=HPO';
$sctEditorPage = 'panogram/localEditor.html?mode=SCT';
$hpoEditorPage = 'open-pedigree/localEditor.html?mode=HPO';
$sctEditorPage = 'open-pedigree/localEditor.html?mode=SCT';
$editorPageLocal = TRUE;
$hpoTag = '@PEDIGREE_HPO';
$sctTag = '@PEDIGREE_SCT';
Expand Down Expand Up @@ -134,8 +134,7 @@ function redcap_data_entry_form ($project_id, $record, $instrument, $event_id, $
}
else {
$transportOptions = <<<EOD
pedigreeEditorEM.panogramDataKey = 'PANOGRAM_DIAGRAM_DATA';
pedigreeEditorEM.probandDataKey = 'PANOGRAM_PROBAND_DATA';
pedigreeEditorEM.openPedigreeDataKey = 'pedigreeData';
EOD;
}

Expand Down
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,26 @@ In the data entry page, fields marked with the pedigree editor action tag will s

![Data Entry (with data)](documentation/data_entry_2.png)

# Limitations

This module uses a FHIR based representation of the pedigree diagram. Unfortunately the specification is still being
developed, so it is still not possible to map all of the data captured by the pedigree editor. This means that any
data with no mapping will be lost. Some other aspects of the mapping also do not translate directly, where possible
naming conventions are used to try and account for these. For example the FHIR FamilyHistory resource has a single
name field which is a string. The pedigree editor has a first name, last name and a last name at birth, this will
be written into the FamilyHistory resource as <first name> <last name> (<last name at birth>). When importing the FHIR
resource everything but the last word is the first name a trailing '(name)' will be taken as last name at birth.

Heredity options - This can be 'Childless' or 'Infertile' in the editor, but is not currently stored on the fhir resource.
Carrier Status - This can be 'Carrier' or 'Pre-symptomatic' in the editor, but is not currently stored on the fhir resource.
Evaluated - This is a checkbox in the editor, but is not currently stored on the fhir resource.
Lost Contact - This is a checkbox in the editor, but is not currently stored on the fhir resource.
Multiple Sibling Nodes - In the editor you can create a single node to represent multiple siblings, at the moment these
will be saved as a single familiy history resource with no name and the number of siblings will be lost.

Phenotype and Candidate Genes are both stored as Observation Resources associated with a family history resource. The
system uses a naming convention to distinguish the two, otherwise it tries to match the code system to try and determine
if the observation represents a Phenotype or Candidate gene.

Life status - This can be 'unborn', 'stillborn' and 'aborted' with an associated gestation age. This will be written into
the deceasedString field on the family history resource in a form like 'stillborn 34 weeks'.
26 changes: 13 additions & 13 deletions js/pedigreeEditorEM.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ pedigreeEditorEM.save = function(field, value) {

pedigreeEditorEM.sendDataToEditor = function(data){
if (pedigreeEditorEM.transportType == 'local'){
window.localStorage.setItem(pedigreeEditorEM.probandStorageKey, '');
window.localStorage.setItem(pedigreeEditorEM.panogramDataKey, JSON.stringify(data));
// window.localStorage.setItem(pedigreeEditorEM.probandStorageKey, '');
window.localStorage.setItem(pedigreeEditorEM.openPedigreeDataKey, JSON.stringify(data));
}
else {
// doesn't get sent until get the ready signal
Expand All @@ -148,13 +148,13 @@ pedigreeEditorEM.sendDataToEditor = function(data){
pedigreeEditorEM.clearDataToEditor = function(){
pedigreeEditorEM.log("Clearing transport data");
if (pedigreeEditorEM.transportType == 'local'){
window.localStorage.setItem(pedigreeEditorEM.probandStorageKey, null);
window.localStorage.setItem(pedigreeEditorEM.panogramDataKey, null);
// window.localStorage.setItem(pedigreeEditorEM.probandStorageKey, null);
window.localStorage.setItem(pedigreeEditorEM.openPedigreeDataKey, null);
}
else {
if (pedigreeEditorEM.editorWindow) {
pedigreeEditorEM.editorWindow.postMessage({"messageType" : "panogram","panogramData" : null}, pedigreeEditorEM.editorPageOrigin);
pedigreeEditorEM.editorWindow.postMessage({"messageType" : "proband","probandData" : null}, pedigreeEditorEM.editorPageOrigin);
pedigreeEditorEM.editorWindow.postMessage({"messageType" : "openPedigree_data","openPedigreeData" : null}, pedigreeEditorEM.editorPageOrigin);
// pedigreeEditorEM.editorWindow.postMessage({"messageType" : "openPedigree_proband","probandData" : null}, pedigreeEditorEM.editorPageOrigin);
}
}
};
Expand All @@ -164,21 +164,21 @@ pedigreeEditorEM.onMessageEvent = function(event) {
if (event.source == pedigreeEditorEM.editorWindow
&& event.origin == pedigreeEditorEM.editorPageOrigin) {
// the message is from editor window
if (event.data.messageType === "panogram_control") {
if (event.data.messageType === "openPedigree_control") {
if (event.data.message == "started"
&& pedigreeEditorEM.sendWhenReady) {

pedigreeEditorEM.log("Sending data to editor");

pedigreeEditorEM.editorWindow.postMessage({"messageType" : "proband","probandData" : null}, pedigreeEditorEM.editorPageOrigin);
pedigreeEditorEM.editorWindow.postMessage({"messageType" : "panogram","panogramData" : pedigreeEditorEM.messageData},
// pedigreeEditorEM.editorWindow.postMessage({"messageType" : "openPedigree_proband", "probandData" : null}, pedigreeEditorEM.editorPageOrigin);
pedigreeEditorEM.editorWindow.postMessage({"messageType" : "openPedigree_data", "openPedigreeData" : pedigreeEditorEM.messageData},
pedigreeEditorEM.editorPageOrigin);
pedigreeEditorEM.sendWhenReady = false;
}
} else if (event.data.messageType === "panogram") {
} else if (event.data.messageType === "openPedigree_data") {
pedigreeEditorEM.log("Got data from editor");
if (event.data.panogramData) {
pedigreeEditorEM.save(event.data.panogramData.context.field, event.data.panogramData.value);
if (event.data.openPedigreeData) {
pedigreeEditorEM.save(event.data.openPedigreeData.context.field, event.data.openPedigreeData.value);

}
}
Expand All @@ -187,7 +187,7 @@ pedigreeEditorEM.onMessageEvent = function(event) {

pedigreeEditorEM.onStorageEvent = function(storageEvent) {

if (storageEvent.storageArea == window.localStorage && storageEvent.key == pedigreeEditorEM.panogramDataKey){
if (storageEvent.storageArea == window.localStorage && storageEvent.key == pedigreeEditorEM.openPedigreeDataKey){
// the data has been updated
var data = JSON.parse(storageEvent.newValue);

Expand Down
12 changes: 6 additions & 6 deletions panogram/LICENSE → open-pedigree/LICENSE
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
GNU LESSER GENERAL PUBLIC LICENSE
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999

Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

(This is the first released version of the Lesser GPL. It also counts
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.)
the version number 2.1.]

Preamble

Expand Down Expand Up @@ -470,8 +470,8 @@ safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.

{description}
Copyright (C) {year} {fullname}
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand All @@ -498,7 +498,7 @@ necessary. Here is a sample; alter the names:
library `Frob' (a library for tweaking knobs) written by James Random
Hacker.

{signature of Ty Coon}, 1 April 1990
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice

That's all there is to it!
96 changes: 96 additions & 0 deletions open-pedigree/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<p align="center">
<img src="https://repository-images.githubusercontent.com/212736090/2759df80-fe9e-11e9-8fa0-8237e35cbaf7" width="400px" alt="Open Pedigree logo"/>
</p>

<p align="center">
<a href="https://opensource.org/licenses/LGPL-2.1" target="_blank">
<img src="https://img.shields.io/badge/license-LGPL--2.1-blue.svg" alt="LGPL-2.1">
</a>
<img src="https://img.shields.io/badge/made%20in-canada-red.svg" alt="Made with love">
</p>


## A free and open-source pedigree tool powered by PhenoTips

Open Pedigree is a robust browser-based genomic pedigree drawing solution using [Prototype](prototypejs.org), [Raphaël](https://dmitrybaranovskiy.github.io/raphael/), and [PhenoTips](https://phenotips.org).

<img width="983" alt="image" src="https://user-images.githubusercontent.com/4251264/68103796-e1048080-fe9d-11e9-9353-6b491aae588d.png">


## Features

✔ Robust support for complext families, intergenerational linkages, and consanguinity

✔ Shade nodes with disorders and/or candidate genes

✔ Quickly start with family templates

✔ Automatic consanguinity detection

✔ Import from PED, LINKAGE, GEDCOM (Cyrillic), or BOADICEA


## Getting started

Quickly get started with open pedigree on your computer:
```
git clone git@github.com:phenotips/open-pedigree.git
cd open-pedigree
npm install
npm start
```
Open a browser to http://localhost:9000/



## Contributing

Contributions welcome! Fork the repository and create a pull request to share your improvements with the community.

In order to ensure that the licensing is clear and stays open, you'll be asked to sign a CLA with your first pull request.


## Support

This is free software! Create an issue in GitHub to ask others for help, or try fixing the issue yourself and then make a pull request to contribute it back to the core.

For commercial support or for information about the paid Enterprise version, please contact [Gene42](https://gene42.com/).


## License

Copyright (c) 2019 Gene42 Inc.

Open Pedigree is distributed under the [LGPL-2.1](https://opensource.org/licenses/LGPL-2.1) (GNU Lesser General Public License).

You can easily comply with this license by:
* including prominent notice of the use of Open Pedigree in your software that uses it
* retaining all copyright notices in the software
* ensuring that any and all changes you make to the software are disclosed and open-sourced under the LGPL


# FHIR export/import

The FHIR import/export does not have an actual specification to follow. There is a specification in development, though
we have deviated from it, choosing to use a Composition so that the family history resources and observations can be
bundled together, rather then the List of family history resources in the current specification. Not all data gathered
by the editor has a mapping in the FHIR representation. This means that any data with no mapping will be lost.
Some other aspects of the mapping also do not translate directly, where possible
naming conventions are used to try and account for these. For example the FHIR FamilyHistory resource has a single
name field which is a string. The pedigree editor has a first name, last name and a last name at birth, this will
be written into the FamilyHistory resource as <first name> <last name> (<last name at birth>). When importing the FHIR
resource everything but the last word is the first name and a trailing name in brackets will be taken as last name at birth.

Heredity options - This can be 'Childless' or 'Infertile' in the editor, but is not currently stored on the fhir resource.
Carrier Status - This can be 'Carrier' or 'Pre-symptomatic' in the editor, but is not currently stored on the fhir resource.
Evaluated - This is a checkbox in the editor, but is not currently stored on the fhir resource.
Lost Contact - This is a checkbox in the editor, but is not currently stored on the fhir resource.
Multiple Sibling Nodes - In the editor you can create a single node to represent multiple siblings, at the moment these
will be saved as a single familiy history resource with no name and the number of siblings will be lost.

Phenotype and Candidate Genes are both stored as Observation Resources associated with a family history resource. The
system uses a naming convention to distinguish the two, otherwise it tries to match the code system to try and determine
if the observation represents a Phenotype or Candidate gene.

Life status - This can be 'unborn', 'stillborn' and 'aborted' with an associated gestation age. This will be written into
the deceasedString field on the family history resource in a form like 'stillborn 34 weeks'.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions open-pedigree/dist/pedigree.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit f80b274

Please sign in to comment.