matthiaskoenig / pkdb

Pharmacokinetics database
https://alpha.pk-db.com
30 stars 6 forks source link

References are not resolved correctly on study upload #619

Closed matthiaskoenig closed 3 years ago

matthiaskoenig commented 3 years ago

Somehow the automatic reference generation from PMID ids results in missing name fields on reference. See for example

upload_study -s studies/caffeine/Holstege1989
INFO --------------------------------------------------------------------------------
INFO Upload studies/caffeine/Holstege1989 to https://alpha.pk-db.com/api/v1
INFO --------------------------------------------------------------------------------
INFO - 0.10 [s] : Created TSVs ['Fig1', 'Fig2', 'Fig3', 'Tab4', 'TabData', 'TabGroups', 'TabIndividuals', 'TabInterventions']
INFO {'reference_path': PosixPath('studies/caffeine/Holstege1989'), 'pmid': 2921843}
WARNING 
{
  "name": [
    "This field is required."
  ]
}
INFO - 0.18 [s] : Upload references
INFO - 10.06 [s] : Upload files
WARNING 
{
  "Reference": "instance does not exist.",
  "detail": {
    "sid": "2921843"
  }
}
ERROR UPLOAD ERROR (check errors and warnings)
WARNING 
{
  "detail": "Not found."
}

To reproduce remove the reference.json and upload the study. Manually adding the name field fixes the issue (in pkdb_data).

adriankl commented 3 years ago

This happened again with the "date" field in reference.json of caffeine He2017

janekg89 commented 3 years ago

This happens if NCBI’s Entrez database does not contain a name or a date for a given pmid. What should be the expected behavior?

matthiaskoenig commented 3 years ago

Just provide an error message that date and name should be set manually for the reference. Currently the error message are not very informative. By providing clear information what should be done to the reference.json this should be easy to solve in the curation process.