Commit f5051762 authored by Kruisselbrink, Johannes's avatar Kruisselbrink, Johannes
Browse files

Update convert script DTU CAGs to v1.2.0: use active substance names instead...

Update convert script DTU CAGs to v1.2.0: use active substance names instead of chemical names and exclude substances without ARfD from acute CAGs and substances without ADI from chronic CAGs
parent 13d7f2c3
#!/usr/bin/python
__version_info__ = ('1', '1', '0')
__version_info__ = ('1', '2', '0')
__version__ = '.'.join(__version_info__)
#############################################################################
......@@ -136,6 +136,14 @@ capeg['Name'] = capeg['targetL1'].str[max_len]
# Set the reference
capeg['Reference'] = ''
# Remove Acute rows without ARfD
capeg.drop(capeg.loc[(capeg['AcuteChronic'] == 'Acute') & ((capeg['arfd'] == 'na') | capeg['arfd'].isna())].index, inplace=True)
# Remove Chronic rows without ADI
capeg.drop(capeg.loc[(capeg['AcuteChronic'] == 'Chronic') & ((capeg['adi'].isna() | capeg['arfd'].isna()))].index, inplace=True)
#capeg.to_excel('dump.xlsx', sheet_name='Dump', index=False)
# Done, now wrap this table up
effects_header = ['idEffect', 'CodeSystem', 'Name', 'Description',
'BiologicalOrganisation', 'KeyEventProcess',
......@@ -184,7 +192,7 @@ capeg.mcra.addcolumn(['idSubstance', 'Name', 'Description'])
# ID
capeg['idSubstance'] = capeg['casNumber']
# Name
capeg['Name'] = capeg['chemicalName'].str[max_len]
capeg['Name'] = capeg['activeSubstance'].str[max_len]
# Done, now wrap this table up
substances_header = ['idSubstance', 'Name', 'Description',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment