Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
rawr

Vanessasaurus vsoch

💭
rawr
View GitHub Profile
@vsoch
vsoch / clinPheno.py
Last active Dec 31, 2015
clinPheno.py connects to a database of clinical data, a data dictionary, searches the data dictionary (all fields) for strings of interest, and then queries the clinical data for all maches, and prints two text files: 1) a text file of data, with questions in columns and items in rows, and 2) a text file of data dictionary fields See script head…
View clinPheno.py
#!/usr/bin/python
"""
clinPheno: Methods for querying a SQL database of clinical
variables to establish a clinical phenotype. The script will
search a data dictionary (database) for a set of user specified
terms (in some input.txt file), and then extract the matches
from the clinical database, for import into R (see clinPhenoR.R)
# SAMPLE INPUT.TXT file:
@vsoch
vsoch / covcheck_free.m
Created Jan 3, 2014
Coverage Checking for SPM Analysis
View covcheck_free.m
function covcheck_free()
% COVERAGE CHECKING for SPM ANALYSIS (covcheck_free.m)
% Vanessa Sochat
%
% This script takes in a list of subjects processed in SPM, an ROI mask
% that will be used for group analysis, and a user specified coverage
% percentage. It will calculate the size of a single subject mask and
% determine if the subject has that percentage coverage.
%__________________________________________________________________________
%
@vsoch
vsoch / xls_to_sql.m
Created Jan 3, 2014
This script reads in an excel sheet and converts it into sql insert statements. The first row is expected to be the titles for the tables, followed by rows of raw data.
View xls_to_sql.m
function xls_to_sql(input,sheet,outfile,database,table)
% This script reads in an excel sheet and converts it into sql insert
% statements. The first row is expected to be the titles for the tables,
% followed by rows of raw data.
%-------------------------------------------------------------------------
% INPUT
% input ----- input excel file should be excel file, .xls or .xlsx
% sheet ----- name of sheet to read from
% outfile ----- name of output file (without extension)
@vsoch
vsoch / grabtimeseries.m
Created Jan 3, 2014
Creates a matrix of average mean timeseries for each VOI in individual subject folders, separating out VOI name and number of subjects included. This data is then formatted into a csv file to be used to create an interactive chart with Google Charts (Gapminder)
View grabtimeseries.m
%% GRAB TIMESERIES:
% Creates a matrix of average mean timeseries for each VOI in individual subject folders, separating out VOI name and number of subjects included
% This data is then formatted into a csv file to be used to create an interactive chart with Google Charts (Gapminder)
%% GET DATA TIMESERIES
% Get list of all subjects in Analyzed Folder
anadir = 'path/path/path'; cd(anadir); all = dir;
% These are set in advance so we have control over our charts
@vsoch
vsoch / madlib.py
Created Jan 3, 2014
Madlib game for python! Reads in a user selected text file with a story and words to be filled in, words are in the format SUB_ADJECTIVE_SUB, where the ADJECTIVE will get presented to the user to specify the input desired.
View madlib.py
#!/usr/bin/python
import sys
import os.path
import re
import datetime
#-MADLIB---------------------------------------------------------------------
@vsoch
vsoch / beerrank.m
Last active Jan 2, 2016
beerrank(): takes in a list of beers, ranking criteria, and allows the user to enter rankings and produce a chart of averages and winners! % Created on December 14, 2010 for the LoNG annual Tasting Party! % Creator of script does not drink!
View beerrank.m
function beerrank()
%-------------------------------------------------------------------------
% beerrank(): takes in a list of beers, ranking criteria, and allows the
% user to enter rankings and produce a chart of averages and winners!
% Created on December 14, 2010 for the LoNG annual Tasting Party!
%-------------------------------------------------------------------------
% RUNNING:
% - should be run with no input arguments
% - will take in a number of beers, and output file name
% if outfile already exists, will append data to next empty row
@vsoch
vsoch / confirmation_email.m
Last active Jan 2, 2016
Confirmation and reminder emails for experimental research in Matlab, as well as a script to send brain images to participants.
View confirmation_email.m
function confirmation_email(contactemail)
% CONFIRMATION_EMAIL
% Vanessa Sochat
%
% This script sends confirmation emails for imaging and battery appointments
% added to the calendar the previous day.
%
% -------------------------------------------------------------------------
% VARIABLES:
@vsoch
vsoch / compileABASampleMNI.R
Created Jan 11, 2014
This script reads in text files with 1) Allen Brain Atlas dataset MNI coordinates for each of 3702 samples, and 2) associated structures and parent structures, and outputs to .RData and .csv files for later analysis
View compileABASampleMNI.R
# This script will read in individual brain datasets
# (a MNI coordinate file, and a structure ID file)
# compile into one matrix, and save to both text and Rdata file
# Read in data for each brain, save to matrix
filenames = c("H0351.2002","H0351.2001","H0351.1009","H0351.1012","H0351.1015","H0351.1016")
filey = filenames[1]
MNI = read.csv(paste('data/human_ma_samples_MNI_',filey,'.txt',sep=""),head=FALSE,sep="")
STRUC = read.csv(paste('data/human_ma_samples_region_',filey,'.txt',sep=""),head=FALSE,sep="")
@vsoch
vsoch / cogat_trm_550b50095d4a3
Created Jun 16, 2016
Working Memory fMRI Task Paradigm
View cogat_trm_550b50095d4a3
= The Cognitive Atlas
:neo4j-version: 2.0.0
:author: Poldracklab
:twitter: @vsoch
:tags: cognitive:concepts:psychology:neuroscience
'''
View task: working memory fMRI task paradigm
@vsoch
vsoch / scripts.py
Created Nov 12, 2016
script.py - an example executable for a python package. Instructions for adding are included in header.
View scripts.py
#!/usr/bin/env python
'''
script.py: template executable for an application. In your setup.py, you would want something like this:
entry_points = {
'console_scripts': [
'myapp=myapp.scripts:main',
],
},
You can’t perform that action at this time.