Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ It is necessary to install and configure the following dependencies:
After installing Node, you should be able to run the following command to install development tools.
You will only need to run this command when dependencies change in [package.json](package.json).

npm install
yarn install

### Prepare Firebase Realtime Database
1. Go to [Firebase Console] and login with your Google account.
Expand Down
80 changes: 80 additions & 0 deletions codedoc/CODEDOC.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Code Tutorial
## Configuration Files
**environment.ts**: The config file used to connect firebase realtime database, set oncotree version and `dev/prod` configs.
**firebase.json**: The firebase connection auth file generated by Google API service, used to connect Firebase in backend.
**heroku-mongo.yml**: The mongo connection setting which should be copied and pasted in `application-prod.yml/application-dev.yml`.
**token**: The trial curation API authentication token.

## File Types
In the trial curation platform, the frontend code root directory is `/matchminer-curate/src/main/webapp/app`.
Each folder is a component or service folder. Services only have `*.service.ts` files which can be thought as
utility classes and used in components.

Most components have 4 files:
```
*.component.html: includes all html related code.
*.component.ts: contains functions used in *.component.html.
*.model.ts: defines data structure of objects used in *.component.ts.
*.scss: writes all css classes used in *.component.html.
```

## Components

### Meta(jhi-meta)
Display trial metadata for all trials in a table. A trial meta record will be generated automatically when every time
users import a new trial from cancer.gov, which is implemented in `importTrialsFromNct()`.
```
this.metaService.setMetaRecord(metaRecord);
```

### Trial(jhi-trial)
The main page includes all functions related to trial operations and contains multiple components listed below.
The trial curation is a real time procedure that means users operations on a trial will be broadcast to all sub components,
which is implemented by creating multiple observable objects(watchers) and monitoring them.
All observable objects are created in Trial Service and monitored in constructor methods of referenced components.

### Arm(jhi-arm)
The arm section stores arm meta info and includes the drug component.

### Drug(jhi-drug)
The component can be used to store a single drug treatment and combination therapy(drug A + drug B).

### Panel(jhi-panel)
It contains all node related operations, including add, delete, edit, move, clone and switch.
There is a very important class object called **MovingPath** which contains `from` and `to`.
When a user moves a node, we need to store the source path in `from` and destination path in `to` first,
and then clone, copy and paste the node.

### Match(jhi-match)
The Match component is a big set of clinical and genomic nodes. They are connected by `AND/OR` logistic symbols.

### Clinical(jhi-clinical)
The Clinical node contains patient data like `age_numerical`, `oncotree_primary_diagnosis` and `gender`.
Either `age_numerical` and `oncotree_primary_diagnosis` is **required**.

### Genomic(jhi-genomic)

The genomic node contains gene data like `hugo_symbol`, `annotated_variant`, `germline` and `matching_examples`.
Both `hugo_symbol` and `annotated_variant` are **required**.

## Services
### Connection
All API http requests should be put here.

### Trial
Trial service provides all utility functions related to trials.
All observable objects and update services related to trial should be put here.

### Email
Email service is a simple service that only has the sending emails function.

### Meta
All Meta page related utility functions should be put here.


## Relationship between components
### Trials Page
![Trials Page](/codedoc/trials.png)

### Meta Page
![Meta Page](/codedoc/meta.png)
Binary file added codedoc/meta.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added codedoc/trials.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading