OpenNeuroLab / brainspell-neo

Working on a new version of Brainspell (an open-source platform for neuroimaging literature) to make a public JSON API that collaborators can contribute to, switch out the stack for better scalability, and provide statistical features to better conduct meta-analyses.
MIT License
15 stars 6 forks source link

Implement endpoints for creating and updating collections #62

Closed Sharabesh closed 6 years ago

Sharabesh commented 6 years ago

An example of the JSON object that would be posted to the backend would be perfect.

neelsomani commented 6 years ago

Hey @Sharabesh, let's talk about the schema offline.

Here are the endpoints we're making:

POST:

Create collection takes:

Add-to-collection

Exclude-from-collection

Endpoints to update all global information

GET:

Article => collections + brainspell_version article + collection_id => collection_specific_article_information Collection_id => articles + metadata User_id => collection_ids

neelsomani commented 6 years ago

60 for reference

neelsomani commented 6 years ago

If a PMID isn't in the database when it's added to a collection, then add it

neelsomani commented 6 years ago

Example of JSON object: {"timestamp":null,"reference":"O\\'Connor AR, Han S, Dobbins IG (2010) J. Neurosci. 30(8):2924-34","experiments":[{"title":"","caption":"","locations":[],"id":90000,"kvPairs":[],"descriptors":[]},{"title":"","caption":"a caption (string)","locations":[{"x":"-36","y":"-60","z":"60","E":"4.79"},{"x":"-51","y":"-66","z":"39"},{"x":"-15","y":"-63","z":"69"},{"x":"36","y":"-72","z":"51"},{"x":"12","y":"-66","z":"66"},{"x":"48","y":"-30","z":"54"},{"x":"45","y":"-42","z":"63"},{"x":"-12","y":"-42","z":"27"},{"x":"-63","y":"-48","z":"-6"},{"x":"-66","y":"-30","z":"-3"},{"x":"-45","y":"-24","z":"-12"},{"x":"57","y":"-42","z":"-9"},{"x":"30","y":"-66","z":"12"},{"x":"-36","y":"15","z":"51"},{"x":"-42","y":"27","z":"36"},{"x":"-24","y":"-51","z":"-30"},{"x":"-36","y":"-60","z":"-30"},{"x":"-6","y":"-21","z":"-18"},{"x":"15","y":"-24","z":"-15"},{"x":"-9","y":"12","z":"0"},{"x":"12","y":"12","z":"12"},{"x":"9","y":"15","z":"-3"},{"x":"0","y":"-3","z":"9"},{"x":"0","y":"-33","z":"6"}],"id":90001,"kvPairs":[{"key":"foo","value":"bar"},{"key":"bar","value":"baz"}],"descriptors":["Attentional State","Preattentive Processing","Emotional Intelligence"],"effect":"Z","contrast":"a caption name (string)","include":true,"space":"MNI"},{"title":"","caption":"","locations":[{"x":"-27","y":"18","z":"-9"},{"x":"-30","y":"60","z":"3"},{"x":"-39","y":"6","z":"36"},{"x":"-12","y":"36","z":"60"},{"x":"-48","y":"36","z":"24"},{"x":"-45","y":"12","z":"54"},{"x":"27","y":"60","z":"18"},{"x":"-42","y":"-84","z":"-9"},{"x":"39","y":"-87","z":"-12"},{"x":"-30","y":"-96","z":"12"},{"x":"42","y":"-81","z":"6"},{"x":"-42","y":"-54","z":"42"},{"x":"-21","y":"-78","z":"42"},{"x":"42","y":"-54","z":"39"},{"x":"63","y":"-45","z":"-6"},{"x":"51","y":"-51","z":"6"},{"x":"21","y":"-15","z":"-12"},{"x":"-12","y":"-3","z":"18"},{"x":"15","y":"6","z":"-3"},{"x":"-6","y":"-30","z":"27"},{"x":"12","y":"33","z":"24"}],"id":90002,"kvPairs":[],"descriptors":[]}],"success":1,"authors":"O\\'Connor AR,Han S,Dobbins IG","pmid":"20181590","id":8846,"title":"The inferior parietal lobule and recognition memory: expectancy violation or successful retrieval?","doi":"10.1523/JNEUROSCI.4225-09.2010","abstract":"Functional neuroimaging studies of episodic recognition demonstrate an increased lateral parietal response for studied versus new materials, often termed a retrieval success effect. Using a novel memory analog of attentional cueing, we manipulated the correspondence between anticipated and actual recognition evidence by presenting valid or invalid anticipatory cues (e.g., \\\"likely old\\\") before recognition judgments. Although a superior parietal region demonstrated the retrieval success pattern, a larger inferior parietal lobule (IPL) region tracked the validity of the memory cueing (invalid cueing > valid cueing) and no retrieval success-sensitive lateral parietal region was insensitive to cueing. The invalid cueing response occurred even for correctly identified new items unlikely to trigger substantive episodic retrieval. Within the IPL, although supramarginal and angular gyrus (SMG; AG) regions both demonstrated invalid cueing amplitude elevations, each region differentially coupled with distinct cortical networks when unexpectedly old items were encountered; a connectivity pattern also observed at rest in the same subjects. These findings jointly suggest that the lateral parietal response during recognition does not signify the recovery of episodic content, but is a marker of the violation of memory expectations. A second independent dataset confirmed this interpretation by demonstrating that SMG activation tracked the decision biases of observers, not their accuracy, with increased activation for nondominant recognition judgments. The expectancy violation interpretation of the lateral parietal recognition response is consistent with the literature on visual search and oddball paradigms and suggests that damage to these regions should impair memory-linked orienting behavior and not retrieval per se.","metadata":{"space":"MNI","meshHeadings":[{"name":"Adult","majorTopic":"N"},{"name":"Attention","majorTopic":"N"},{"name":"Brain Mapping","majorTopic":"N"},{"name":"Cognition","majorTopic":"N"},{"name":"Cues","majorTopic":"Y"},{"name":"Dominance, Cerebral","majorTopic":"N"},{"name":"Executive Function","majorTopic":"N"},{"name":"Female","majorTopic":"N"},{"name":"Humans","majorTopic":"N"},{"name":"Judgment","majorTopic":"N"},{"name":"Magnetic Resonance Imaging","majorTopic":"N"},{"name":"Male","majorTopic":"N"},{"name":"Memory","majorTopic":"N"},{"name":"Neural Pathways","majorTopic":"N"},{"name":"Neuropsychological Tests","majorTopic":"N"},{"name":"Parietal Lobe","majorTopic":"N"},{"name":"Recognition (Psychology)","majorTopic":"N"},{"name":"Young Adult","majorTopic":"N"}]},"neurosynthid":"5560","N":"19"}

neelsomani commented 6 years ago

Rough representations for collections and articles in collections:

Collection {
    name: _____
    description: ______
    pmids: [234234, 4234234, ...]
    exclusion_criteria: ["", "", ...]
    inclusion_criteria: ["", "", ...]
    tags: ["", "", ...]
    search_strings: ["", "asdf", ...]
}

CollectionArticle {
    excluded_flag: true/false
    exclusion_reason: ""
    experiments: {
        experiment1_id: {
            excluded_flag: true/false
            exclusion_reason: "",
            key_value_pairs: {
                key: value,
                key2: value2,
                ...
            }
        },
        ...
    }
}

GitHub repo for each collection: one file in the repo for metadata, and one file for each PMID in the collection