AuthorSynth is a tool to query neuroSynth to associate authors with brain maps. Functions to query pubmed are included, but not used in the original implementation.
The first workflow (the python scripts in the top directory) works with the NeuroSynth database to create the maps, and the second workflow (the R scripts) use NeuroSynth to define a subset of functional behaviorally-relevant brain images, reduce these images to a 2D space, calculate match scores of the author brain maps to these images, and then display. All scripts for production of data for use in the authorSynth web interface are included.
This script will extract Authors from the NeuroSynth database, including Name, a unique ID, PI status, pmids, and number of publications, to create the data/authors.txt file.
This is the main module to import into a script that includes the following functions:
- neurosynthInit(dbsize): Takes "dbsize" (3000 or 525)
- getFeatures(db): returns features (behavioral terms)
- getArticles(author,email): returns dictionaries of dois nd pmids for author query ("Last FM")
- neurosynthMatch(db,papers,author,outdir,outprefix): matches papers to neurosynth and makes brain map
- getAuthor(db,pmid): returns list of authors for a single pmid or doi
- getAuthors(db): returns all authors in the NeuroSynth database
- getIDs(db): returns all pmid or doi from the NeuroSynth database
Includes examples for running authorSynth locally for one or more authors to create the brain maps
Includes examples for running authorSynth in a cluster environment using the authors in the authors.txt file. It works by submitting multiple jobs of:
Takes command line arguments uuid, author, email, outdirectory, and paper ids to batch process creation of author brain maps.
Usage : authorSynth_cluster.py uuid "author" email outdirectory id1,id2,id3
This second workflow moves the author brain maps through the particular analysis done to produce the visualizations in the current AuthorSynth web portal. You should only need the first workflow to produce author brain maps, and this second work flow is to reproduce the work in the authorSynth paper.
To understand the author brain maps on the level of behavior, we first use NeuroSynth to conduct meta analysis of functional studies, creating maps of 525 behaviorally relevant terms (eg, "anxiety") to describe what the neuroscience literature has to say about each terms in a brain image (FDR corrected .05, voxel values are Z scores of the probability of the term given activation). The workflow is as follows:
- Create pFgA maps from NeuroSynth database (these are in MNI 152 standard space) - these are not the author brain maps, but a set of behavioral maps you are interested in. It doesn't have to be NeuroSynth necessarily.
- Resample these images into 8mm to reduce the dimensionality
- Read these images into a matrix to make an SOM with:
Will read in NeuroSynth 8mm resampled images, create an SOM, save node coordinates and labels, use transformation matrix to sample back to 2mm images, and write SOM 2mm images to file.
- We then calculate match scores for our author brain maps to the SOM, and parse into matrices with:
calculates match scores of each authorBrain map to these SOM 2mm images
submits multiple of the above, intended to be run on the Sherlock Cluster at Stanford. Each run produces an output .Rda file with a vector of match scores of the authorMap to each of the SOM images, and this is done for several metrics, including:
- Euclidean Distance (euc)
- Cosine Distance (cos)
- Overlap of Author Map and SOM Map as a % of Author Map (func)
- Overlap of Author Map and SOM Map as a % of SOM Map (so)
reads in individual output files produced by matchToSOM, and compiles different match scores into group matrices.
Maps scores onto the SOM to make static images
Calculates author similarity based on being co-authors on same publication, output is json file to drive d3 network visualization.
Produces groups (colorings) of network based on different levels of clustering for exportD3.
Produces a single author json for the d3 visualization single author page
Produces data for the d3 lattice and author similarity comparison page.