-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Stephan Malzacher
committed
Jun 23, 2023
1 parent
e44b63f
commit a5b1ff6
Showing
9 changed files
with
145 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
declare module "*.json" { | ||
const value: any; | ||
export default value; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { BiocathubSubmissionService } from './biocathub-submission.service'; | ||
|
||
describe('BiocathubSubmissionService', () => { | ||
let service: BiocathubSubmissionService; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({}); | ||
service = TestBed.inject(BiocathubSubmissionService); | ||
}); | ||
|
||
it('should be created', () => { | ||
expect(service).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { Injectable } from '@angular/core'; | ||
import bch_json from "../../assets/biocathub.json"; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class BiocathubSubmissionService { | ||
|
||
constructor() { } | ||
|
||
mapData(data){ | ||
console.log(bch_json["condition"]) | ||
console.log(data["data"]) | ||
let BA_replicates = this.build_replicates(data["data"][0]) | ||
let PAC_replicates = this.build_replicates(data["data"][1]) | ||
|
||
let BA_measurement = this.build_measurement(BA_replicates, "3-OH-benzaldehyde") | ||
let PAC_measurement = this.build_measurement(PAC_replicates,"3-OH-phenylacetylcarbinol" ) | ||
|
||
let measurements = {measurements:[BA_measurement, PAC_measurement]} | ||
|
||
let data_model = bch_json | ||
data_model["experimentalData"] = measurements | ||
return data_model | ||
|
||
} | ||
|
||
build_replicates(BA_data){ | ||
console.log(BA_data) | ||
let x_values = BA_data["x"] | ||
let y_values = BA_data["y"] | ||
let length = x_values.length | ||
let replicates = [] | ||
|
||
for(let i = 0; i <length; i++){ | ||
let replicate = {} | ||
replicate["x_value"] = x_values[i] | ||
let y_value = [y_values[i]] | ||
replicate["y_values"] = y_value | ||
replicates.push(replicate) | ||
} | ||
|
||
return replicates | ||
|
||
} | ||
|
||
build_measurement(replicates, reagent){ | ||
let measurement ={ | ||
x_unit:"min", | ||
x_name:"time in minutes", | ||
y_unit:"mmol/L", | ||
y_name:"concentration in mmol/L", | ||
plotStyle: "point", | ||
reagent:reagent, | ||
notes:"concentration measurement", | ||
replicates: replicates | ||
|
||
} | ||
return measurement | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"enzymes": [{"ecNumber": "4.1.1.1", "name": "pyruvate decarboxylase", "type": "variant", "variant": "ApPDC-SOPP3", "organism": "Acetobacter pasteurianus", "concentration": "2", "unit": "mg/mL", "formulation": "Purified enzyme", "method": "Bradford", "others": [], "reaction": {"educts": [{"name": "3-OH-BA", "role": "substrate", "concentration": "15", "unit": "mmol/L", "smiles": "O=Cc1cccc(O)c1", "others": []}, {"name": "Pyruvate", "role": "substrate", "smiles": "CC(=O)C(=O)O", "others": []}], "products": [{"name": "3-OH-PAC", "role": "product", "concentration": "0", "unit": "mmol/L", "smiles": "CC(=O)[C@H](O)c1cccc(O)c1", "others": []}]}, "sequence": "not given"}, {"name": "Amine transferase", "type": "variant", "variant": "Cv2020-SOPP3", "organism": "Chromobacterium violaceum", "concentration": "2", "unit": "mg/mL", "formulation": "purified enzyme", "method": "Bradford", "others": [], "reaction": {"educts": [{"name": "3-OH-PAC", "role": "substrate", "smiles": "CC(=O)[C@H](O)c1cccc(O)c1", "others": []}, {"name": "a-methylbenzylamine", "role": "substrate", "smiles": "CC(N)c1ccccc1", "others": []}], "products": [{"name": "metaraminol", "role": "product", "smiles": "CC(N)C(O)c1cccc(O)c1", "others": []}]}, "sequence": "not given", "ecNumber": "not given"}], "vessel": {"type": "Stirred tank reactor 50 mL", "volume": "30", "unit": "mL", "others": [{"key": "end volume", "value": "35 mL"}]}, "condition": {"temp": "25", "unit": "\u00b0C", "ph": "5", "buffer": {"type": "Kpi-buffer", "concentration": "100", "unit": "mmol/L"}, "others": []}, "experimentalData": {"measurements": []}, "user": {}} |