-
set your email address in environment variable 'EMAIL'. This variable will be used when fetching data from NCBI.
In bash (use your email address):
export EMAIL='example@example.com'
-
install the required python modules
In bash:
virtualenv venv source venv/bin/activate pip install -r requirements.txt
-
run python script
network.py
In bash (here is an example):
python network.py 27549193 "Li, Bo"
The number
27549193
is a pubmed article id, and "Li, Bo" is the full name of the first author of that article. If the last parameter is not set, the first author will be chosen.Alternatively, if you are confident that there is no duplicate name for the specified author in pubmed, the pubmed auticle id can be omitted (however, it's not recommended for Chinese names). Here is an example:
python network.py "Yan, Xiyun"
After running this command, a folder called 'network' will be generated in the current directory. There should be three files in that folder,
network.sif
,node.csv
andedge.csv
, and they can be imported to cytoscape for visualization. See the files in directory 'example' for example output and the rendered image. -
generate interactive network using
networkD3.R
In bash:
Rscript networkD3.R
This R script will use related files (i.e.
node.csv
andedge.csv
) in the 'network' directory, and generate a html file callednetwork.html
in it. Then this web page could be opened in any modern browser to show the final network. If anything goes wrong, you should first checkout that tidyverse and networkD3 are installed in your R environment.Here is a live example: https://rawgit.com/jzsh2000/author-network/master/example/network.html
- paper - generate a plot for an author's publications
- word-cloud - generate a word-cloud image for the abstracts of an author's publications