SoPH Faculty Article Counts

Setup:

Initialize workspace with some code imports, etc.


In [5]:
# Import dependencies
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import uuid
%matplotlib inline
from IPython.html import widgets
from IPython.display import display
from IPython.display import HTML
from IPython.display import Javascript
from sophcollab.namesearch import PubmedNameSearch

Input:

Enter a list of faculty member names in the text box below (copy/paste from source, etc). The names may be written as either '{first} {last}' or '{last}, {first}', but should only be one per line. Then click the 'Run Search' button to start the search for publication information.


In [2]:
data = None
# Display form input widgets
names_input = widgets.TextareaWidget()
names_input.description = "Enter faculty names (one per line)"
display(names_input)
run_btn = widgets.ButtonWidget(description="Run Search")
display(run_btn)
div_id = str(uuid.uuid4())
progress_bar = HTML(
"""
<div style="width: 500px;">
    <div id="%s" style="background-color: blue; width: 0%%; display: block">&nbsp;</div>
</div>
""" % div_id)

def update_progress_bar(num_complete, total_num):
    display(Javascript("$('div#%s').width('%i%%')" % (div_id, round(float(num_complete)/total_num*100))))
            
def on_run_button_clicked(btn):
    global data
    display(progress_bar)
    # Run the article count search for the list of names
    report = PubmedNameSearch(names_input.value.splitlines()).collaboration_report(update_progress_bar)
    if len(report["data"]) > 0:
        data = pd.DataFrame.from_dict(report["data"], 'index')
        data.columns=[report["labels"]]
    display(Javascript("$('div#%s').hide()" % (div_id)))

run_btn.on_click(on_run_button_clicked)

Output

Display the results of the search for article information for the faculty members.

Summary Statistics

Some simple summary statistics are shown below.


In [3]:
if data is not None:
    display(data.describe())
Faculty Listing

Full listing of article counts for the given list of faculty


In [4]:
display(data)


None

In [ ]: