-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 parent
2e7c3a4
commit 69606a1
Showing
8 changed files
with
52 additions
and
37 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
|
@@ -33,6 +33,7 @@ | |
""" | ||
|
||
import datetime | ||
from ord_schema.proto.reaction_pb2 import * | ||
from ord_schema.proto.dataset_pb2 import * | ||
from ord_schema import validations | ||
|
@@ -126,6 +127,9 @@ def inner_loop(row: pd.Series, stock_df: pd.DataFrame) -> Reaction: | |
# Specify reaction outcome | ||
specify_outcome(reaction, row) | ||
|
||
# Add provenance | ||
add_provenance(reaction) | ||
|
||
return reaction | ||
|
||
|
||
|
@@ -604,6 +608,7 @@ def add_standard(measurement: ProductMeasurement, row: pd.Series): | |
def define_measurement(measurement: ProductMeasurement, row: pd.Series): | ||
measurement.analysis_key = "LCMS" | ||
measurement.type = ProductMeasurement.YIELD | ||
measurement.uses_internal_standard = True | ||
rxn_yield = row["Reaction Yield"] | ||
|
||
try: | ||
|
@@ -613,27 +618,10 @@ def define_measurement(measurement: ProductMeasurement, row: pd.Series): | |
rxn_yield = rxn_yield / 100 | ||
except: | ||
pass | ||
# try: | ||
# rxn_yield = rxn_yield.replace("≥", "") | ||
# except: | ||
# pass | ||
# try: | ||
# rxn_yield = rxn_yield.replace("%", "") | ||
# except: | ||
# pass | ||
# try: | ||
# rxn_yield = float(rxn_yield) | ||
# except: | ||
# pass | ||
|
||
if rxn_yield < 200: | ||
measurement.percentage.value = rxn_yield * 100 | ||
|
||
# measurement.retention_time.value = row[ | ||
# "2-Fluoro-3,3'-bipyridine Retention time in min" | ||
# ] | ||
# measurement.retention_time.units = Time.MINUTE | ||
|
||
|
||
# nucleophile ID must be given. Since electrophile stays constant, the product | ||
# can be inferred from the nucleophile alone | ||
def specify_outcome_details(nuc_id: str): | ||
|
@@ -680,12 +668,17 @@ def add_provenance(reaction: Reaction): | |
provenance = reaction.provenance | ||
provenance.doi = "10.1021/acs.oprd.9b00236" | ||
provenance.publication_url = "http://doi.org/10.1021/acs.oprd.9b00236" | ||
creator = provenance.record_created.person | ||
creator.username = "dswigh" | ||
creator.name = "Daniel Wigh" | ||
creator.orcid = "0000-0002-0494-643X" | ||
creator.organization = "University of Cambridge" | ||
creator.email = "[email protected]" | ||
event = RecordEvent( | ||
time={"value": str(datetime.datetime.now())}, | ||
person={ | ||
"username": "dswigh", | ||
"name": "Daniel Wigh", | ||
"orcid": "0000-0002-0494-643X", | ||
"organization": "University of Cambridge", | ||
"email": "[email protected]" | ||
}, | ||
) | ||
provenance.record_created.CopyFrom(event) | ||
|
||
|
||
if __name__ == "__main__": | ||
|
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 |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
""" | ||
|
||
import datetime | ||
from ord_schema.proto.reaction_pb2 import * | ||
from ord_schema.proto.dataset_pb2 import * | ||
from ord_schema.message_helpers import find_submessages | ||
|
@@ -81,6 +82,9 @@ def inner_loop(row: pd.Series) -> Reaction: | |
# Specify reaction outcome | ||
specify_outcome(reaction, row) | ||
|
||
# Add provenance | ||
add_provenance(reaction) | ||
|
||
return reaction | ||
|
||
|
||
|
@@ -424,6 +428,7 @@ def define_measurement(measurement: ProductMeasurement, row: pd.Series): | |
"2-Fluoro-3,3'-bipyridine Retention time in min" | ||
] | ||
measurement.retention_time.units = Time.MINUTE | ||
measurement.uses_internal_standard = True | ||
|
||
|
||
def specify_outcome(reaction: Reaction, row: pd.Series): | ||
|
@@ -461,12 +466,18 @@ def add_provenance(reaction: Reaction): | |
provenance = reaction.provenance | ||
provenance.doi = "10.1039/c8re00032h" | ||
provenance.publication_url = "http://doi.org/10.1039/c8re00032h" | ||
creator = provenance.record_created.person | ||
creator.username = "marcosfelt" | ||
creator.name = "Kobi Felton" | ||
creator.orcid = "0000-0002-3616-4766" | ||
creator.organization = "University of Cambridge" | ||
creator.email = "[email protected]" | ||
event = RecordEvent( | ||
time={"value": str(datetime.datetime.now())}, | ||
person={ | ||
"username": "marcosfelt", | ||
"name": "Kobi Felton", | ||
"orcid": "0000-0002-3616-4766", | ||
"organization": "University of Cambridge", | ||
"email": "[email protected]" | ||
|
||
}, | ||
) | ||
provenance.record_created.CopyFrom(event) | ||
|
||
|
||
if __name__ == "__main__": | ||
|
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 |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
""" | ||
|
||
import datetime | ||
from multitask.utils import * | ||
from ord_schema.proto.reaction_pb2 import * | ||
from ord_schema.proto.dataset_pb2 import * | ||
|
@@ -80,6 +81,9 @@ def inner_loop(row: pd.Series, case) -> Reaction: | |
# Specify reaction outcome | ||
specify_outcome(case, reaction, row) | ||
|
||
# Add provenance | ||
add_provenance(reaction) | ||
|
||
return reaction | ||
|
||
|
||
|
@@ -380,6 +384,7 @@ def define_measurement(measurement: ProductMeasurement, row: pd.Series): | |
measurement.analysis_key = "LCMS" | ||
measurement.type = ProductMeasurement.YIELD | ||
measurement.percentage.value = row["yld"] | ||
measurement.uses_internal_standard = True | ||
|
||
|
||
products_by_case = { | ||
|
@@ -431,14 +436,20 @@ def specify_outcome(case, reaction: Reaction, row: pd.Series): | |
|
||
def add_provenance(reaction: Reaction): | ||
provenance = reaction.provenance | ||
provenance.doi = "110.1039/C6RE00153J" | ||
provenance.doi = "10.1039/C6RE00153J" | ||
provenance.publication_url = "http://doi.org/10.1039/C6RE00153J" | ||
creator = provenance.record_created.person | ||
creator.username = "marcosfelt" | ||
creator.name = "Kobi Felton" | ||
creator.orcid = "0000-0002-3616-4766" | ||
creator.organization = "University of Cambridge" | ||
creator.email = "[email protected]" | ||
event = RecordEvent( | ||
time={"value": str(datetime.datetime.now())}, | ||
person={ | ||
"username": "marcosfelt", | ||
"name": "Kobi Felton", | ||
"orcid": "0000-0002-3616-4766", | ||
"organization": "University of Cambridge", | ||
"email": "[email protected]" | ||
|
||
}, | ||
) | ||
provenance.record_created.CopyFrom(event) | ||
|
||
|
||
if __name__ == "__main__": | ||
|