Source Code of Bibtex Graph Generator

Now I would like to release the source code of the software described in an earlier post. The package will be released under the GNU General Public License, any release of other software which includes the full source code or parts of it must also be released under the GPL.

The software is running with python 2.7.9 (Python 3 is not supported) and requires PyGraphViz 1.3rc2 and BibtexParser 0.6.2.

The program includes three main data structures: the list of all publications from the Bibtex file, a list of authors, and a list of relations. The latter two are implemented as python classes. As first step, the full bibtexfile is parsed into an array of dictionaries with the package BibtexParser. Second, the author list is created by iterating over all publications and authors in the bibtex database. Third, the relationsship array is created with entries for all combinations of two authors A and B by iterating over the publications list and checking if both A and B are author of a specific publication. The the graph is constructed by adding nodes for each author and edges for all relations. As a last step, the graph is compacted by constraints given as arguments. Two short examples follow to describe such kind of constraints. The parsed bibtexfile is included in the published package.

Starting it without any argument will show the license info and the help.

A Graph Display Software for bibtex databases
 
 Copyright (C) 2015 Benjamin Laemmle, jdmorise a t yahoo.com
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 GNU General Public License for more details.
 You should have received a copy of the GNU General Public License 
along with this program. If not, see <http://www.gnu.org/licenses/>. 

usage: "Examples:

optional arguments:
 -h, --help show this help message and exit
-if INPUT_FILENAME, --input_filename INPUT_FILENAME 
          Filename of publication database in bibtex format
-gf GRAPH_FILENAME, --graph_filename GRAPH_FILENAME    
          Filename of graph output stored as png
-ma MAIN_AUTHOR_NAME, --main_author_name MAIN_AUTHOR_NAME
-ert EDGE_RELATION_THRES, --edge_relation_thres EDGE_RELATION_THRES
          Only add edges with ERT or more number of relations
-art AUTHOR_RELATION_THRES, --author_relation_thres AUTHOR_RELATION_THRES
          Only add authors with ART or more number of relations
-apt AUTHOR_PUBLICATION_THRES, --author_publication_thres AUTHOR_PUBLICATION_THRES
          Only add authors with APT number of publications
-lvl LEVEL, --level LEVEL
-b BEFORE, --before BEFORE     
          Only use Publications before YEAR for the graph
-a AFTER, --after AFTER
          Only use Publications after YEAR for the graph
-gp GRAPH_PROGRAMM, --graph_programm GRAPH_PROGRAMM
          Graph Programm for rendering the graph. one of the
          following: fdp,dot,sfdp,circo,twopi.

 

 

The first example was created without any filter, just specifying the input database and the output picture:

python graph_coaut_bibtex.py -if Darabi.bib -gf graph_plain.png

graph_plain

Now, in the second example the filters are explained in more detail. First, we would like to see only direct relations between an author and anybody else, so only direct collaboration. This is achieved by specifying the “main author” (-ma “A. Mirzaei” )  and the collaboration “level” (-lvl 1). Then, we would like to remove all authors with less than three publications (e.g. P. Suri) by adding an “author publication threshold” (-apt 3). To make it more readable, we also remove all edges with less than three relations by specyfing an “edge relation threshold” (-ert 3), which removes a couple of authors like K. Juan.

python graph_coaut_bibtex.py -if Darabi.bib -gf graph_red.png 
-ma "A. Mirzaei" -lvl 1 -apt 3 -ert 3

The reduced graph is shown below with only a limited amount of authors remaining.

graph_red

Additional arguments include an “author relation threshold”(-art) to remove all authors with only few relations, and you can filter by publication date by specifying a certain range. As a last argument, the graph generation programm can be selected (-gp) where fdp is chosen as default. The GraphViz documentation will give more details about the examples.

The python code can be found together with the example bibtexfile and the license file in my DropBox. Have fun!

Male and Female Coauthors of #TimHunt

After allegation of sexist , Nobel Prize Winner and Tim Hunt resigned as honorary professor from UCL. I wanted to look into his web of relations as described in the last posts, his coauthored publications, and display the names together with the information of the sex of the author.

Tim Hunt started his academic career 50 years ago in 1964 in Cambridge In this time, he authored a huge amount of publications, he has an h-factor of 74 and an i-10 factor of 157 according to Google Scholar. Hunt_100_2I want to show in the following pictures how many female scientists he worked with and how many female coauthors he had during his time. The bibliographic data of the 100 most important publications (most cited in general) was fetched from Google Scholar and processed with the Graph Analysis Tool presented in earlier posts.

The first graph on the left side shows all authors with more than 2 coauthored publications. We can clearly see, that Tim authored his publications with many different authors, which all have a low number of shared publications. The highest number of publications (10) he authored with Julian Gannon.

The figure with at least 2 publications shows 15 female out of 53 authors, which is roughly 28%. Looking at 3 or 4 coauthored publications, we also count 7 out of 24 (29%) and 5 out of 17 (29%) women, respectively. Stating that, it seems like important academic work of Tim Hunt was done by women, roughly 30% of the important authors are women.

Now, plotting all authors, we get a huge web ob people with a total number of 203 authors and 688 relationships. In this list, there are many international names, sometimes it’s hard to identify if the belongs to a man or women. Forgive me (and please correct me), when there are minor errors. Out of the 203 authors, 63 are women, which is a slightly higher percentage than before, 31%.

