Co-publication graph#
Your first lab#
In GISMAP, a Lab is a class whose instances have two methods:
update_authors
automatically refresh the members of the lab. It is useful at creation or when a lab evolves.update_publications
makes a full refresh of the publications of a lab. All publications from lab members are considered (temporal filtering may be enabled later).
The simplest usable subclass of Lab is ListLab
, which uses a list of names. For example, consider the executive committee of the LINCS lab plus Fabien Mathieu (GISMAP author).
[6]:
from gismap.lab import ListLab
lab = ListLab(
author_list=[
"Tixeuil Sébastien",
"Mathieu Fabien",
"Kofman Daniel",
"Baccelli François",
"Noirie Ludovic",
"Bassi Francesca",
],
name="toy_example",
)
lab.update_authors()
lab.authors
[6]:
{'tixeuil': LabAuthor(name='Tixeuil Sébastien', metadata=AuthorMetadata()),
'fabien-mathieu': LabAuthor(name='Mathieu Fabien', metadata=AuthorMetadata()),
'daniel-kofman': LabAuthor(name='Kofman Daniel', metadata=AuthorMetadata()),
'francois-baccelli': LabAuthor(name='Baccelli François', metadata=AuthorMetadata()),
'ludovic-noirie': LabAuthor(name='Noirie Ludovic', metadata=AuthorMetadata()),
'francesca-bassi': LabAuthor(name='Bassi Francesca', metadata=AuthorMetadata())}
[7]:
lab.update_publis()
len(lab.publications)
[7]:
939
Labs can be saved to you don’t have to re-update them all the time.
[8]:
lab.dump(lab.name)
File toy_example.pkl.zst already exists! Use overwrite option to overwrite.
When you have a populated lab, you can use lab2graph
to create the collaboration graph. That graph is a standalone HTML that can be displayed in a notebook or saved for inclusion in a web page (iframe
is recommended then).
[9]:
from gismap.lab import lab2graph
from IPython.display import display, HTML
display(HTML(lab2graph(lab)))
Few things about the generated graph:
Singletons (authors with no co-publications) are discarded by default.
Authors are represented with their initials unless some picture url is provided.
You can hover an author to get her name. If you click, you have a modal with the list of publications.
The width and length of an edge depend on the number of co-publications. If you click you have a modal with the list of co-publications.
Make your own lab#
The easiest way to manage a lab is to specify an internal method _author_iterator
that returns Lab authors.
To GISMAP a lab, you just need to specify that method. Most of the time, this is done by scrapping some Web page(s). See the references for examples.
Example#
The LaasLab
class automatically builds a lab representation from https://www.laas.fr/fr/equipes/*team_name*/
[10]:
from gismap.lab import LaasLab
display(HTML(lab2graph(LaasLab.load("sara"))))