Skip to content

Commit

Permalink
Feature: Added Ontology ID and label for Body (#190 #198)
Browse files Browse the repository at this point in the history
* Id and label added for body

* Code smells

* Code smells

Co-authored-by: Vutukuri Sai Ajay <[email protected]>
  • Loading branch information
vutukuriajay2241 and Vutukuri Sai Ajay authored Jul 22, 2021
1 parent 8f3a0c9 commit 023bd1f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
6 changes: 5 additions & 1 deletion projects/v2/src/app/services/sheet.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ export class SheetService {
* @param data is the parsed ASCTB data from the csv file of the sheet
*/
getDataWithBody(data: any) {
const organ: Structure = { name: 'Body', id: '' };
const organ: Structure = {
name: 'Body',
id: 'UBERON:0013702',
rdfs_label: 'body proper'
};
data.forEach((row) => {
row.anatomical_structures.unshift(organ);
});
Expand Down
15 changes: 10 additions & 5 deletions projects/v2/src/app/store/sheet.state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ export class SheetStateModel {
export class SheetState {
constructor(private sheetService: SheetService) { }
faliureMsg = 'Failed to fetch data';
bodyId = 'UBERON:0013702';
bodyLabel: 'body proper';

/**
* Returns an observable that watches the data
Expand Down Expand Up @@ -305,7 +307,8 @@ export class SheetState {

const organ: Structure = {
name: 'Body',
id: '',
id: this.bodyId,
rdfs_label: this.bodyLabel,
};

for await (const [_unused, sheet] of compareData.entries()) {
Expand Down Expand Up @@ -403,8 +406,8 @@ export class SheetState {
row.organName = organsNames[i];
const newStructure: Structure = {
name: 'Body',
id: '',
rdfs_label: 'NONE',
id: this.bodyId,
rdfs_label: this.bodyLabel,
};
row.anatomical_structures.unshift(newStructure);
}
Expand Down Expand Up @@ -664,7 +667,8 @@ export class SheetState {
const state = getState();
const organ: Structure = {
name: 'Body',
id: '',
id: this.bodyId,
rdfs_label: this.bodyLabel,
};

return this.sheetService.fetchPlaygroundData().pipe(
Expand Down Expand Up @@ -725,7 +729,8 @@ export class SheetState {
);
const organ: Structure = {
name: 'Body',
id: '',
id: this.bodyId,
rdfs_label: this.bodyLabel,
};

return this.sheetService.updatePlaygroundData(data).pipe(
Expand Down

0 comments on commit 023bd1f

Please sign in to comment.