Hunt_100_1

Now, according to the article “Research reveals a gender gap in the nation’s biology labs” from MIT, the actual precetange of post-docs, assistant professors, and full professors is 40%,  36%, and 18%, respectively. The report also states, that “between 1969 and 2009, the percentage of doctoral degrees awarded to women in the life sciences grew from 15 percent to 52 percent, but women still lag when it comes to faculty appointments.”

Assuming that the publications cover the full timeline from the beginning to Hunt’s career until now with a higher number of older publications (as they are probably cited more often), the number of 30% women matches the numbers reported from that time.

Studying Research Dynamics of an Author with Timed Filters

A very interesting topic in research about science is the chronological dynamic of publications. The question of interest is how a specific scientist is developing with respect to his publications and with respect to his network. In order to study publications dynamics, the prloudos_2001esented graph program can filter the publication date of the drawn nodes and edges with a before and after filter.

For presentation purposes, a bibtex database available in the internet was chosen from the Biomedical Simulations and Imaging Laboratory at NTUA, Athens, Greece. The relationsships of George Loudos, now Assistand Professor at the Department of Biomedical Engineering, TEIATH, Greece are studied and plotted for the folllowing three graphs. His scientific career started in 2000, when he had two conference publications.

One year later, he already has 9 publications and a much broader network. On the one hand, we see a group of people which contributed to 7 out of his 9 publications in this period. This seems to be the PhD colleagues ind his group, who either had a close collaboration and a shared topic or who just put their names on each others publications. On the other hand, we see a new connection to authors with a high number of publications on the left side. These seems to be important guys in this field, George Matsopoulos for example was a professor in the field of computer science.

loudos_2002

Timed filters offers a powerful and intuititive tool which gives detailed information how an author build up his network and which people are involved in his research. As shown in the last figures, his major buddies can be identified by scientists which share many or most of the publications. Important contributors and Scientist with higher rank are shown by authors with a high number of publications but a low number of relations.

Which kind of research you would like to conduct? Send me your bibtex file and I can present the outcomes in this blog.

Graph Display Software for Author Relationships with Bibtex Files

Now, I just introduced last week the idea of looking at author relationsships by a graph with a short example. In this post I want to further explain my approach to create such kind of figures. The first requirement is a valid base of data in forms of bibliographic information.

As a bibliography file in form a bibtex database was readily available, the first version of my graph display software is working with bibtex files as source. In a later post, it will be shown how databases can be easily created by automatic parsing of google scholar or other sources.

The created python software reads the bibtexfile, creates a list of authors and a list of relationsships. From these two lists, it creates a graph with nodes and edges and invokes the graphviz software to draw the graph and export it as a png file. The python lib pygraphviz is used as interface for graphviz which includes classes for creation and analysis of graphs, nodes, and edges.

An example of a graph for my bibtex database from my phd thesis is shown below. We can see many different authors and a very complex structure of relationships (along with some bugs as authornames are written differently in publications, e.g. Jager and Jaeger).

graph6

We see most authors are in a cloud and only some authors have no connection to others at all. Now, in order to get a better visibility of the graph, the following simple filters are available:

1. Authors with number of publication under a specific thmmWave3_51reshold are filtered

2. Authors with number of relations lower than a threshold are removed

3. Edges with lower weight than a threshold are removed.

These filters are very powerful to reduce complexity of the figure. In order to find main contributors to an area, authors with small amount of publications can be removed, which are mostly PhD students with only a short time in research.

Additionaly, a specific author can be marked as main author and only authors with specific neighbourhood level are printed. In this way, only direct neighbors, or  authors over two edges are printed.

Here I wanted to study the network around professor S. Voinigescu from University of Toronto and his direct network and removed all authors with only one publication.

What kind of filters do you want to see for the graph display software? In what kind of research about research are you interested? I’m curious about your feedback.

Graph visualization for author relationships in scientific publications

A graph is a powerful tool to study objects and their relationship to each other. It consists of nodes, which are some kind of objects, and edges between these nodes. The latter one represent some kind of relationsship between the nodes. The relationsship can be directional, which might be a higher rank (like in parent – children relationship), or effect and cause relationsship. They can also be bidirectional, like in marriage, where it is only connected.

Such a graph can be used to study relationsships between authors of scientific publications. Having co-authored a publication with somebody else means some kind of collaboration in the form of a joined research project, funding of projects, visits as guest to other institutes, or something else. Higher amount of co-authored publications in general means a high level of cooperation, for example a collaboration between two institutes lasting several years.

In order to identify key contributors to a certain area of interest, an author with a high number of publications and a high number of edges to other authors. This statement is controversial, as major contributions to specific areas have been done with a small amount of publications of only a small amount of authors. But let’s keep that aside and remember it for a later discussion with the results of the conducted research

1st Graph This is an example of such a graph showing several authors and their relation to each other. The authors are drawn in blue with a label including the number of their publications. The co-authored publications are marked with red edges between the authors, where a label and the line thickness is showing the number of it. In the example shown above, the major contributor is A. Darabi, other major authors are A. Abidi and A. Mirzai.

In the following posts, I will give more detail of how to create and draw such a graph, how to get the data, and how to filter the results for better visibility of the figure.

What do you think of the approach in general? What kind of research can be done with such graphs? I would be happy to start a discussion!