Hi Taylor,
I didn’t use the fetch call, I downloaded from the Neurosynth repo – it said it was updated 6 days ago the day I downloaded. The output from print(neurosynth_db):
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘neurosynth_db’ is not defined
The script (I’m banned from attachments as a new user):
Start with the necessary imports
--------------------------------
import os
from pprint import pprint
import nimare
###############################################################################
Download Neurosynth
-------------------
out_dir = os.path.abspath("/Users/jenniferbarredo/neurosynth-data-master/")
os.makedirs(out_dir, exist_ok=True)
files = nimare.extract.fetch_neurosynth(
path=out_dir,
version=“7”,
overwrite=False,
source=“abstract”,
vocab=“terms”,
)
pprint(files)
neurosynth_db = files[0]
###############################################################################
Convert Neurosynth database to NiMARE dataset file
--------------------------------------------------
neurosynth_dset = nimare.io.convert_neurosynth_to_dataset(
database_file=neurosynth_db[“database”],
annotations_files=neurosynth_db[“features”],
)
neurosynth_dset.save(os.path.join(out_dir, “neurosynth_dataset.pkl.gz”))
print(neurosynth_dset)
###############################################################################
Add article abstracts to dataset
--------------------------------
This is only possible because Neurosynth uses PMIDs as study IDs.
Make sure you replace the example email address with your own.
neurosynth_dset = nimare.extract.download_abstracts(neurosynth_dset, “jennifer_barredo@brown.edu”)
neurosynth_dset.save(os.path.join(out_dir, “neurosynth_dataset_with_abstracts.pkl.gz”))