Mendeley est un outil d’aide aux chercheurs pour organiser les références qu’ils consultent. Mendeley dispose d’une API. Ce billet rend compte des premiers essais effectués avec cette API. Je vais accéder à quelques données depuis un programme Python.
Il est nécessaire d’avoir un compte sur Mendeley; c’est possible sans payer.
Ensuite, depuis ce compte, il faut déclarer une application; ça se passe ici.
Mendeley utilise OAuth pour authentifier les utilisateurs de son API.
Après avoir déclaré l’application, il faut obtenir un ‘token’ ici. Il s’agit d’une longue chaîne de caractères qui va être utilisée dans les appels à l’API; sa durée de validité est de une heure (au moment de l’écriture de ce billet).
Ici, j’illustre l’accès aux informations concernant un document désigné par son numéro DOI.
import json import urllib import data.privateConfig as pConf mendeleyApiAccess = "https://api.mendeley.com/" # token obtenus ici: https://mendeley-show-me-access-tokens.herokuapp.com # ici stocké dans un fichier de configuration # Access a durée de vie 1h token = pConf.mendeleyToken urlquery = mendeleyApiAccess+'catalog?doi=10.1103/PhysRevA.20.1521' headers = {'Authorization': 'Bearer ' + token} req = urllib.request.Request(urlquery, None, headers) with urllib.request.urlopen(req) as rep: results = json.loads(str(rep.read().decode('utf-8'))) print(results)
Ce qui me donne le résultat suivant:
[{ "title": "Laser cooling of atoms", "type": "journal", "authors": [ { "first_name": "D. J.", "last_name": "Wineland", "scopus_author_id": "7006041778" }, { "first_name": "Wayne M.", "last_name": "Itano", "scopus_author_id": "7005352566" } ], "year": 1979, "source": "Physical Review A", "identifiers": { "isbn": "9788578110796", "doi": "10.1103/PhysRevA.20.1521", "sgr": "33749570604", "pmid": "25246403", "pui": "209086317", "issn": "10502947", "arxiv": "arXiv:1011.1669v3", "scopus": "2-s2.0-33749570604" }, "id": "04d48d5f-d664-3a17-b004-1503cca53802", "abstract": "Predicting the binding mode of flexible polypeptides to proteins is an important task that falls outside the domain of applicability of most small molecule and protein−protein docking tools. Here, we test the small molecule flexible ligand docking program Glide on a set of 19 non-α-helical peptides and systematically improve pose prediction accuracy by enhancing Glide sampling for flexible polypeptides. In addition, scoring of the poses was improved by post-processing with physics-based implicit solvent MM- GBSA calculations. Using the best RMSD among the top 10 scoring poses as a metric, the success rate (RMSD ≤ 2.0 Å for the interface backbone atoms) increased from 21% with default Glide SP settings to 58% with the enhanced peptide sampling and scoring protocol in the case of redocking to the native protein structure. This approaches the accuracy of the recently developed Rosetta FlexPepDock method (63% success for these 19 peptides) while being over 100 times faster. Cross-docking was performed for a subset of cases where an unbound receptor structure was available, and in that case, 40% of peptides were docked successfully. We analyze the results and find that the optimized polypeptide protocol is most accurate for extended peptides of limited size and number of formal charges, defining a domain of applicability for this approach.", "link": "http://www.mendeley.com/research/laser-cooling-atoms-1" }]
Si on remplace la valeur de la variable urlquery par
urlquery = mendeleyApiAccess+'search/profiles?query=Jean-Claude%20Moissinac'
On va trouver les ‘profils’ définis dans Mendeley et qui ont un lien avec ‘Jean-Claude Moissinac’. La requête fournit de nombreuses informations: affiliation, quelques domaines d’intérêt, photos, localisation…
Un ensemble de données intéressantes pour compléter l’information sur les chercheurs dans le projet SemBib!