sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
4a713a3abd3ee9f6b45401e7c9933510435afdc81e289b86f5a8329e431d6f57
R
3,901
133
# [Build --> Install and Restart] # Setup ------------------------------------------------------------------------ # [Edit these] doINLA <- TRUE saveResults <- TRUE overwriteResults <- TRUE resamp_res <- 8000 # my_pardiso <- "~/Documents/pardiso.lic" # INLA PARDISO license my_wb <- "~/Applications/workbench" # path to...
74bf54cc17a2e3436e7d44d2c686b5e347ae6405e258b3219210d00264f68d55
R
4,002
88
# create environment variables # Variable settings ------------------------------------------------------- print("Setup of variables: ") variables_environment <- list( directories = list( setup = list("working_dir" = args, "repo_dir" = getwd(), "dcm2niix_path" = paste0(getwd...
8d2d3fe52a8040effb0e0c2969c115210ca6f6c37bd1e47732d3c9e42c544f70
R
4,028
118
library(ciftiTools) ciftiTools.setOption('wb_path','~/Applications') #where your Connectome Workbench installation is located library(BayesfMRI) # Data: # HCP subject 100307 # session 1 = tfMRI_EMOTION_LR # session 2 = tfMRI_EMOTION_RL setwd('~/Documents/Github/BayesfMRI/vignette_data/') sessions <- c('tfMRI_EMOTION...
2639e2b079a37fda5023cc99064c2d472c1009b2a0157e1f323388739cc12727
R
4,071
83
## EM Model. --------------------------------------------------------------- #if(do_EM) { #stop() # if (!requireNamespace("MatrixModels", quietly = TRUE)) { # stop("EM requires the `MatrixModels` package. Please install it.", call. = FALSE) # } # if (verbose>0) cat(...
28c3ef5f7aca9705d061fd12e324b17637c15dd3cc0f0f750dec703f5e6b2a7b
R
4,080
102
#' Read only the data matrix in a CIFTI file #' #' Reads the CIFTI data matrix by converting it to a GIFTI using the #' \code{-cifti-convert -to-gifti-ext} Connectome Workbench command. The result #' will be a \eqn{T \times G} matrix (\eqn{T} measurements, \eqn{G} non-empty #' grayordinates). All brainstructures ...
4f7ccdacda7d973d32c859ef588b76e5554b2eeb47cb90e9a247fe0598a103bd
R
4,086
141
###Code to analyse and plot multiple treemix reps ###Requires plotting functions R code provided with Treemix ###https://github.com/joepickrell/pophistory-tutorial/blob/master/example2/plotting_funcs.R ###Modifies some code from here (https://speciationgenomics.github.io/Treemix/) ###Includes plots for dealing with f...
83c2da2ad705472ea36ed18b4efb95f39085313da80d3927c8cdafbb4675a2bd
R
4,094
92
# BIDS files dataset_description <- '{ \t"Name": "The BIDS-Direct-ConverteR study", \t"BIDSVersion": "1.1.0rc4", \t"License": "This dataset was made available by You. We hope that the users of the data will acknowledge the BIDS-Direct-ConverteR team and Grant XXXX in any publications.", \t"Authors": ["Niklas Wulms", ...
7f1492c90c49c2c66f69498a8fe64b72d4ed89dd6304a23b2e70528ddc4283d4
R
4,129
99
library(DESeq2) library(edgeR) library(data.table) setwd("~/Documents/Genelists") pheno <- fread("Gosselin2017_tableS1_patientinfo.txt", header=T) GosselinCounts <- fread("Gosselin2017_tableS2_readcounts.txt", header=T) GosselinCounts <- as.data.frame(GosselinCounts) rownames(GosselinCounts)=make.names(GosselinCounts$...
835cbb2d4fb04f454fbc6dcf00e79cc6f49c88843e4ff67072ac5498a3cb64d1
R
4,213
124
#' Edit mask on surface #' #' Erode, dilate, or get the borders of a mask along the cortical surface #' #' The depth of the edit is determined by the number of edges between the #' vertices. To erode or dilate based on spatial distance (mm), see #' \code{-cifti-dilate} and \code{-cifti-erode}. #' #' @param x,mwall...
4b66cbcd9969609ca093e3363790d77cd78c892c35fb8bb650df8f5710376037
R
4,222
104
# json extraction mapping ------------------------------------------------------- #' Finds json files in a directory #' #' @param path path, where you want to search for .json files #' #' @return a list of json files #' @examples index_jsons("BIDS/sourcedata") index_jsons <- function(path) { # print("Indexing JSON f...
5a988b21d9438a71866cb18305176131c15373622edf07df4d96313aefb69ead
R
4,277
126
#' Get a \code{"surf"} object #' #' Coerce a file path to a surface GIFTI, a \code{"gifti"} object, a list with #' entries "pointset" and "triangle", or a \code{"surf"} to a #' \code{"surf"}. #' #' @param surf Either a file path to a surface GIFTI; a \code{"gifti"} #' read by \code{\link[gifti]{readgii}}; a list wit...
6cd00292fbcb47865a7c0ed84959c915510f33fff0fd6f18852549638aa10aa6
R
4,294
115
## locdfr emprical bayes method library(locfdr) z_scores <- read.csv('C:/Users/tumkayat/Desktop/deltadelta_ZScores.csv') Zi <- z_scores$Zi #data(lfdrsim) #zex <- lfdrsim[, 2] w <- locfdr(Zi) str(w) w$fdr which(w$fdr<.20) ## Hyungwon's EBprot library ### Tutorial ### data(UPS1) ### removing contaminants and rever...
f6cda78eddc267bba95b91c1b306951a09d92a367ccfb31151c4fa4511d0445c
R
4,322
141
#' Standardize data variance, and prewhiten if applicable #' #' Standardize data variance and prewhiten if applicable, for the GLM. #' @param BOLD,design,spatial See \code{fit_bayesglm}. #' @param session_names,field_names,design_type See \code{fit_bayesglm}. #' @param valid_cols,nT,do_pw See \code{fit_bayesglm}. #' @r...
381a21b614776a7b95aca9529e64913fa493fbf47bb69db0bfcea1f7135e7f72
R
4,329
99
#' Load a parcellation included in \code{ciftiTools} #' #' Load a parcellation included in \code{ciftiTools}. #' #' When using these parcellations, please cite the corresponding paper(s): #' #' \enumerate{ #' \item{Yeo, B. T. T. et al. The organization of the human cerebral cortex estimated by intrinsic functional ...
2c6810df6988d712d538c71885b7cfd3ac177f45f04ca9992ba20f087b08190c
R
4,346
126
#DEGnext #Copyright Tulika Kakati, 2021 #Distributed under GPL v3 license #This code may be used to download and preprocess cancer RNA-seq datasets from TCGA portal. ############################################ CancerProject=c("TCGA-BRCA","TCGA-KIRC","TCGA-UCEC","TCGA-LUAD","TCGA-THCA","TCGA-LUSC","TCGA-PRAD","TCGA...
adff2540a4f1bd968fc332845892893a6d4669d2afd1157e1b21af9c794d6222
R
4,406
77
###Pdae15888 methylation - is SNP-based differential methylation more correlated to larval survival library(ggplot2) #Create vector of heat survival index for individuals F1,F3,F4,A5,A6,A8 hscore=c(0.789439953, 0.998209258, 0.22654263, 0.954202839, 1.477754999, 1.300719112) #Read S441 methlyation table (3 filters - ex...
c5fa786993c55f5ead2388a968e6c4b9909ee84facfcd78d9f689ce0cb5b7d49
R
4,430
145
# [Build --> Install and Restart] # Setup ------------------------------------------------------------------------ # [Edit these] doINLA <- TRUE saveResults <- TRUE overwriteResults <- TRUE resamp_res <- 2200 # my_pardiso <- "~/Documents/pardiso.lic" # INLA PARDISO license my_wb <- "~/Applications/workbench" # path to...
3c91d85a551c6567f9632b2a68c2081f88973a6da8b5a4db3b2f27e12643c03b
R
4,511
131
#' Estimate residual autocorrelation for prewhitening #' #' @param resids Estimated residuals in \eqn{T \times V} numeric matrix #' @param ar_order,aic Order of the AR model used to prewhiten the data at each location. #' If \code{!aic} (default), the order will be exactly \code{ar_order}. If \code{aic}, #' the order...
dfaf4c4bf41fe06ac1188297b317cc26509664322d2f4239278d88dec7258bb6
R
4,637
119
#' BOLD #' #' @param BOLD fMRI timeseries data in CIFTI format ("*.dtseries.nii"). #' For single-session analysis this can be a file path to a CIFTI file or a #' \code{"xifti"} object from the \code{ciftiTools} package. For multi-session #' analysis this can be a vector of file paths or a list of \code{"xifti"} #' ...
7107f89a8ae3964281adfa96e63ace993e380caa173298d4b5d953162599059c
R
4,652
120
################################################## ## Project: CogNonCog 2018 ## Script purpose: Join the output files of CogNonCog...sh together ## Date: March 2019 ## Author: Perline Demange ################################################## setwd("./output") # Loading the files cognitive1m <- readRDS(fil...
9c3db33ac0238f23c67740f24d662b9581d9d2e1a15a1877c0250bf424ddfcc4
R
4,673
150
## {title: Scatter Chart} p1 <- nPlot(mpg ~ wt, group = 'cyl', data = mtcars, type = 'scatterChart') p1$xAxis(axisLabel = 'Weight') p1 ## {title: MultiBar Chart} hair_eye = as.data.frame(HairEyeColor) p2 <- nPlot(Freq ~ Hair, group = 'Eye', data = subset(hair_eye, Sex == "Female"), type = 'multiBarChart') p2$chart(co...
9cf2358be8018a5a185ac5be459adedb1375abc4c047bb52375aad6bf8267277
R
4,818
142
--- title: "Results from e-QTL" subtitle: "by Brain region" author: | | | Katia de Paiva Lopes | Ricardo A Vialle | Jack Humphrey | | Raj Lab | Department of Neuroscience | Icahn School of Medicine at Mount Sinai | NYC, New York date: "`r Sys.Date()`" output: rmarkdown::html_document: theme: united ...
b475d7e7ba0d9b4eb257236fc4df81e2f857457d5c8e7948f74e272f7efbc83a
R
4,994
126
# setwd("data-raw") # File locations parc_dir <- "../../Data/parc" # put all dlabel parcellations here hcp_dtseries_fname <- "~/Downloads/rfMRI_REST1_LR_Atlas.dtseries.nii" wb_path <- "~/Applications/workbench" # Load package library(ciftiTools) ciftiTools.setOption("wb_path", wb_path) # Data included in ciftiTools ...
4a7722832261ef6e99eb6c9a55e5e34881a4cfb75546a983992abb4de6a80c9a
R
5,015
133
setwd("./TWAS") library(data.table) ############# ## Get data ############ cog <- fread("D:/Documents/CogNonCog/Analyses/Annotations/TWAS/TWAS.Brain.Cog.ALL", stringsAsFactors = F) head(cog) noncog <- fread("D:/Documents/CogNonCog/Analyses/Annotations/TWAS/TWAS.Brain.NonCog.ALL", stringsAsFactors = F) hea...
f673ba9af27a75d05064f92c558b6ca19ab33df07ddefe85d894c7b35d7d6028
R
5,022
115
# Boxplots with expression # August 10, 2020 #This command clean all variables. BE CAREFULL!!! rm(list = setdiff(ls(), lsf.str())) library(tidyverse) library(edgeR) library(ggplot2) library(ggfortify) library(ggpubr) library(ggeasy) library(ggsci) expression_dir = "~/ad-omics_hydra/microglia_omics/expression_tabl...
09836fdc938e891d303d271a7c8e391890de4b56134d6610dfa084754496fa62
R
5,076
131
#' Replace the data in a \code{"xifti"} #' #' Replace the data in a \code{"xifti"} with new data from a data matrix. #' #' If the \code{"xifti"} has \eqn{V} grayordinates and \eqn{T} measurements\, #' \code{newdata} should be a \eqn{V \times Q} matrix. If \eqn{Q} #' is not equal to \eqn{T}, then any column names or l...
d029bf3aded3f8f6a04898e36bb526658eab9cfead40b257fb3003d50d403d04
R
5,088
166
#' Summarize a \code{"act_fit_bglm"} object #' #' Summary method for class \code{"act_fit_bglm"} #' #' @param object Object of class \code{"act_fit_bglm"}. #' @param ... further arguments passed to or from other methods. #' @export #' @return A \code{"summary.act_fit_bglm"} object, a list summarizing the #' properties...
dc518060eb984194ea6c1691ff24672b083eb73dc39796fab31fa998cc8dd02b
R
5,103
146
# sequence extraction and comparison -------------------------------------- #' Title #' #' @param df #' #' @return #' @export #' #' @examples extract_sequences <- function(df){ sequences <- df %>% select(sequence, ProtocolName, SeriesDescription) %>% unique() return(sequences) } #' Title #' #' @param df ...
f5f8c9e196b2505bc62f88728784fbe1c5ef927863cdb38fc60e177335ce783c
R
5,253
89
###Code to reproduce analyses looking at the role of environment and distance in driving population structure. ###The approach follows that of Saenz-Agudelo 2015 (https://doi.org/10.1111/mec.13471) and uses the R code associated with the paper, modified for this dataset. library(dplyr) library(gridExtra) setwd("/path/...
62f9800e5bfa918e8d063adaf7862b61d6f9cb8c521548259a596a74356bf7e1
R
5,265
144
#' Read a CIFTI file quickly #' #' Read a CIFTI file by exporting it as a single GIFTI #' using \code{-cifti-convert -to-gifti-ext} (\code{\link{read_cifti_flat}}), #' and obtaining the brainordinate mapping using #' \code{-cifti-export-dense-mapping} (\code{\link{info_cifti}}). #' #' @inheritParams cifti_fname...
32b22cd7c64e41deb52e27b2a24fb78356c19d73693524845b7d11fcf23e76c4
R
5,330
138
# [Build --> Install and Restart] # Setup ------------------------------------------------------------------------ # [Edit these] doINLA <- TRUE saveResults <- TRUE overwriteResults <- TRUE resamp_res <- 7000 # my_pardiso <- "~/Documents/pardiso.lic" # INLA PARDISO license my_wb <- "~/Desktop/workbench" # path to your...
8c3abcde0d94b4c23299f7c2a490026ed8cf2ec63251c471c084b04f4948a064
R
5,519
150
#' View \code{"surf"} object(s) #' #' Visualize one or two \code{"surf"} objects(s), or the \code{"surf"} #' component(s) in a \code{"xifti"} using an interactive Open GL window #' made with \code{rgl}. The \code{rgl} package is required. #' #' This function works as a wrapper to \code{\link{view_xifti_surface}}, ...
3cb38b063cc7fb61cb8534ecf7f52c31f05b86145588b73b99b7e5241fca7fb2
R
5,544
147
################################################## ## Project: CogNonCog 2018 ## Script purpose: Check SNP overlap COGENT and NonCog hits, and UKB CP GWAS ## Date: August 2020 ## Author: Perline Demange ################################################## library(data.table) # Check number of SNPs in NonCog GWAS that ...
97da68a335dcdc21895838babee77e11ebc97ed5d8432894914a866ee5f08db6
R
5,633
175
#' Write a CIFTI file from a \code{"xifti"} object #' #' Write out a \code{"xifti"} object as a CIFTI file and (optionally) GIFTI #' surface files. #' #' See \code{\link{write_xifti2}} to write a \code{"xifti"} object out as #' separate GIFTI and/or NIFTI files instead. #' #' @inheritParams xifti_Param #' @inheritPa...
24949f90d9f1fbd8d49e517f5f36ab3536ed5ee4e1f99de9eb5a32d126f74407
R
5,635
137
# Calculate variance explained (GWAS) ## Open R setwd("Cog_GWAS_BayesR/") library(data.table) # dir.create("Cog_Summstats") loop = list.files("Cog_Comp/", pattern = "_processed.csv") ## Calculate Mean Variance explained by all probes and credible intervals names = readRDS("Cog_10k_snps.rds") names = ...
f41614ac5a18e237e87a0f52159711c2be8fc39434f44a7a6ae3d994b0cbee1d
R
5,676
179
library(docopt) doc <- " Usage: predictXGB.R --data <FILE> --models <FILE> [--out_csv <FILE>] [--out_rdata <FILE>] Options: --data FILE file with expression data: csv, tsv, txt, rds or RData (containing data.frame named 'expr') --models FILE file with list of XGBoost models (.RData) --out_csv FILE output csv ...
e23fb3d480416ae397399c6ad55e227c49ad615aaf3fa65d6415461b73cc923c
R
5,714
122
# Preferences ## Personal We ask for your personal information to help with the development of WebMorph. This is optional, apart from a working email address, which you will need to be able to get and reset your password. We're always happy to hear from you about what sort of things would make WebMorph better or easi...
6f7db7406e4411b9f87e327414821e0164d87acec2c0e5438a24406a52beddba
R
5,732
169
#' Write a \code{"xifti"} object to GIFTI and NIFTI files #' #' Write metric or label GIFTIs for the cortical surface data and NIFTIs for the #' subcortical labels and mask in a \code{"xifti"} object. Each present #' brainstructure will be written; if a brainstructure is absent the #' corresponding file is not writt...
a5e9badb3e670e290055d6541ddbe67679b19f11574032944c3076da38a1c6ca
R
5,743
85
# Write table of samples for GWAS data phenos = read.csv("Cog_GWAS_BayesR/Cognitive_BayesR_10k_phenotypes.csv") x = read.table("GS20K_QC\'d/GS20K_QCpsychprotocol_SPH_04112015.fam") x = x[which(x$V2 %in% phenos$Sample_Name), ] fam = x[,1:2] write.table(fam[,1:2], file="ewas_samps.txt", sep='\t', quote=F, row.name...
9bc7e900128596b15bb6206d070797c9db6e87d13855e90edfe5e0603d0b352b
R
5,923
163
#' Move data locations to the subcortex mask #' #' Move subcortex data locations with a specific value(s) to the subcortex mask. #' #' @inheritParams xifti_Param #' @param values Values to mask out. Default: \code{NA} and \code{NaN}. Data #' locations in the subcortex that are one of these values (across all columns) ...
68af531b692bd12fcc924b6a9abf297688a9284b94fe5d13def63948ea28b809
R
5,947
165
#' Platform detection and per-platform overrides #' @keywords internal #' @name platform NULL # ---------------------------------------------------------------------------- # Predicates # ---------------------------------------------------------------------------- #' Is the host running macOS Tahoe (26.0+)? #' @keywo...
139552c900a5c5182009f7fa32381b6094fbc3732b3c82d12ae1532d125f8d0b
R
5,987
168
#' Move data locations to the medial wall #' #' Move cortical data locations with a specific value(s) to the medial wall mask. #' For example, dlabel CIFTIs often have medial wall vertices set to a specific #' key value, rather than a medial wall mask. This function can move those data #' locations from the data ma...
2cf958bb3522cdbbed5e2db0c9532b00c8b6f40fcfcac8ad6747e802ee84529c
R
5,990
153
################################################## ## Project: CogNonCog 2018 ## Script purpose: Run model with CP UKB and CP Cogent separately ## Date: August 2020 ## Author: Perline Demange ################################################## # install.packages("devtools") # library(devtools) # install_github("Miche...
e907498be59db61219e95606ec22971404b20c8f97e5f444ccffc32cf22d8626
R
6,013
102
check_wb <- function() { if (is.null(ciftiTools.getOption("wb_path"))) { skip("Connectome Workbench is not available.") } } test_that("plot_xifti `together` argument is working", { check_wb() fnames <- ciftiTools.files() # CORTEX --------------------------------------------------------------------- ...
e708b1d099e089adf1305442aafd0adbc792f69c050e98e77f000abb0ab6e0aa
R
6,037
173
#' Format metric data as a \code{"gifti"} #' #' Format a \eqn{V \times T} numeric matrix (V vertices, T measurements) or a length-T list #' of length-V numeric vectors as a \code{"gifti"} using a template #' \code{"gifti"}. The brain hemisphere (left or right) must be indicated. #' #' If \code{data} is already a ...
136f9ed0fa44fc007049917c10566015a38511b73dc2978b4749bf1afbb512e8
R
6,067
167
#' Retroactively mask locations from fit_bglm result. #' #' @param x The \code{"fit_bglm"} result #' @param mask The mask to be applied to \code{x}. It's relative to the full #' mesh/voxel array, not \code{x}. # #' @return The masked result #' #' @keywords internal retro_mask_fit_bglm <- function(x, mask){ stopifnot...
516d20a442f01f53351a4abaa62269c6043a00f856bbd6ef6800b46c32175296
R
6,094
185
#' Crop image #' #' Crop whitespace from image #' #' @param x An image read by \code{png::readPNG}, or file path to that #' @param dims The dimensions to crop. Default: \code{seq(2)}. #' @return The cropped image #' #' @keywords internal #' crop_image <- function(x, dims=seq(2)){ use_file <- is.character(x) if ...
13147d02eb9e64523a0e33f7863d551527cfdef7e0eee2c6fcf5276ccb985e19
R
6,134
185
--- title: "Post mashR pipeline" subtitle: "sQTL" author: | | Katia de Paiva Lopes | Raj Lab | Department of Neuroscience | Icahn School of Medicine at Mount Sinai | NYC, New York date: "`r Sys.Date()`" output: rmarkdown::html_document: theme: united highlight: tango code_folding: hide toc: true ...
c8322a73458a0cd1ec3416f611460e2a43dd1225f91df0b6a88bc201e41f759a
R
6,140
179
# [Build --> Install and Restart] # Setup ------------------------------------------------------------------------ # [Edit these] doINLA <- TRUE saveResults <- TRUE overwriteResults <- TRUE resamp_res <- 9000 my_wb <- "~/Desktop/workbench" # path to your Connectome Workbench dir_results <- "tests/results_notInPackage...
c857c96466a056f1e09d7618b33fdb35f6ae7c7a3bdef554a248d9e3a7515c2f
R
6,320
183
library(caret) #library(boot) #library(MLmetrics) #library(ROCR) df<-read.csv("/Users/Tayfun/Desktop/Codes/Odor_val_prediction_R/Transformed_mean_data_odor_prediction.csv") df_minimized<-df[,c(3, 6:28)] head(df_minimized) table(df_minimized$Valence_class) ## Split train/test datasets Train <- createDataPartition(df_m...
bd3583768e7689f44c35bb89ae20f393bd6f97d8ae22da8f0d5d9eb0fd298b8d
R
6,507
209
#' Scale the design matrix #' #' @param design_mat The original (unscaled) design matrix that is T x K, where #' T is the number of time points, and k is the number of field covariates #' #' @return A scaled design matrix #' #' @keywords internal #' scale_design_mat <- function(design_mat) { stopifnot(is.matrix(d...
ac339bd5c5e4bb34c15b7e69eb6ca6696eb604e338c1aa1392210f530c433c5a
R
6,647
130
--- title: "`ciftiTools` Mini Demo" author: "Damon Pham & Amanda Mejia" date: "`r Sys.Date()`" output: rmarkdown::html_vignette: toc: true keep_md: true vignette: > %\VignetteIndexEntry{`ciftiTools` Mini Demo} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r include=FALSE} library(kni...
b99ced2f511ad68b46f655d2c9929614f2bb437afe580ec79dbb221ea4b9de60
R
6,745
190
#' Read a CIFTI file with optional resampling #' #' Read a CIFTI file by writing each component into a GIFTI and NIFTI file #' (\code{\link{separate_cifti}}), optionally resampling the GIFTIs, #' (\code{\link{resample_gifti}}), and then reading each separated #' component into R (\code{\link{make_xifti}}). Surface...
1cd0c9ab7d0f9c2d2811974493b4c1516cb8353d9205ec1fe2906ba75484bcef
R
6,945
114
# Templates ## Change Default Template {#default-tem} The template used for new templates will be your default template, which starts as the 189-point FRL-face template, but you can change this in the [Preferences](#prefs-default-template) (<span class="cmd">,</span>). You can see your current template under Current ...
5096064278c9ebd3bd69dd0978beeb513801647fd424e6d4448d2930915bffa4
R
7,157
211
# Calculate variance explained (R) setwd("Cog_EWAS_BayesR") library(data.table) loop = list.files("Cog_Comp/", pattern = "_processed.csv") ## Step 1 - Calculate Mean Variance explained by all probes and credible intervals names = readRDS("Cog_10k_cpgs.rds") names = names$cog_10k out2 = list() for(i in ...
42b7f15ea810c55d48b5d837c8c303232cd28dead76f3c1dc5f653dbce34fc2e
R
7,180
160
# dcm2niix output path creation ------------------------------------------- #' Finds dicom folders in dicom/session/subject folder structure #' #' @param input_folder a folder, containing /session/subject/dicomdata structure #' #' @return dataframe containing list, session and subject id #' @examples list_dicom_fol...
cf721b45e73a85668b2d68862266c4a88e1fa3f0fa7221f04a119921b85e79b0
R
7,340
257
#' Connectome Workbench #' #' @section Connectome Workbench Requirement: #' #' This function uses a system wrapper for the 'wb_command' executable. The #' user must first download and install the Connectome Workbench, available #' from https://www.humanconnectome.org/software/get-connectome-workbench . #' #' @name C...
906657614b2497fcd608fd25de1e125a5432019d4f2125d2819898538a13642f
R
7,375
181
#' Construct a triangular mesh from a 3D volumetric mask #' #' @inheritSection INLA_Description INLA Requirement #' #' @param mask An array of 0s and 1s representing a volumetric mask #' @param res The spatial resolution in each direction, in mm. For example, c(2,2,2) indicates 2mm isotropic voxels. #' @param nbhd_orde...
edb597ba207e9ab0bc711cc8228c5842a0bb0906a0f94a185ac311768f6811db
R
7,379
230
#' Undo the volumetric mask to the subcortex #' #' Un-applies the mask to the subcortical data in a \code{"xifti"} to yield its #' volumetric representation. #' #' @inheritParams xifti_Param #' @param fill The value for locations outside the mask. Default: \code{NA}. #' #' @return The 3D or 4D unflattened volume array...
56f308397493b10d9d8e2b26c06c14e3647c59eb2dc835180a10b139d42ed691
R
7,460
205
#' Beta posterior theta sampling #' #' Internal function used in joint approach to group-analysis #' #' @inheritSection INLA_Description INLA Requirement #' #' @param theta A single sample of theta (hyperparameters) from q(theta|y) #' @param spde A SPDE object from inla.spde2.matern() function. #' @param Xcros A crossp...
6ff2bbaba693628355d1aa194e73d916ddc58c9d86f39cab561e67704e3e658e
R
7,659
214
#' Activations prevalence. #' #' @param act_list List of activations from \code{\link{activations}}. All #' should have the same sessions, fields, and brainstructures. #' @param gamma_idx If activations at multiple thresholds were computed, which #' threshold should be used for prevalence? Default: the first (lowest)...
b43d8821769e75be77a2961008faf27b7474f5c37311f585817d73559574079a
R
7,659
175
#' Read in GIFTI files as a \code{"xifti"} object #' #' Read in GIFTI metric or label files as a \code{"xifti"} object. May also include #' surface geometry GIFTI files and perform resampling. #' #' @param cortexL,cortexL_mwall Left cortex data and ROI. Each must be a path to #' a metric or label GIFTI file. #' ...
293e6a84e65959b2879459feaa925d917c0af3b6213cc4d52aed314c8db9d3e2
R
7,671
159
#Figure 2 #XPEHH #Create for of XPEHH for top 50 scaffolds. Highlighting scaffold 27 setwd("path/to/folder") xpehh=read.table("xpehh.top50.tsv",header=TRUE) library(dplyr) #adapted from: https://www.r-graph-gallery.com/101_Manhattan_plot.html don <- xpehh %>% # Compute chromosome size group_by(chr) %>% ...
1c4aa7d2b275739456ae7f356eef804c8ad1cad3fdeb0fe1027d8d9ef9bb903a
R
7,780
232
#### Combined Model ~ 10k #### ## DNA methylation file require(EpiSmokEr) require(lumi) setwd("") ## Wave 1 meth_w1 = readRDS("norm_mvals_5087.rds") # Mean impute missings w1_nas = apply(meth_w1,1,function(x){which(is.na(x))}) nas = which(unlist(lapply(w1_nas, length))>0) for(i in names(nas)){ imp = mean...
7961140f23f0e96a434c1545cbec84394a657c60e98cb3b30651e82d3c1e29d2
R
7,862
173
#' Assemble a \code{"xifti"} from data #' #' Assembles cortical data, subcortical data, and/or surface geometry to form a #' \code{"xifti"}. The inputs must be data objects (vectors, matrices or #' arrays, depending on the argument). #' #' @inherit make_xifti details #' #' @param cortexL,cortexL_mwall Left corte...
344e46a945597e426595de72fcc7eca8fabc6c899be609c9537316dcd76a84f3
R
7,986
256
--- title: "mashR: tissue-specific effects" subtitle: "sQTL results" author: | | Katia de Paiva Lopes | Raj Lab | Department of Neuroscience | Icahn School of Medicine at Mount Sinai | NYC, New York date: "`r Sys.Date()`" output: rmarkdown::html_document: theme: united highlight: tango code_folding: h...
0187cf8f3602c8f07606552172004890577a8c8b8ae77cff1e569228445efab7
R
7,987
235
--- title: "Aging analysis for sQTL" subtitle: " " author: | | Katia de Paiva Lopes | Jack Humphrey | Raj Lab | Department of Neuroscience | Icahn School of Medicine at Mount Sinai | NYC, New York date: "`r Sys.Date()`" output: rmarkdown::html_document: theme: united highlight: tango code_folding: hi...
35cbae19beb59ad0350f1dac70969e61c4014e18bf70561b59bad9362b732457
R
7,999
233
# #' Create SPDE for 3D volumetric data # #' # #' @inheritSection INLA_Description INLA Requirement # #' # #' @param locs Locations of data points (Vx3 matrix) # #' @param labs Region labels of data points (vector of length V). If NULL, treat observations as a single region. # #' @param lab_set Only used if labs is not...
b9151e1a29c4213719b1ac4757d0a355ff7b2f1e144302b114bd15d61fad5a0a
R
8,119
248
# [Build --> Install and Restart] # Setup ------------------------------------------------------------------------ # [Edit these] doINLA <- TRUE saveResults <- TRUE overwriteResults <- TRUE resamp_res <- 9000 my_wb <- "~/Desktop/workbench" # path to your Connectome Workbench dir_results <- "tests/results_notInPackage...
e8854d2abf468d51e168cb4586b6337498863efd1bcaf5853428a6331a2860d2
R
8,154
207
#' Request \code{"wb_path"} #' #' Print a message requesting that the \code{ciftiTools} option \code{"wb_path"} #' be set. #' #' @keywords internal #' @return The message (length 1 character vector) wb_path_request <- function() { paste( "\nciftiTools requires the path to the Connectome Workbench folder, ", ...
92eab031e86664b92ae7ab810c342c92b75586daaf4f6ff9a830a236ec61ef07
R
8,181
209
#' Read a CIFTI file #' #' Read in a CIFTI file as a \code{"xifti"} object. #' #' First, metadata is obtained with \code{\link{info_cifti}}. Then, if no #' resampling is requested, the \code{-cifti-convert -to-gifti-ext} Workbench #' Command is used to "flatten" the data and save it as a metric or label GIFTI #'...
f20fcc2aafd73c6568dd2cc8e7885bb4b7d147fc917bec1e8c6b02d20aed96dc
R
8,243
227
#' S3 method: use \code{\link[ciftiTools]{view_xifti}} to plot a \code{"BGLM"} object #' #' @param x An object of class "BGLM" #' @param Bayes \code{TRUE} for plotting Bayesian results, \code{FALSE} for plotting #' classical GLM results. Default: \code{NULL}, which will use the Bayesian results #' if available and the ...
df582a92e34ea4b80b82ab98e3f10ceb9d15820c39296bfdb5177b94c2154780
R
8,292
240
--- title: "Looking at covariates" subtitle: "Supp figure for the MiGA paper" author: | | Katia de Paiva Lopes | Raj Lab | Department of Neuroscience | Icahn School of Medicine at Mount Sinai | NYC, New York date: "`r Sys.Date()`" output: rmarkdown::html_document: theme: united highlight: tango code_f...
c058910aeb2929a05c28d7922d14ee684622269ee5bee1642df56ea23e5f9770
R
8,387
240
### Create a manhattan plot with Cog and NonCog summary statistics ### Using the function adapted by Hill Ip library(data.table) source("C:/Users/HIP200/Dropbox/999_assorted_functions_and_scripts/003_own_manhattan/own_manhattan.R") setwd("./Hits_Manhattan") load("../output/Cognitive_GWAS_with23andMe.RData")...
0da03588bc24c3f15bd00be2e277df972b6ef865ee2b6cb44a8de493b665817c
R
8,440
272
--- title: "Exploratory plots" subtitle: "After QC" author: | | Katia de Paiva Lopes | Raj Lab | Department of Neuroscience | Icahn School of Medicine at Mount Sinai | NYC, New York date: "`r Sys.Date()`" output: rmarkdown::html_document: theme: united highlight: tango code_folding: hide toc: true ...
b99a3fadd5a6b3dfbd1a12d6b29aeb82dcd32a6ee8349751ba532cd55cd35aee
R
8,463
254
--- title: "Aging analysis for sQTL" subtitle: "" author: | | Katia de Paiva Lopes | Jack Humphrey | Raj Lab | Department of Neuroscience | Icahn School of Medicine at Mount Sinai | NYC, New York date: "`r Sys.Date()`" output: rmarkdown::html_document: theme: united highlight: tango code_folding: hid...
1170ea76389b7a09b84ad0f84d8acc5cc692c3e51ef740971edfb68b171d3c4c
R
8,904
224
--- title: "Results from e-QTL" subtitle: "by Brain region" authors: | | | Katia de Paiva Lopes | Ricardo A Vialle | Jack Humphrey | | Raj Lab | Department of Neuroscience | Icahn School of Medicine at Mount Sinai | NYC, New York date: "`r Sys.Date()`" output: rmarkdown::html_document: theme: united ...
59615b49f158f7baf408154e96c197fee4adf564482eebb694856d125bb13445
R
8,951
238
#' Apply a univariate transformation to a \code{"xifti"} or pair of \code{"xifti"}s. #' #' Apply a univariate transformation to each value in a \code{"xifti"} or pair of #' \code{"xifti"}s. If a pair, they must share the same dimensions (brainstructures) #' and number of measurements. #' #' If the \code{"xifti"} had ...
295909da9131814366edb86a1a2b001b8cbdb86797d899ee3b2f775dfb9bcbd5
R
8,970
236
--- title: "Spectral parameterization for studying neurodevelopment: How and why" subtitle: "Fitting individual power spectrum" author: "Brendan Ostlund, Thomas Donoghue, Berenice Anaya, Kelley E. Gunther, Sarah L. Karalunas, Bradley Voytek, & Koraly E. Pérez-Edgar" output: html_document --- Participating families were...
869e8dade94c75d9558ada6425cf2956191c8df33248de1b79c70cc4aaf46279
R
9,182
273
# [Build --> Install and Restart] # Setup ------------------------------------------------------------------------ # [Edit these] doINLA <- TRUE saveResults <- TRUE overwriteResults <- TRUE resamp_res <- 7000 # my_pardiso <- "~/Documents/pardiso.lic" # INLA PARDISO license my_wb <- "~/Applications/workbench" # path to...
2d342190e88aea75b9268877caba6d3bf71f8b3e27b1b0f7c0c5f992acb5c5df
R
9,291
220
#' Write a data matrix to a GIFTI metric file #' #' Write the data for the left or right cortex to a metric GIFTI file. #' #' @param x A \eqn{V \times T} data matrix (V vertices, T measurements). This can also #' be an object from \code{gifti::readgii}, or a length \eqn{T} list of length #' \eqn{V} vectors. #' @param...
8154963b232aff8742b73337f69e95fdcb3c677807c0645d9e4920bdfb597497
R
9,528
197
# Katia Lopes # July 09,2020 # Kmeans approach for regional differences in the microglia dataset #This command clean all variables. BE CAREFULL!!! rm(list = setdiff(ls(), lsf.str())) # install.packages("wesanderson") library(wesanderson) library(dplyr) library(tidyr) library(ComplexHeatmap) library(venn) library(g...
8e69b36834a3c74cf5149705e7901f94902fa34d9baeef4858b3fa342e9e8e6f
R
9,534
255
--- title: "Differential expression analysis" subtitle: "SVZ x STG" author: | | Katia de Paiva Lopes | Raj Lab | Department of Neuroscience | Icahn School of Medicine at Mount Sinai | NYC, New York date: "`r Sys.Date()`" output: rmarkdown::html_document: theme: united highlight: tango code_folding: hi...
aab9f2bcbda3bd8fac547aacc3ba1c618afa393c19f0593c41bf8c52428584a5
R
9,536
255
--- title: "Differential expression analysis" subtitle: "MFG x SVZ" author: | | Katia de Paiva Lopes | Raj Lab | Department of Neuroscience | Icahn School of Medicine at Mount Sinai | NYC, New York date: "`r Sys.Date()`" output: rmarkdown::html_document: theme: united highlight: tango code_folding: hi...
afbaaf67664900d5219112512ef73a19c223772cb7d8158e39279b38369e4ca1
R
9,536
255
--- title: "Differential expression analysis" subtitle: "THA x STG" author: | | Katia de Paiva Lopes | Raj Lab | Department of Neuroscience | Icahn School of Medicine at Mount Sinai | NYC, New York date: "`r Sys.Date()`" output: rmarkdown::html_document: theme: united highlight: tango code_folding: hi...
fbb62c3243b0645223a6fa80bfd24e053e77a2f1726bd9f366e1119e626c6495
R
9,536
255
--- title: "Differential expression analysis" subtitle: "THA x MFG" author: | | Katia de Paiva Lopes | Raj Lab | Department of Neuroscience | Icahn School of Medicine at Mount Sinai | NYC, New York date: "`r Sys.Date()`" output: rmarkdown::html_document: theme: united highlight: tango code_folding: hi...
28338786598f3fa1ec98f3f32ee5ea0da42394b7971169ee41759372ad491f3d
R
9,537
255
--- title: "Differential expression analysis" subtitle: "THA x SVZ" author: | | Katia de Paiva Lopes | Raj Lab | Department of Neuroscience | Icahn School of Medicine at Mount Sinai | NYC, New York date: "`r Sys.Date()`" output: rmarkdown::html_document: theme: united highlight: tango code_folding: hi...
4fc86c414c86fea990b371314a6154cabc99c478c68ad7d353cf3f82af7e56eb
R
9,589
256
--- title: "Differential expression analysis" subtitle: "MFG x STG" author: | | Katia de Paiva Lopes | Raj Lab | Department of Neuroscience | Icahn School of Medicine at Mount Sinai | NYC, New York date: "`r Sys.Date()`" output: rmarkdown::html_document: theme: united highlight: tango code_folding: hi...
ca1b516ec2128f19afdafa4aa5a2e8d7c7e58b99baa18a1295a811338c965c10
R
9,618
222
--- title: "Plotting the Effect Sizes" subtitle: " " author: | | Katia de Paiva Lopes | Raj Lab | Department of Neuroscience | Icahn School of Medicine at Mount Sinai | NYC, New York date: "`r Sys.Date()`" output: rmarkdown::html_document: theme: united highlight: tango code_folding: hide toc: true...
1eeaddf7a09f445ffa75ac69cd9cfdb54f714c6188fc2bb2149bdda8e9bbc67e
R
9,697
225
# Katia Lopes # Mar 5, 2021 # Samples grouped by donor for all genes #This command clean all variables. BE CAREFULL!!! rm(list = setdiff(ls(), lsf.str())) if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") library("ggeasy") library("ggsci") library("ggplot2") library("factoextra"...
0776252862244018f775e29b4635982b335601767763e929da7fd961f7f4a1fb
R
9,751
318
#' Format a path #' #' Normalize and validate a path (optionally, within a certain directory). #' #' @param path The path to normalize. #' @param dir (Optional) the directory to append to the beginning of the path. #' \code{NULL} (default) to not append any directory, leaving \code{path} #' unchanged. #' @param mode ...
6bab7c0cb3d260a991222679ee099398bbaafc7a0ff87e138e39af9d13b3397b
R
9,752
279
--- title: "Age-related analysis" subtitle: "Using Dream" author: | | Katia de Paiva Lopes | Raj Lab | Department of Neuroscience | Icahn School of Medicine at Mount Sinai | NYC, New York date: "`r Sys.Date()`" output: rmarkdown::html_document: theme: united highlight: tango code_folding: hide toc:...
daeee5bb9791b035538543c8ba55d95d05d205af994efc04b7f55d522ebe3b24
R
9,784
241
#' Resample a series of GIFTIs related to a CIFTI file #' #' Performs spatial resampling of various CIFTI file components on #' the cortical surface. (The subcortical data is not resampled here.) #' GIFTI surface geometry files can additionally be included: see #' \code{surfL_original_fname} and \code{surfR_original...
56b5efd2afef70b9fcdaa9025776ef431247ee93ebac7e092ab836197358abbb
R
9,974
276
--- title: "Sex-related analysis" subtitle: "Using Dream" author: | | Katia de Paiva Lopes | Raj Lab | Department of Neuroscience | Icahn School of Medicine at Mount Sinai | NYC, New York date: "`r Sys.Date()`" output: rmarkdown::html_document: theme: united highlight: tango code_folding: hide toc:...
e091629269b5b4771d07e8ab595c63ea70aac662a5818efeb64048d1a68c48cb
R
9,979
276
--- title: "Differential expression analysis" subtitle: "PD x CT" author: | | Katia de Paiva Lopes | Raj Lab | Department of Neuroscience | Icahn School of Medicine at Mount Sinai | NYC, New York date: "`r Sys.Date()`" output: rmarkdown::html_document: theme: united highlight: tango code_folding: hide...
f076c396a2ba9824eff5a0402f0e6384ee9e7c25edbac8ee3f5b064203f09b55
R
9,994
276
--- title: "Differential expression analysis" subtitle: "Dementia x CT" author: | | Katia de Paiva Lopes | Raj Lab | Department of Neuroscience | Icahn School of Medicine at Mount Sinai | NYC, New York date: "`r Sys.Date()`" output: rmarkdown::html_document: theme: united highlight: tango code_folding...
73047121f34300db228b2342d3a262d81b54c3b885a250cb46231137fe92d258
R
10,228
273
--- title: "Locus Zoom Plots" author: "Jack Humphrey" date: "17/09/2020" output: html_document: toc: true toc_depth: 2 toc_float: true code_folding: hide dev: 'svg' --- ```{r setup, include=FALSE} library(tidyverse) library(patchwork) library(ggrepel) library(ggrastr) knitr::opts_chunk$set(echo ...
01cb70967d7c1e6b8e04af784fcdfe08cb2abb2cebdd26fba01552fc99f19a91
R
10,239
278
--- title: "Differential expression analysis" subtitle: "Depression x CT" author: | | Katia de Paiva Lopes | Raj Lab | Department of Neuroscience | Icahn School of Medicine at Mount Sinai | NYC, New York date: "`r Sys.Date()`" output: rmarkdown::html_document: theme: united highlight: tango code_foldi...
9d2d19b088de7e5987c5360130749d5c724ecea22dd065c45f5dbfd807b1146a
R
10,242
263
#' Write subcortical data to NIFTI files #' #' Write subcortical data to NIFTI files representing the data values, #' subcortical structure labels, and volumetric mask. The input formats of #' \code{subcortVol}, \code{subcortLabs}, and \code{subcortMask} #' correspond to the data structures of \code{xifti$data$subc...
4cce02597d2421b389751ac584e409b01cb259ecf4eec553d68599db09b88b1f
R
10,461
251
# Katia Lopes # July 21, 2020 # Samples grouped by donor for all genes #This command clean all variables. BE CAREFULL!!! rm(list = setdiff(ls(), lsf.str())) if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") library("ggeasy") library("ggsci") library("ggplot2") library("factoextr...