collaborationnetworks

Programmatic queries of Entrez and Arxiv to build and visualize collaboration networks

https://github.com/srhoades10/collaborationnetworks

Science Score: 18.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (3.3%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

Programmatic queries of Entrez and Arxiv to build and visualize collaboration networks

Basic Info
  • Host: GitHub
  • Owner: srhoades10
  • Language: HTML
  • Default Branch: master
  • Size: 9.52 MB
Statistics
  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 6 years ago · Last pushed about 5 years ago
Metadata Files
Readme Citation

README.md

Publication Collaboration Networks

Programmatic queries of Entrez and Arxiv to build and visualize collaboration networks on published papers.

First, create lists of papers, co-authors, and the edges and nodes between authors via citationsAndcollaborations.py. First and last names are a matched pair of lists. It is recommended to cap the number of papers queried in a given year, as too many will not render well with plotly anyways.

Second, create a network visualization using networkD3 in citationsAndcollaborationsPlots.R. Swap in first and last names as needed, so long as the authors have first been compiled with the .py script.

Owner

  • Name: Seth Rhoades
  • Login: srhoades10
  • Kind: user
  • Location: Cambridge, MA

Biotech entrepreneur and healthcare data scientist. Operator of Fulgens Consulting at https://www.fulgensconsulting.com/

Citation (citationsAndcollaborations.py)

""" Query pubmed and Arxiv to generate citation/collaboration networks.

    Examples herein include Albert-Laszlo Barabasi, my (much sparser) network

    Default parameters are to limit the number of citations, and keep to within
    the past 5 years. First papers are extracted, followed by a search for
    coauthors. A network is then built from all authors (nodes), and their
    coauthorships (links).
    
    Author: Seth Rhoades """

import json, requests, re, time, sys, os
sys.path.append('./src')
import setup_citationsAndcollaborations as util
import pandas as pd

checkCitations = False
overwrite = False
resultDir = 'ref'

firstNames = ['Albert Laszlo', 'Seth']
lastNames = ['Barabasi', 'Rhoades']

for firstName, lastName in zip(firstNames, lastNames):
    try:
        fileFirstName = re.sub(r'\ ', '', firstName)
        fileLastName = re.sub(r'\ ', '', lastName)

        if ('{0}_{1}_Papers.json'.format(fileFirstName, fileLastName) not in os.listdir(resultDir)
            or overwrite == True):
            
            authorDict = util.fetchAuthor(firstName = firstName, lastName = lastName, 
                checkCitations = checkCitations, maxAnnualPapers = 36)
            with open('{0}/{1}_{2}_Papers.json'.format(resultDir, fileFirstName, fileLastName), 'w') as fout:
                json.dump(authorDict, fout, indent = 4)
                fout.write('\n')

        if ('{0}_{1}_ColabNet.json'.format(fileFirstName, fileLastName) not in os.listdir(resultDir)
            or overwrite == True):
            
            with open('{0}/{1}_{2}_Papers.json'.format(resultDir, fileFirstName, fileLastName), 'r') as fin:
                authorDict = json.load(fin)
            authorNet = util.oneDegreeAuthors(authorDict, firstName = firstName, 
                lastName = lastName, checkCitations = checkCitations, maxAnnualPapers = 36)
            with open('{0}/{1}_{2}_ColabNet.json'.format(resultDir, fileFirstName, fileLastName), 'w') as fout:
                json.dump(authorNet, fout, indent = 4)
                fout.write('\n')

        with open('{0}/{1}_{2}_ColabNet.json'.format(resultDir, fileFirstName, fileLastName), 'r') as fin:
            authorNet = json.load(fin)

        if ('{0}_{1}_OneDegreeNodes.csv'.format(fileFirstName, fileLastName) not in os.listdir(resultDir)
            or overwrite == True):

            nodeDF, edgeDF = util.buildCoauthorNodesEdges(authorNet)
            nodeDF.to_csv('{0}/{1}_{2}_OneDegreeNodes.csv'.format(resultDir, fileFirstName, fileLastName))
            edgeDF.to_csv('{0}/{1}_{2}_OneDegreeEdges.csv'.format(resultDir, fileFirstName, fileLastName))

    except Exception as err:
        print(str(err), '\n\n')
        continue

GitHub Events

Total
Last Year