From 7a84982a5a71defe90ef0fe88e43f1bfad30b3c9 Mon Sep 17 00:00:00 2001 From: Nicholas Lee Date: Sun, 5 Jan 2025 18:00:56 -0800 Subject: [PATCH] chore: added tests for ordering --- .../pages/MetaAnalysis/MetaAnalysisPage.tsx | 6 +- .../src/pages/MetaAnalysis/Nimare.helpers.ts | 84 ++- .../DisplayMetaAnalysisResults.spec.tsx | 135 +++- .../components/DisplayMetaAnalysisResults.tsx | 65 +- .../components/DisplayParsedNiMareFile.tsx | 7 +- .../src/testing/mockData.ts | 694 ++++++++++++++++++ 6 files changed, 912 insertions(+), 79 deletions(-) diff --git a/compose/neurosynth-frontend/src/pages/MetaAnalysis/MetaAnalysisPage.tsx b/compose/neurosynth-frontend/src/pages/MetaAnalysis/MetaAnalysisPage.tsx index b706ca2f..0b3fa08a 100644 --- a/compose/neurosynth-frontend/src/pages/MetaAnalysis/MetaAnalysisPage.tsx +++ b/compose/neurosynth-frontend/src/pages/MetaAnalysis/MetaAnalysisPage.tsx @@ -3,7 +3,6 @@ import NeurosynthBreadcrumbs from 'components/NeurosynthBreadcrumbs'; import StateHandlerComponent from 'components/StateHandlerComponent/StateHandlerComponent'; import TextEdit from 'components/TextEdit/TextEdit'; import { useGetMetaAnalysisById, useGetMetaAnalysisResultById } from 'hooks'; -import useGetSpecificationById from 'hooks/metaAnalyses/useGetSpecificationById'; import useUpdateMetaAnalysis from 'hooks/metaAnalyses/useUpdateMetaAnalysis'; import useUserCanEdit from 'hooks/useUserCanEdit'; import { ResultReturn, SpecificationReturn, StudysetReturn } from 'neurosynth-compose-typescript-sdk'; @@ -47,11 +46,8 @@ const MetaAnalysisPage: React.FC = () => { : undefined ); - const { data: specification } = useGetSpecificationById( - (metaAnalysis?.specification as SpecificationReturn | undefined)?.id - ); - // get request is set to nested: true so below casting is safe + const specification = metaAnalysis?.specification as SpecificationReturn; const studyset = metaAnalysis?.studyset as StudysetReturn; const annotation = metaAnalysis?.annotation as NeurostoreAnnotation; diff --git a/compose/neurosynth-frontend/src/pages/MetaAnalysis/Nimare.helpers.ts b/compose/neurosynth-frontend/src/pages/MetaAnalysis/Nimare.helpers.ts index 4bf52d32..9c66a854 100644 --- a/compose/neurosynth-frontend/src/pages/MetaAnalysis/Nimare.helpers.ts +++ b/compose/neurosynth-frontend/src/pages/MetaAnalysis/Nimare.helpers.ts @@ -1,80 +1,88 @@ // this is organized as an array to make it orderable. Order is obtained from: https://nimare.readthedocs.io/en/stable/outputs.html#file-names export const NimareOutputs = [ - // possible value types - { type: 'z', isValueType: true, description: 'Z-statistic' }, - { type: 't', isValueType: true, description: 'T-statistic' }, - { type: 'p', isValueType: true, description: 'p-value' }, - { type: 'logp', isValueType: true, description: 'Negative base-ten logarithm of p-value' }, - { type: 'chi2', isValueType: true, description: 'Chi-squared value' }, - { type: 'prob', isValueType: true, description: 'Probability value' }, + // possible data types + { key: 'z', label: 'type', description: 'Z-statistic' }, + { key: 't', label: 'type', description: 'T-statistic' }, + { key: 'p', label: 'type', description: 'p-value' }, + { key: 'logp', label: 'type', description: 'Negative base-ten logarithm of p-value' }, + { key: 'chi2', label: 'type', description: 'Chi-squared value' }, + { key: 'prob', label: 'type', description: 'Probability value' }, { - type: 'stat', - isValueType: true, + key: 'stat', + label: 'type', description: 'Test value of meta-analytic algorithm (e.g., ALE values for ALE, OF values for MKDA)', }, - { type: 'est', isValueType: true, description: 'Parameter estimate (IBMA only)' }, - { type: 'se', isValueType: true, description: 'Standard error of the parameter estimate (IBMA only)' }, - { type: 'tau2', isValueType: true, description: 'Estimated between-study variance (IBMA only)' }, - { type: 'sigma2', isValueType: true, description: 'Estimated within-study variance (IBMA only)' }, - { type: 'label', isValueType: true, description: 'Label map' }, + { key: 'est', label: 'type', description: 'Parameter estimate (IBMA only)' }, + { key: 'se', label: 'type', description: 'Standard error of the parameter estimate (IBMA only)' }, + { key: 'tau2', label: 'type', description: 'Estimated between-study variance (IBMA only)' }, + { key: 'sigma2', label: 'type', description: 'Estimated within-study variance (IBMA only)' }, + { key: 'label', label: 'type', description: 'Label map' }, // KVPs that describe the methods applied to generate the meta analysis { - type: 'desc', - isValueType: false, + key: 'desc', + label: 'description', description: 'Description of the data type. Only used when multiple maps with the same data type are produced by the same method.', }, { - type: 'level', - isValueType: false, + key: 'level', + label: 'level', description: 'Level of multiple comparisons correction. Either cluster or voxel.', }, { - type: 'corr', - isValueType: false, + key: 'corr', + label: 'correction', description: 'Type of multiple comparisons correction. Either FWE (familywise error rate) or FDR (false discovery rate).', }, { - type: 'method', - isValueType: false, + key: 'method', + label: 'method', description: 'Name of the method used for multiple comparisons correction (e.g., “montecarlo” for a Monte Carlo procedure).', }, { - type: 'diag', - isValueType: false, + key: 'diag', + label: 'diagnostic', description: 'Type of diagnostic. Either Jackknife (jackknife analysis) or FocusCounter (focus-count analysis).', }, { - type: 'tab', - isValueType: false, + key: 'tab', + label: 'table', description: 'Type of table. Either clust (clusters table) or counts (contribution table).', }, - { type: 'tail', isValueType: false, description: 'Sign of the tail for label maps. Either positive or negative.' }, + { key: 'tail', label: 'tail', description: 'Sign of the tail for label maps. Either positive or negative.' }, ]; -export const parseNimareFileName = (fileName: string | undefined | null) => { +export const parseNimareFileName = ( + fileName: string | undefined | null +): { key: string; label: string; description: string; value: string }[] => { // we expect filenames of the form: z_desc-somedescription_level-voxel_corr-fwe_method-montecarlo.nii.gz if (!fileName) return []; const segments = fileName.replace('.nii.gz', '').split('_'); return segments.map((segment) => { const [key, value] = segment.split('-'); - const nimareOutput = NimareOutputs.find((output) => output.type === key); - if (value === undefined) { - // value type, not a meta analysis method or descriptor + const associatedNimareOutput = NimareOutputs.find((output) => output.key === key); + + if (associatedNimareOutput === undefined) { + // unrecognized KVP in file name return { - key: 'type', - isValueType: nimareOutput?.isValueType || false, - keyDesc: 'The type of data in the map.', - value: nimareOutput?.type || '', + key: key, + label: 'unknown field', + description: '', + value: key, + }; + } else if (value === undefined) { + // data type, not a method. The key is also the value + return { + ...associatedNimareOutput, + value: key, }; } else { + // KVPs describing methods applied to generate the map return { - key: key, - isValueType: nimareOutput?.isValueType || false, - keyDesc: nimareOutput?.description || '', + ...associatedNimareOutput, value: value, }; } diff --git a/compose/neurosynth-frontend/src/pages/MetaAnalysis/components/DisplayMetaAnalysisResults.spec.tsx b/compose/neurosynth-frontend/src/pages/MetaAnalysis/components/DisplayMetaAnalysisResults.spec.tsx index a9f3d6cf..ff5b0eba 100644 --- a/compose/neurosynth-frontend/src/pages/MetaAnalysis/components/DisplayMetaAnalysisResults.spec.tsx +++ b/compose/neurosynth-frontend/src/pages/MetaAnalysis/components/DisplayMetaAnalysisResults.spec.tsx @@ -1,36 +1,145 @@ -import { render } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; import DisplayMetaAnalysisResults from './DisplayMetaAnalysisResults'; -import { useGetMetaAnalysisResultById } from 'hooks'; import { Mock } from 'vitest'; import { INeurovault } from 'hooks/metaAnalyses/useGetNeurovaultImages'; +import { useGetNeurovaultImages } from 'hooks'; +import { mockMetaAnalysisReturn } from 'testing/mockData'; +import { Specification } from 'neurosynth-compose-typescript-sdk'; vi.mock('hooks'); vi.mock('pages/MetaAnalysis/components/MetaAnalysisResultStatusAlert'); vi.mock('pages/MetaAnalysis/components/DisplayParsedNiMareFile'); vi.mock('components/Visualizer/NiiVueVisualizer'); -const caseA: INeurovault[] = []; -const caseB: INeurovault[] = []; -const caseC: INeurovault[] = []; -const caseD: INeurovault[] = []; +const caseNonsenseValues: Partial[] = [ + { id: 2, name: 'BNonsensicalValue' }, + { id: 3, name: 'ZAnotherNonsenseValue' }, + { id: 1, name: 'ArandomValue' }, +]; +const caseRandomOrderDataTypes: Partial[] = [ + { id: 12, name: 'label_desc-ABC' }, + { id: 3, name: 'p_desc-ABC' }, + { id: 2, name: 't_desc-ABC' }, + { id: 11, name: 'sigma2_desc-ABC' }, + { id: 5, name: 'chi2_desc-ABC' }, + { id: 4, name: 'logp_desc-ABC' }, + { id: 8, name: 'est_desc-ABC' }, + { id: 10, name: 'tau2_desc-ABC' }, + { id: 1, name: 'z_desc-ABC' }, + { id: 6, name: 'prob_desc-ABC' }, + { id: 9, name: 'se_desc-ABC' }, + { id: 7, name: 'stat_desc-ABC' }, +]; +const caseSameKeyDifferentValues: Partial[] = [ + { id: 2, name: 'z_desc-DEF' }, + { id: 3, name: 'z_desc-ZZZ' }, + { id: 1, name: 'z_desc-ABC' }, +]; +const caseVoxelAndCluster: Partial[] = [ + { id: 2, name: 'z_desc-ABC_level-voxel' }, + { id: 1, name: 'z_desc-ABC_level-cluster' }, +]; + +const caseMKDAChi2: Partial[] = [ + { id: 1, name: 'z_desc-AAA' }, + { id: 2, name: 'z_desc-CCC' }, + { id: 3, name: 'z_desc-ZZZ' }, + { id: 4, name: 'z_desc-uniformityMass' }, + { id: 5, name: 'z_desc-associationMass' }, +]; describe('DisplayMetaAnalysisResults', () => { it('should render', () => { render(); }); - it('should show the correctly sorted list (1)', () => { - (useGetMetaAnalysisResultById as Mock).mockReturnValue({ - data: caseA, + it('should show the correctly sorted list for nonsense values, sorting by alphabetical order', () => { + (useGetNeurovaultImages as Mock).mockReturnValue({ + data: caseNonsenseValues, isLoading: false, isError: false, }); - // Passing in a met-analysis is not important as we mock the hook that provides the important data - render(); + render(); + const buttons = screen.getAllByRole('button'); + expect(buttons.length).toEqual(caseNonsenseValues.length); + expect(buttons[0].textContent).toBe('ArandomValue'); + expect(buttons[1].textContent).toBe('BNonsensicalValue'); + expect(buttons[2].textContent).toBe('ZAnotherNonsenseValue'); + }); + + it('should show the correctly sorted list for data types', () => { + (useGetNeurovaultImages as Mock).mockReturnValue({ + data: caseRandomOrderDataTypes, + isLoading: false, + isError: false, + }); + + // Passing in a meta-analysis as an argument is not necessary as we mock the hook that provides the actual data + render(); + const buttons = screen.getAllByRole('button'); + expect(buttons.length).toEqual(caseRandomOrderDataTypes.length); + expect(buttons[0].textContent).toBe('z_desc-ABC'); + expect(buttons[1].textContent).toBe('t_desc-ABC'); + expect(buttons[2].textContent).toBe('p_desc-ABC'); + expect(buttons[3].textContent).toBe('logp_desc-ABC'); + expect(buttons[4].textContent).toBe('chi2_desc-ABC'); + expect(buttons[5].textContent).toBe('prob_desc-ABC'); + expect(buttons[6].textContent).toBe('stat_desc-ABC'); + expect(buttons[7].textContent).toBe('est_desc-ABC'); + expect(buttons[8].textContent).toBe('se_desc-ABC'); + expect(buttons[9].textContent).toBe('tau2_desc-ABC'); + expect(buttons[10].textContent).toBe('sigma2_desc-ABC'); + expect(buttons[11].textContent).toBe('label_desc-ABC'); + }); + + it('should show the correctly sorted list for same key different values', () => { + (useGetNeurovaultImages as Mock).mockReturnValue({ + data: caseSameKeyDifferentValues, + isLoading: false, + isError: false, + }); - expect(); + // Passing in a meta-analysis as an argument is not necessary as we mock the hook that provides the actual data + render(); + const buttons = screen.getAllByRole('button'); + expect(buttons.length).toEqual(caseSameKeyDifferentValues.length); + expect(buttons[0].textContent).toBe('z_desc-ABC'); + expect(buttons[1].textContent).toBe('z_desc-DEF'); + expect(buttons[2].textContent).toBe('z_desc-ZZZ'); }); - it('should show the correctly sorted list (2)', () => {}); + it('should show the correctly sorted list and prioritize cluster and then voxel', () => { + (useGetNeurovaultImages as Mock).mockReturnValue({ + data: caseVoxelAndCluster, + isLoading: false, + isError: false, + }); + + render(); + const buttons = screen.getAllByRole('button'); + expect(buttons.length).toEqual(caseVoxelAndCluster.length); + expect(buttons[0].textContent).toBe('z_desc-ABC_level-cluster'); + expect(buttons[1].textContent).toBe('z_desc-ABC_level-voxel'); + }); + + it('should show the correctly sorted list for MKDAChi2', () => { + const mockMetaAnalysis = mockMetaAnalysisReturn(); + (mockMetaAnalysis.specification as Specification).estimator = { type: 'MKDAChi2' }; + + (useGetNeurovaultImages as Mock).mockReturnValue({ + data: caseMKDAChi2, + isLoading: false, + isError: false, + }); + + render(); + const buttons = screen.getAllByRole('button'); + expect(buttons.length).toEqual(caseMKDAChi2.length); + expect(buttons[0].textContent).toBe('z_desc-associationMass'); + expect(buttons[1].textContent).toBe('z_desc-uniformityMass'); + expect(buttons[2].textContent).toBe('z_desc-AAA'); + expect(buttons[3].textContent).toBe('z_desc-CCC'); + expect(buttons[4].textContent).toBe('z_desc-ZZZ'); + }); }); diff --git a/compose/neurosynth-frontend/src/pages/MetaAnalysis/components/DisplayMetaAnalysisResults.tsx b/compose/neurosynth-frontend/src/pages/MetaAnalysis/components/DisplayMetaAnalysisResults.tsx index d020411f..6311a284 100644 --- a/compose/neurosynth-frontend/src/pages/MetaAnalysis/components/DisplayMetaAnalysisResults.tsx +++ b/compose/neurosynth-frontend/src/pages/MetaAnalysis/components/DisplayMetaAnalysisResults.tsx @@ -3,7 +3,7 @@ import StateHandlerComponent from 'components/StateHandlerComponent/StateHandler import NiiVueVisualizer from 'components/Visualizer/NiiVueVisualizer'; import { useGetMetaAnalysisResultById, useGetNeurovaultImages } from 'hooks'; import { INeurovault } from 'hooks/metaAnalyses/useGetNeurovaultImages'; -import { MetaAnalysisReturn, NeurovaultFile, ResultReturn } from 'neurosynth-compose-typescript-sdk'; +import { MetaAnalysisReturn, NeurovaultFile, ResultReturn, Specification } from 'neurosynth-compose-typescript-sdk'; import { useEffect, useMemo, useState } from 'react'; import { NimareOutputs, parseNimareFileName } from '../Nimare.helpers'; import DisplayParsedNiMareFile from './DisplayParsedNiMareFile'; @@ -11,9 +11,9 @@ import MetaAnalysisResultStatusAlert from './MetaAnalysisResultStatusAlert'; const DisplayMetaAnalysisResults: React.FC<{ metaAnalysis: MetaAnalysisReturn | undefined; -}> = (props) => { +}> = ({ metaAnalysis }) => { // Each result represents a run. We just need to get the last item to get the latest run - const metaAnalysisResults = (props.metaAnalysis?.results || []) as ResultReturn[]; + const metaAnalysisResults = (metaAnalysis?.results || []) as ResultReturn[]; const { data, isLoading, isError } = useGetMetaAnalysisResultById( metaAnalysisResults[metaAnalysisResults.length - 1]?.id ); @@ -30,12 +30,15 @@ const DisplayMetaAnalysisResults: React.FC<{ const [selectedNeurovaultImage, setSelectedNeurovaultImage] = useState(); const sortedNeurovaultFiles = useMemo(() => { - const orderMap = new Map(NimareOutputs.map((output, index) => [output.type, index])); + if (!neurovaultFiles || !metaAnalysis || !(metaAnalysis?.specification as Specification).estimator?.type) + return []; + + const orderMap = new Map(NimareOutputs.map((output, index) => [output.key, index])); // We want the order of the files to be very specific: - // if algorithm is MKDAChi2, then set 1st image to be desc-associationMass - // set 2nd image to be desc-uniformityMass + // if algorithm is MKDAChi2, then set 1st image to be z_desc-associationMass + // set 2nd image to be z_desc-uniformityMass // otherwise, sort all file names by value type as hardcoded in the NimareOutputs array - // if multiple of the same value type, prioritize corr-cluster, then corr-voxel + // if multiple of the same value type, prioritize level-cluster, then level-voxel // note that generally, this is just alphabetical order const sorted = (neurovaultFiles || []).sort((a, b) => { @@ -44,26 +47,46 @@ const DisplayMetaAnalysisResults: React.FC<{ const filenameWithMoreSegments = filenameA.length > filenameB.length ? filenameA : filenameB; for (let i = 0; i < filenameWithMoreSegments.length; i++) { - if (!filenameA[i]) return -1; - if (!filenameB[i]) return 1; + const segmentA = filenameA[i]; + const segmentB = filenameB[i]; + + if (!segmentA && !segmentB) return 0; + else if (!segmentA) return -1; + else if (!segmentB) return 1; + + const orderA = orderMap.get(segmentA.key) ?? Infinity; + const orderB = orderMap.get(segmentB.key) ?? Infinity; - const orderA = - orderMap.get(filenameA[i].isValueType ? filenameA[i].value : filenameA[i].key) ?? Infinity; - const orderB = - orderMap.get(filenameB[i].isValueType ? filenameB[i].value : filenameB[i].key) ?? Infinity; if (orderA === orderB) { - if (filenameA[i].value === filenameB[i].value) { - continue; - } - return filenameB[i].value.localeCompare(filenameA[i].value); + if (segmentA.value === segmentB.value) continue; + return segmentA.value.localeCompare(segmentB.value); } else { - return orderB - orderA; + return orderA - orderB; } } return 0; }); - return sorted?.reverse(); - }, [neurovaultFiles]); + + // if MKDAChi2, move both z_desc-associationMass and z_desc-uniformityMass to the top respectively + if ((metaAnalysis.specification as Specification).estimator?.type === 'MKDAChi2') { + const uniformityMassIndex = sorted.findIndex((sortedElement) => + sortedElement.name?.includes('z_desc-uniformityMass') + ); + if (uniformityMassIndex >= 0) { + const [removedElement] = sorted.splice(uniformityMassIndex, 1); + sorted.unshift(removedElement); + } + const associationMassIndex = sorted.findIndex((sortedElement) => + sortedElement.name?.includes('z_desc-associationMass') + ); + if (associationMassIndex >= 0) { + const [removedElement] = sorted.splice(associationMassIndex, 1); + sorted.unshift(removedElement); + } + } + + return sorted; + }, [neurovaultFiles, metaAnalysis]); useEffect(() => { if (!sortedNeurovaultFiles) return; @@ -75,7 +98,7 @@ const DisplayMetaAnalysisResults: React.FC<{ isLoading={isLoading || neurovaultFilesIsLoading} isError={isError || neurovaultFilesIsError} > - + diff --git a/compose/neurosynth-frontend/src/pages/MetaAnalysis/components/DisplayParsedNiMareFile.tsx b/compose/neurosynth-frontend/src/pages/MetaAnalysis/components/DisplayParsedNiMareFile.tsx index 9cfb38b8..e0758dd4 100644 --- a/compose/neurosynth-frontend/src/pages/MetaAnalysis/components/DisplayParsedNiMareFile.tsx +++ b/compose/neurosynth-frontend/src/pages/MetaAnalysis/components/DisplayParsedNiMareFile.tsx @@ -25,9 +25,12 @@ const DisplayParsedNiMareFile: React.FC<{ nimareFileName: string | undefined | n > - {segment.key} + {segment.label} - {segment.keyDesc}} placement="top"> + {segment.description}} + placement="top" + > diff --git a/compose/neurosynth-frontend/src/testing/mockData.ts b/compose/neurosynth-frontend/src/testing/mockData.ts index 44b0502c..3d59bc56 100644 --- a/compose/neurosynth-frontend/src/testing/mockData.ts +++ b/compose/neurosynth-frontend/src/testing/mockData.ts @@ -979,6 +979,699 @@ const mockNeurovault: () => INeurovault[] = () => [ }, ]; +const mockMetaAnalysisReturn: () => MetaAnalysisReturn = () => ({ + cached_annotation: 'Q7PGxaTr6Ke4', + cached_studyset: 'Ue5rb87H4nMi', + created_at: '2024-12-06T01:07:18.120143+00:00', + description: 'MKDAChi2 meta analysis with FDRCorrector', + id: 'WfCnGvpZxXi4', + name: 'My new test MKDAChi2 Meta Analysis: included', + neurostore_analysis: { + created_at: '2024-12-06T01:07:18.146325+00:00', + exception: null, + id: 'nBC95wqsJgYM', + neurostore_id: 'zyWsKHSiU3Y6', + status: 'OK', + traceback: null, + updated_at: '2024-12-06T01:14:42.206629+00:00', + }, + neurostore_url: 'https://neurostore.org/api/analyses/zyWsKHSiU3Y6', + project: '5fuUb89eACzZ', + provenance: null, + results: [ + { + created_at: '2024-12-06T01:14:37.069129+00:00', + id: 'PyftC25kGRm5', + updated_at: '2024-12-06T01:14:38.323194+00:00', + }, + ], + run_key: 'oXsfHh0RyA0jFRzQdhwyLA', + specification: { + conditions: [true], + corrector: { + args: { + alpha: 0.05, + method: 'indep', + }, + type: 'FDRCorrector', + }, + created_at: '2024-12-06T01:07:17.495976+00:00', + database_studyset: 'neurostore', + estimator: { + args: { + '**kwargs': {}, + kernel__r: 10, + kernel__value: 1, + prior: 0.5, + }, + type: 'ALE', + }, + filter: 'included', + id: 'h57xeSmdQcpj', + type: 'CBMA', + updated_at: null, + user: 'github|26612023', + username: 'Nicholas Lee', + weights: [1.0], + }, + studyset: { + created_at: '2024-12-06T01:07:17.670624+00:00', + id: 'Ue5rb87H4nMi', + neurostore_id: '7WRDwR5YfnBg', + snapshot: { + snapshot: { + created_at: '2023-12-12T22:33:20.849705+00:00', + description: 'my test description', + doi: null, + id: '7WRDwR5YfnBg', + name: 'Studyset for My new test', + pmid: null, + publication: null, + studies: [ + { + analyses: [ + { + conditions: [], + description: 'Table 2', + id: '3GTqJytpC3p6', + images: [], + metadata: null, + name: 'Linear Control > Linear Risk', + points: [ + { + coordinates: [-40.0, -26.0, 50.0], + id: '9Jzj2X5DxaiL', + image: null, + kind: null, + label_id: null, + space: 'MNI', + values: [ + { + kind: 'Z', + value: 7.49, + }, + ], + }, + { + coordinates: [-4.0, 0.0, 54.0], + id: '44G9cjh3T9mY', + image: null, + kind: null, + label_id: null, + space: 'MNI', + values: [ + { + kind: 'Z', + value: 4.93, + }, + ], + }, + { + coordinates: [-44.0, -34.0, 16.0], + id: '54rAqeX2Vp54', + image: null, + kind: null, + label_id: null, + space: 'MNI', + values: [ + { + kind: 'Z', + value: 5.29, + }, + ], + }, + { + coordinates: [28.0, -88.0, -6.0], + id: '7dRbckNiNd35', + image: null, + kind: null, + label_id: null, + space: 'MNI', + values: [ + { + kind: 'Z', + value: 4.59, + }, + ], + }, + { + coordinates: [58.0, -20.0, 38.0], + id: 'sDcbvTeisgcb', + image: null, + kind: null, + label_id: null, + space: 'MNI', + values: [ + { + kind: 'Z', + value: 4.52, + }, + ], + }, + ], + user: 'github|26612023', + weights: [], + }, + { + conditions: [], + description: 'Table 2', + id: '3GzSVjE8mrS3', + images: [], + metadata: null, + name: 'Mean Control > Mean Risk', + points: [ + { + coordinates: [12.0, -76.0, -2.0], + id: '3iiUJ9Gjvzns', + image: null, + kind: null, + label_id: null, + space: 'MNI', + values: [ + { + kind: 'Z', + value: 13.0, + }, + ], + }, + { + coordinates: [-48.0, -64.0, 40.0], + id: 'AXczqpqehb2a', + image: null, + kind: null, + label_id: null, + space: 'MNI', + values: [ + { + kind: 'Z', + value: 14.4, + }, + ], + }, + { + coordinates: [56.0, -56.0, 24.0], + id: '3iVGLscyGBNf', + image: null, + kind: null, + label_id: null, + space: 'MNI', + values: [ + { + kind: 'Z', + value: 15.2, + }, + ], + }, + { + coordinates: [-42.0, 14.0, 46.0], + id: '6sRLCc7AeMh7', + image: null, + kind: null, + label_id: null, + space: 'MNI', + values: [ + { + kind: 'Z', + value: 12.7, + }, + ], + }, + { + coordinates: [-48.0, 34.0, -2.0], + id: '4CjUGeWd32fj', + image: null, + kind: null, + label_id: null, + space: 'MNI', + values: [ + { + kind: 'Z', + value: 12.8, + }, + ], + }, + { + coordinates: [50.0, 38.0, -8.0], + id: '85VnuggANrMU', + image: null, + kind: null, + label_id: null, + space: 'MNI', + values: [ + { + kind: 'Z', + value: 12.5, + }, + ], + }, + { + coordinates: [14.0, 56.0, 30.0], + id: '43NQ8JqFyPaS', + image: null, + kind: null, + label_id: null, + space: 'MNI', + values: [ + { + kind: 'Z', + value: 11.8, + }, + ], + }, + { + coordinates: [6.0, -46.0, 34.0], + id: '5wT3cSjqjB5s', + image: null, + kind: null, + label_id: null, + space: 'MNI', + values: [ + { + kind: 'Z', + value: 12.4, + }, + ], + }, + { + coordinates: [-6.0, -54.0, -46.0], + id: '8EmpBr8WEJue', + image: null, + kind: null, + label_id: null, + space: 'MNI', + values: [ + { + kind: 'Z', + value: 15.0, + }, + ], + }, + { + coordinates: [-52.0, -8.0, -32.0], + id: '5URbwza34r3b', + image: null, + kind: null, + label_id: null, + space: 'MNI', + values: [ + { + kind: 'Z', + value: 9.22, + }, + ], + }, + { + coordinates: [4.0, 44.0, 50.0], + id: '6k2FKbvTDzga', + image: null, + kind: null, + label_id: null, + space: 'MNI', + values: [ + { + kind: 'Z', + value: 9.03, + }, + ], + }, + { + coordinates: [-64.0, -14.0, -22.0], + id: '7tTvbLAx9uLF', + image: null, + kind: null, + label_id: null, + space: 'MNI', + values: [ + { + kind: 'Z', + value: 9.02, + }, + ], + }, + ], + user: 'github|26612023', + weights: [], + }, + ], + authors: 'Claus ED, Feldstein Ewing SW, Magnan RE, Montanaro E, Hutchison KE, Bryan AD', + created_at: '2023-11-02T18:11:08.811383+00:00', + description: 'a', + doi: '10.1007/s11682-017-9723-x', + id: '5FYoyH8Z6spR', + metadata: { + sample_size: null, + }, + name: 'Neural mechanisms of risky decision making in adolescents reporting frequent alcohol and/or marijuana use.', + pmid: '28429160', + publication: 'Brain imaging and behavior', + source: 'neurostore', + source_id: '3sCo5xAjxL56', + source_updated_at: '2023-06-21T22:17:27.973390+00:00', + updated_at: '2023-12-12T22:37:21.933193+00:00', + user: 'github|26612023', + year: 2018, + }, + { + analyses: [ + { + conditions: [], + description: null, + id: '3CNaH5frhTpr', + images: [], + metadata: null, + name: '21176', + points: [ + { + coordinates: [19.0, -69.0, -7.0], + id: '7NnSEQ6fug6e', + image: null, + kind: null, + label_id: null, + space: 'TAL', + values: [ + { + kind: 'R', + value: null, + }, + ], + }, + { + coordinates: [-23.0, 53.0, 10.0], + id: '82N6ePiAWSRF', + image: null, + kind: null, + label_id: null, + space: 'TAL', + values: [ + { + kind: 'R', + value: null, + }, + ], + }, + { + coordinates: [39.0, 30.0, 18.0], + id: '7yRw6zhEf68M', + image: null, + kind: null, + label_id: null, + space: 'TAL', + values: [ + { + kind: 'R', + value: null, + }, + ], + }, + { + coordinates: [6.0, 47.0, -20.0], + id: '5wGDBHUMP5uA', + image: null, + kind: null, + label_id: null, + space: 'TAL', + values: [ + { + kind: 'R', + value: null, + }, + ], + }, + { + coordinates: [-44.0, -62.0, 44.0], + id: '3LA2X7RYmoBE', + image: null, + kind: null, + label_id: null, + space: 'TAL', + values: [ + { + kind: 'R', + value: null, + }, + ], + }, + ], + user: 'github|26612023', + weights: [], + }, + { + conditions: [], + description: '', + id: 'CCKyTeh7jAef', + images: [], + metadata: null, + name: 'my new analysis', + points: [ + { + coordinates: [39.0, 30.0, 18.0], + id: '62e887hWm5ZL', + image: null, + kind: null, + label_id: null, + space: 'MNI', + values: [ + { + kind: 'Pa', + value: null, + }, + ], + }, + { + coordinates: [19.0, -69.0, -7.0], + id: '6C3CKPxUTYkz', + image: null, + kind: null, + label_id: null, + space: 'MNI', + values: [ + { + kind: 'Pa', + value: null, + }, + ], + }, + { + coordinates: [-23.0, 53.0, 10.0], + id: 'btjdW4osrdzp', + image: null, + kind: null, + label_id: null, + space: 'MNI', + values: [ + { + kind: 'Pa', + value: null, + }, + ], + }, + ], + user: 'github|26612023', + weights: [], + }, + ], + authors: 'Filbey FM, McQueeny T, DeWitt SJ, Mishra V', + created_at: '2023-10-28T19:46:16.482780+00:00', + description: null, + doi: '10.1016/j.dcn.2015.10.001', + id: '7wPrisH4DHmk', + metadata: { + sample_size: null, + }, + name: 'Preliminary findings demonstrating latent effects of early adolescent marijuana use onset on cortical architecture.', + pmid: '26507433', + publication: 'Developmental cognitive neuroscience', + source: 'neurostore', + source_id: 'nQGt73k3CGfk', + source_updated_at: '2023-06-21T22:17:27.973390+00:00', + updated_at: '2023-10-28T19:46:17.327351+00:00', + user: 'github|26612023', + year: 2015, + }, + { + analyses: [ + { + conditions: [], + description: null, + id: '33KzpLpKDd95', + images: [], + metadata: null, + name: '21242', + points: [ + { + coordinates: [2.0, -12.0, 0.0], + id: '6Sd3Vj9WV8JX', + image: null, + kind: null, + label_id: null, + space: 'MNI', + values: [ + { + kind: null, + value: null, + }, + ], + }, + { + coordinates: [28.0, -30.0, 56.0], + id: 'gVJc4wYW2VR3', + image: null, + kind: null, + label_id: null, + space: 'MNI', + values: [ + { + kind: null, + value: null, + }, + ], + }, + { + coordinates: [22.0, -18.0, -10.0], + id: '6oiQFsHc9ELB', + image: null, + kind: null, + label_id: null, + space: 'MNI', + values: [ + { + kind: null, + value: null, + }, + ], + }, + { + coordinates: [-20.0, -48.0, 64.0], + id: '6VACn9idtiki', + image: null, + kind: null, + label_id: null, + space: 'MNI', + values: [ + { + kind: null, + value: null, + }, + ], + }, + ], + user: 'github|26612023', + weights: [], + }, + { + conditions: [], + description: '', + id: 't3kwfKCSnvyz', + images: [], + metadata: null, + name: '21243', + points: [ + { + coordinates: [-46.0, -6.0, -30.0], + id: '4sWCWDJf9qAt', + image: null, + kind: null, + label_id: null, + space: null, + values: [ + { + kind: null, + value: null, + }, + ], + }, + { + coordinates: [10.0, -20.0, -24.0], + id: 'NWRFLyMDWRHA', + image: null, + kind: null, + label_id: null, + space: null, + values: [ + { + kind: null, + value: null, + }, + ], + }, + { + coordinates: [18.0, -8.0, -8.0], + id: '3VvqKwJiah35', + image: null, + kind: null, + label_id: null, + space: null, + values: [ + { + kind: null, + value: null, + }, + ], + }, + { + coordinates: [-22.0, -24.0, -8.0], + id: '5wd4n7Tgs7G6', + image: null, + kind: null, + label_id: null, + space: null, + values: [ + { + kind: null, + value: null, + }, + ], + }, + { + coordinates: [-32.0, -30.0, 58.0], + id: '5pkJZQKbinpp', + image: null, + kind: null, + label_id: null, + space: null, + values: [ + { + kind: null, + value: null, + }, + ], + }, + ], + user: 'github|26612023', + weights: [], + }, + ], + authors: 'Matochik JA, Eldreth DA, Cadet JL, Bolla KI', + created_at: '2023-11-02T17:34:59.386691+00:00', + description: null, + doi: '10.1016/j.drugalcdep.2004.06.011', + id: '5KPoXYmpNbwf', + metadata: { + sample_size: null, + }, + name: 'Altered brain tissue composition in heavy marijuana users.', + pmid: '15607838', + publication: 'Drug and alcohol dependence', + source: 'neurostore', + source_id: '4taREaBkeuBY', + source_updated_at: '2023-06-21T22:17:27.973390+00:00', + updated_at: '2023-11-02T17:35:00.317618+00:00', + user: 'github|26612023', + year: 2005, + }, + ], + updated_at: null, + user: 'github|26612023', + }, + }, + updated_at: '2024-12-06T01:14:37.069129+00:00', + url: 'https://neurostore.org/api/studysets/7WRDwR5YfnBg', + user: 'github|26612023', + username: 'Nicholas Lee', + version: null, + }, +}); + export { mockConditions, mockWeights, @@ -997,4 +1690,5 @@ export { mockProject, mockMetaAnalysisResult, mockNeurovault, + mockMetaAnalysisReturn, };