Skip to content

Instantly share code, notes, and snippets.

View hpiwowar's full-sized avatar

Heather Piwowar hpiwowar

View GitHub Profile
import urllib2
import datasources
from datasources import pubmed
from datasources import urlopener
def test_get_pmids_from_gist_query():
gist_url = "http://gist.github.com/raw/377863/fba998429b36d07c304a28a07c4dfde592b0c4f7/sensorimotor_fmri_pubmed_query.txt"
response = get_pmids_from_gist_query(gist_url)
assert_equals(response[0:5], ['20092581', '20055536', '20053105', '20053076', '20037218'])
assert_equals(len(response), 2851)
((Amygdala OR Emotional OR emotionally[Title/Abstract] OR (Facial Expression[mesh]) OR faces[Title/Abstract] OR facial[Title/Abstract] OR Affect[mesh]) NOT (visual[Title/Abstract] OR (Motor Cortex[mesh]) OR superior_temporal[Title/Abstract] OR movement[Title/Abstract] OR (Visual Cortex[mesh]) OR occipital[Title/Abstract])) AND
((("humans"[mesh] AND "magnetic resonance imaging"[mesh] AND Journal Article[ptyp] NOT "mental disorders"[mesh] AND ("fmri"[Title/Abstract] OR "Functional MRI"[Title/Abstract] OR "Functional magnetic resonance imaging"[Title/Abstract] OR "Functional MR Imaging"[Title/Abstract])) NOT (Editorial[ptyp] OR Letter[ptyp] OR Meta-Analysis[ptyp] OR Practice Guideline[ptyp] OR Review[ptyp] OR Case Reports[ptyp] OR Comment[ptyp] OR Corrected and Republished Article[ptyp]) AND ("1991"[PDAT] : "2009"[PDAT]) AND English[lang]))
(((Temporal Lobe[mesh]) OR (Prefrontal Cortex[mesh]) OR (Pattern Recognition, Visual[mesh]) OR (Visual Perception[mesh]) OR semantic[Title/Abstract] OR "left inferior"[Title/Abstract] OR memory[Title/Abstract] OR Memory[mesh]) NOT (motor_cortex[Title/Abstract] OR primary_motor[Title/Abstract] OR Somatosensory Cortex[mesh] OR visual_cortex[Title/Abstract] OR somatosensory[Title/Abstract] OR Motor Cortex[mesh])) AND (("humans"[mesh] AND "magnetic resonance imaging"[mesh] AND Journal Article[ptyp] NOT "mental disorders"[mesh] AND ("fmri"[Title/Abstract] OR "Functional MRI"[Title/Abstract] OR "Functional magnetic resonance imaging"[Title/Abstract] OR "Functional MR Imaging"[Title/Abstract])) NOT (Editorial[ptyp] OR Letter[ptyp] OR Meta-Analysis[ptyp] OR Practice Guideline[ptyp] OR Review[ptyp] OR Case Reports[ptyp] OR Comment[ptyp] OR Corrected and Republished Article[ptyp]) AND ("1991"[PDAT] : "2009"[PDAT]) AND English[lang])
(((Somatosensory Cortex[mesh]) OR somatosensory[Title/Abstract] OR "primary motor"[Title/Abstract] OR "primary visual"[Title/Abstract] OR sensorimotor[Title/Abstract] OR "motor area"[Title/Abstract] OR oxygenation[Title/Abstract] OR (Motor Cortex[mesh]) OR "visual cortex"[Title/Abstract] OR (Acoustic Stimulation[mesh])) NOT (memory[Title/Abstract] OR Memory[mesh] OR (Prefrontal Cortex[mesh]) OR Cognition[mesh] OR prefrontal[Title/Abstract] OR dorsolateral[Title/Abstract]))
AND (("humans"[mesh] AND "magnetic resonance imaging"[mesh] AND Journal Article[ptyp] NOT "mental disorders"[mesh] AND ("fmri"[Title/Abstract] OR "Functional MRI"[Title/Abstract] OR "Functional magnetic resonance imaging"[Title/Abstract] OR "Functional MR Imaging"[Title/Abstract])) NOT (Editorial[ptyp] OR Letter[ptyp] OR Meta-Analysis[ptyp] OR Practice Guideline[ptyp] OR Review[ptyp] OR Case Reports[ptyp] OR Comment[ptyp] OR Corrected and Republished Article[ptyp]) AND ("1991"[PDAT] : "2009"[PDAT]) AND English[lang])