{"id":40354885,"url":"https://github.com/kwabratseur/aaei","last_synced_at":"2026-01-20T10:01:25.805Z","repository":{"id":57407720,"uuid":"447722700","full_name":"Kwabratseur/AAEI","owner":"Kwabratseur","description":"Air Adverse Effect Index","archived":false,"fork":false,"pushed_at":"2023-09-05T11:49:02.000Z","size":39326,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-05T19:43:11.599Z","etag":null,"topics":["compound","gas","genra","health","index","read-across","statistics","toxicity","trace"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/aaei/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kwabratseur.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-01-13T19:15:29.000Z","updated_at":"2022-01-17T23:12:53.000Z","dependencies_parsed_at":"2022-09-26T17:10:47.766Z","dependency_job_id":"e3c8c182-6005-4541-bc67-b21a6f75bfe7","html_url":"https://github.com/Kwabratseur/AAEI","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"17f16f206e4383991984d111b5fedc589e036364"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/Kwabratseur/AAEI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kwabratseur%2FAAEI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kwabratseur%2FAAEI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kwabratseur%2FAAEI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kwabratseur%2FAAEI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kwabratseur","download_url":"https://codeload.github.com/Kwabratseur/AAEI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kwabratseur%2FAAEI/sbom","scorecard":{"id":80955,"data":{"date":"2025-08-11","repo":{"name":"github.com/Kwabratseur/AAEI","commit":"b693bdb999ec9b3abf75cabc0389092e988620b6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.7,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/13 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v1.5.0 not signed: https://api.github.com/repos/Kwabratseur/AAEI/releases/119931715","Warn: release artifact v1.2.0 not signed: https://api.github.com/repos/Kwabratseur/AAEI/releases/66091605","Warn: release artifact v1.1.0 not signed: https://api.github.com/repos/Kwabratseur/AAEI/releases/57416004","Warn: release artifact v1.0.1 not signed: https://api.github.com/repos/Kwabratseur/AAEI/releases/57326398","Warn: release artifact v1.0.0 not signed: https://api.github.com/repos/Kwabratseur/AAEI/releases/57324692","Warn: release artifact v1.5.0 does not have provenance: https://api.github.com/repos/Kwabratseur/AAEI/releases/119931715","Warn: release artifact v1.2.0 does not have provenance: https://api.github.com/repos/Kwabratseur/AAEI/releases/66091605","Warn: release artifact v1.1.0 does not have provenance: https://api.github.com/repos/Kwabratseur/AAEI/releases/57416004","Warn: release artifact v1.0.1 does not have provenance: https://api.github.com/repos/Kwabratseur/AAEI/releases/57326398","Warn: release artifact v1.0.0 does not have provenance: https://api.github.com/repos/Kwabratseur/AAEI/releases/57324692"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}}]},"last_synced_at":"2025-08-15T05:50:35.077Z","repository_id":57407720,"created_at":"2025-08-15T05:50:35.077Z","updated_at":"2025-08-15T05:50:35.077Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28601284,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T09:39:28.479Z","status":"ssl_error","status_checked_at":"2026-01-20T09:38:10.511Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compound","gas","genra","health","index","read-across","statistics","toxicity","trace"],"created_at":"2026-01-20T10:01:10.839Z","updated_at":"2026-01-20T10:01:25.785Z","avatar_url":"https://github.com/Kwabratseur.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Work In Progress!\r\n\r\n# Dynamic Adverse Effect Index (DAEI/DynAEI)\r\n\r\n## Introduction\r\nIn this repository, the python code to calculate a Dynamic Adverse Effect Index is presented. The Comptox **Generalized Read-Across Database** [GenRA](https://comptox.epa.gov/genra/) applies Read-Across methodology on a large database of toxicological values for many chemicals. Gaps can be filled, and a report on confidence of the results is given, plus a likeliness that this effect is positive (present). This tool can provide up to 15 *analog* chemicals, which toxicological properties will be extrapolated to the chemical of interest. This extrapolation can be exported, this is the input-format for the **DAEI** tool.\r\n\r\nAdditionally, files for four **OpenFOAM** simulations are made available. It is explained how these files can be run and how the post-processing steps can be applied to calculate the DAEI.\r\n\r\nsee [Openfoam ParaView instructions ](OpenFOAM_ParaView.md) for how to apply DynAEI there, and some general usage tips.\r\nSee [Openfoam Tutorial](https://github.com/Kwabratseur/STL-Thermal-Paraview-tutorial) for an in depth thermal simulation tutorial\r\n\r\n#### Installation\r\n* Through Github:\r\n * Download the .tar.gz from **Releases**\r\n * Install allowable python\r\n * Install DAEI:\r\n  * `sudo pip3.x install aaei-1.x.x.tar.gz[Viz]`\r\n  * Without the Viz label, visualization tools will not be installed (Matplotlib, Seabornd and Plotly)\r\n* Through [Pypi](https://pypi.org/project/aaei/) Package index:\r\n * `pip install aaei[Viz]`\r\n\r\n## Dynamic Adverse effect index\r\n\r\n The table below shows the presence of a certain *health/target effect* per row, related to the *test group* it is categorized under in [GenRA](https://comptox.epa.gov/genra/).  \r\n This categorization is used as an intermediate step before calculating the total sum or average.\r\n\r\n \u003cimg src=gfx/Toxicity_Effects.png width=\"600\" height=\"700\"\u003e\r\n\r\n \u003cimg src=gfx/Weights.png width=\"450\" height=\"150\" align = \"right\"\u003e\r\n\r\n The sum or average is normalized, and a matrix can be created with chemical species against test-types or effect-types.  \r\n See the image to the right for an example (colored with LibreOffice)\r\n\r\n ### Method\r\n\r\n \u003cimg src=gfx/Paraview_AEI.png width=\"100\" height=\"300\" align=\"right\"\u003e\r\n\r\n  1. go to [GenRA](https://comptox.epa.gov/genra/)\r\n  2. go through the 5 steps:\r\n      * Select target chemical\r\n      * select analogs\r\n      * generate read-across prediction\r\n      * export read-across prediction\r\n      * rename export to **genra_\\\u003cformula\\\u003e.csv**, in the case of CO2: **genra_CO2.csv**\r\n  3. do this for every chemical you are interested in, or in your simulation (Names need to match!)\r\n  4. By running the script in the following way:\r\n ```bash\r\n     AEI CopyExamples\r\n     AEI Run viz piv=Batch_Report_Target.csv\r\n ```\r\n      * GenRA files O3, C10H16 and CH2O will be *copied*, including *AEI.py* ParaView macro script\r\n      * GenRA files O3, C10H16 and CH2O will be processed\r\n      * Files *Batch_Report_Target.csv* ,*Batch_Report_Meta.csv* and one file per input file will be generated in the folder it was run\r\n      * viz will generate a 3D-bubble plot, with X = Effectgroup, Y = species, Z = Testgroup. And bubble-size = positive effect magnitude\r\n      * piv=Batch_Report_Target.csv will generate and open a pivot pivottablejs interactive pivot table in the browser for the file mentioned.\r\n  5. **AEI_Norm.csv** Follows from this step and can be applied however desired. [General usage](#General-usage) shows how this can be applied and interpreted for generic .csv files.\r\n  6. Follow the steps under [ParaView DAEI applications script/Macro](#ParaView-DAEI-applications-script/Macro) to apply the results to a run simulatin\r\n  7.The resulting normalized AEI can be applied to any dataset\r\n      * To averages over time, to determine the **relative** effect on different effect-groups\r\n      * To spatial data, this can locate the more healthier or less healthy locations.\r\n      * To see the contribution to AEI by different **gases**, **test-types** or **effect-types**\r\n      * To the right the ParaView source-tree is shown, the different effect categories are visible.\r\n\r\n## Software\r\n\r\nA list of software used in this project\r\n\r\n### Jupyter notebook\r\n[Jupyter](https://jupyter.org/) notebooks have been used to do all major data-processing, visualization and analysis. It is also used as an IDE, the **GenRA AEI** scripts have been developed in Jupyter.\r\n * Installation instructions can be found on website\r\n\r\n### Python\r\n\r\n#### Case-copy script\r\nTo ease the copying and management of OpenFOAM cases, a simple script has been written and provided, to copy and clean cases on a per-case basis, it will put the cleaned cases in /CleanCases relative from where you are.\r\n * Simply make sure it is executable, and run CopyCase \\\u003cCaseName\\\u003e.\r\n\r\n#### DAEI calculation script\r\nit provides standard methods to calculate an output file **AEI_Norm.csv**\r\nIt provides the following methods:\r\n * Filter out Metadata from the GenRA files, calculate statistical values and export as **genra_\\\u003cformula\\\u003e_\\\u003cchemical_name\\\u003e_metadata.csv** for example `genra_O3_Ozone_metadata.csv`\r\n     * List of all found **Target** afflictions + statistics is exported as **Batch_Report_Target.csv**\r\n     * list of all found **Test** groups + statistics and metadata from original genra file is exported as **Batch_Report_Meta.csv**\r\n * Batch process a group of chemicals in one go\r\n     * Visualizations can be exported with a flag `viz`\r\n     * Total summary from this step, **AEI_Norm.csv** needs to be opened in [Paraview](https://www.paraview.org/), if the automatic application wants to be followed for a OpenFOAM simulation.\r\n     * The resulting normalized AEI can be applied to any dataset\r\n         * To averages over time, to determine the **relative** effect on different effect-groups\r\n         * To spatial data, this can locate the more healthier or less healthy locations.\r\n         * To see the contribution to AEI by different **gases**, **test-types** or **effect-types**\r\n\r\n##### DAEI commandline help and arguments\r\nBy running `AEI help` you will get the following output.:\r\n```\r\nRun this script in a folder with genra_\u003cchemical\u003e.csv files.\r\nUse the flags shown below to control the output\r\nYou can use fcn: sum, avg, med for the different normalization schemes\r\nUse pivot=file.csv flag to open a .html interactive pivot table in your browser. This works for any .csv with categorical data (text flags in rows)\r\nArgument viz generates 6 graphs to aid in data analysis.\r\nArgument Run runs the script with default filenames in the current folder\r\npossible arguments are:\r\narg:  filename  - Batch_Report\r\narg:  viz  - False\r\narg:  pivot  - Batch_Report_Target.csv\r\narg:  fcn  - sum\r\narg:  piv  - False\r\narg:  help  - True\r\narg:  Run  - False\r\narg:  CopyExamples  - False\r\narg:  version  -  V2\r\n```\r\nWhere the first item in the column is the argument, and the second the default state.  \r\nFor example: `AEI filename=Export_2 pivot=Export_2_Target.csv viz fcn=avg`\r\n\r\n## General usage\r\nThe philosophy of this method is to use the most recent and state of the art toxicology knowledge for a data driven dynamic health index. With this approach, all chemical species can be taken into account. Since it is data driven, stability in results is ensured.\r\n\r\nTo show how this works, the EU Air Quality Index is used as a comparison. We generate data suitable for the EUAQI, but also some more data which will be omitted. The DynAEI will be able to use all data. The results follow coarsely the same patterns for now. But this difference might change significantly depending on the samples, but also new studies in the future.\r\n\r\nThe function mentioned in these subparagraphs are all found in AEI_PV.py. AAEI must be imported for these to work.\r\n### Example function demo\r\n\r\nThe function RunFcnDemo() found in AEI_PV.py shows an example implementation of how to generate and apply DynAEI, and make a comparison to EUAQI.\r\n\r\n* It can be run with the following code:\r\n```\r\nImport AAEI\r\nFrom AEI_PV import *\r\nRunFcnDemo()\r\n```\r\nBelow I will explain the function calls in this demo function to show how it can be applied to your data.\r\n\r\n#### Procedure to generate DynAEI for (later) use\r\nSince this is a fully data driven approach where no limits are determined ahead of time it needs to be generated for each unique set of compounds that need to be compared.\r\n\r\nSince the chemistry matters for lookup purposes, it is important to follow the naming conventions.\r\n\r\nYou can simply start with importing the libraries.\r\n```\r\nImport AAEI\r\nFrom AEI_PV import *\r\n```\r\n\r\nThe function `AAEI.BatchReport` does all the heavy lifting and generates the dynamic index for you. Below you can see it's input arguments. In general, you set the fileNames to a list of \"genra_[chemical_name]\", the output filename, you indicate which values to merge and which additional entries to add. More about the last 2 below.\r\n```\r\nBatchReport(fileNames,\r\n            filename,\r\n            fcn=\"sum\",\r\n            viz = False,\r\n            ext = False,\r\n            merge=\"None\",\r\n            entries = \"None\",\r\n            version=\"v2\")\r\n```\r\n\r\n##### Adding entries as a function of other data\r\nThis approach can only work with pure chemicals, things like particulate matter in general have an unknown chemical composition, therefore there is no exposure assay data that can be generalized and found in GenRA. To solve this problem, PM10 or PM25 can be expressed as a function of another compound. In this case, a linear correlation was established with the limit values of Ozone and PM10 found in the EUAQI, the same was done for Ozone and PM2.5.\r\nWe pass the keyword `entries` a dictionary with the linear coefficient found, like shown below.\r\n```\r\nentries= {\"PM10\":[\"O3\",0.3330015744489429],\r\n          \"PM25\":[\"O3\",0.6382530176938073]}\r\n```\r\n##### Merging multiple entries into a single entry\r\nIn certain chemistry models, simplifications are made and chemical reactions can be binned into a term like resultant reaction product, which is a certain composition of other known compounds. To facilitate these models, below syntax can be used to merge the GenRA data of multiple compounds into one product. Below CH3CHO, C10H16O2 and C8H14O are merged into one term called Cprod\r\n`merge=\"CH3CHO,C10H16O2,C8H14O-Cprod\"`\r\n\r\n##### Generate the DynAEI\r\n\r\nThe example below would assume that 6 genra_[chemical].csv files are available, no data will be merged but 2 entries will be added since entries are passed to the function.\r\n```\r\nMetaBlobs, TargetBlobs, analogBlobs, PVTable, target_DF = AAEI.BatchReport([\"genra_C10H16\",\r\n                                                                            \"genra_CH2O\",\r\n                                                                            \"genra_O3\",\r\n                                                                            \"genra_SO2\",\r\n                                                                            \"genra_NO2\",\r\n                                                                            \"genra_CO2\"],\r\n                                                                            entries=entries,\r\n                                                                            filename=\"Batch_Report\")\r\n```\r\nOnly PVTable is further used, this contains the per-assay-group and aggregated toxicity for each compound, this can be applied with relative ease.\r\nA lot of files will be exported in this step.\r\nNow we have a working index loaded, let's proceed with either generating or loading data and applying the index.\r\n\r\n#### load data or generate samples\r\nHere we will use the sample generator to generate at least all required samples for EUAQI and some more. The sample instantiator dictionary below shows values in ppb, except for pm10 and pm25 (pm2.5) (both in ug/m3).\r\n```\r\nsampleInstantiator = {\"C10H16\":{\"min\":0,\"max\":66872},\r\n                      \"CH2O\":{\"min\":0,\"max\":1339},\r\n                      \"O3\":{\"min\":0,\"max\":300},\r\n                      \"NO2\":{\"min\":0,\"max\":300},\r\n                      \"SO2\":{\"min\":0,\"max\":800},\r\n                      \"PM10\":{\"min\":0,\"max\":150},\r\n                      \"PM25\":{\"min\":0,\"max\":200},\r\n                      \"CO2\":{\"min\":4000000,\"max\":500000}}\r\n```\r\nThen Either load or generate data into a pandas dataframe with the column names: \"O3\" \"NO2\" \"SO2\" \"PM10\" \"PM25\" \"CO2\" \"C10H16\" \"CH2O\":\r\n##### Generate\r\n10 samples are generated `df = sampleGenerator(sampleInstantiator,10)`\r\n\r\n\u003cimg src=gfx/Original_Samples.png width=\"400\" height=\"300\" align=\"right\"\u003e\r\n\r\n\r\n##### Or Load\r\n In this edge case, PM10 and PM25 have to be in ug/m3 for the EUAQI comparison, otherwise make sure that everything is in the same units.\r\n```\r\ndf = pd.read_csv(\"data.csv\")\r\ndf.columns = [\"O3\", \"NO2\", \"SO2\", \"PM10\", \"PM25\", \"CO2\", \"C10H16\", \"CH2O\"]\r\n\r\n```\r\nAnd set the columns to the right name.\r\n\r\nNote that the 3 (CO2, limonene and formaldehyde are not implemented in EUAQI)\r\n\r\n##### Prepare data for later reversibility\r\nThis allows for later reversibility, but also to express toxicity equivalence over all species in the sample.\r\n\r\n`invStats = df.describe().drop([\"count\",\"25%\",\"50%\",\"75%\"])`\r\n\r\n#### procedure to apply to csv data\r\n\r\n1. Extract statistics for later reversibility\r\n2. Apply DynAEI to samples `res, normStats = impactSampling(df,PVTable)`\r\n\r\n##### Reversing function or expressing equivalence\r\n\r\nreverses the function, since it is not fully reversible this is only a approximation\r\n`res.T.iloc[len(df.T):len(df.T)*2].T.apply(directInverser, args=(invStats,res[\"sAgg\"],PVTable))`\r\n\r\n\u003cimg src=gfx/Recovered_Concentration_DynAEI.png width=\"400\" height=\"300\" align=\"right\" \u003e\r\n\r\nThe nice thing about this feature is the posibility to express Any toxicity into another, we can transponate everything to CO2 values, creating a CO2_Equivalent for all samples in the set.\r\nDo this with the following oneliner:\r\n`res.T.iloc[len(df.T):len(df.T)*2].T.apply(directInverser,args=(invStats,res[\"sAgg\"],PVTable,\"CO2\"))`\r\nTo explain this oneliner further:\r\n * `res.T.iloc` transponate the result, work with number indices\r\n * `len(df.T):len(df.T)*2` take a slice from the length of the original data upto twice original data (all DynAEI indices)\r\n * `.T.apply(directInverser,` Transponate it back and Apply the directInverser function\r\n * with the input arguments `args=(invStats,res[\"sAgg\"],PVTable,\"CO2\"))` from which `CO2` is optional, when nothing is given, the function tries to reverse the index. If a chemical name is given that is found in the index, all data is converted to that order of magnitude.\r\n\r\n##### Calculate EUAQI for sample\r\n\r\n```\r\neuaqi = DF_Apply_EUAQI(df)\r\neuaqi.plot()\r\n```\r\n\u003cimg src=gfx/calculated_EUAQI.png width=\"400\" height=\"300\" \u003e\r\n\r\n##### Heatmap comparing EUAQI with DynAEI\r\nTo make a fair comparison, DynAEI was scaled to the min and max of EUAQI; the result of each group is shown next to each other and the non-available chemicals in EUAQI are shown at the right.\r\n```\r\ndf_DynAEI_EUAQI = pd.concat([(res.T.iloc[8:].T*7),pd.DataFrame.from_records(euaqi)],axis=1)[Nice_Col_Order]\r\nstdHM(df_DynAEI_EUAQI)\r\n```\r\n\u003cimg src=gfx/Compared_EUAQI_DynAEI_hm.png width=\"400\" height=\"300\" align=\"right\"\u003e\r\n\r\n# Note To Self:\r\n:tada: :fireworks::tada:\r\n```bash\r\npython setup.py sdist\r\npip install .  # dry-run from folder\r\npip uninstall aaei # uninstall\r\npip install -e # install with symlink\r\ntwine upload dist/* #because pip doesn't work anymore for some magical reason.\r\n```\r\n\r\n:fireworks::tada: :fireworks:\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwabratseur%2Faaei","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkwabratseur%2Faaei","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwabratseur%2Faaei/lists"}