sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
315afc34d1f5df0355e503133786d0edd891012d62252bad1007cbf015cc0592 | R | 6,493 | 132 | # Basic setups ------------------------------------------------------------
library('dplyr')
library('pbapply')
library('nlme')
setwd('/exports/igmm/eddie/GenScotDepression/shen/ActiveProject/ImagingProject/ABCD_MDD_brain/')
# Load data ---------------------------------------------------------------
# fam dat... |
7f39345226816ed233e5ae6e2a19c9f00d5446f7d737f47b8cc58a52f38d97c7 | R | 6,499 | 137 | # Basic setups ------------------------------------------------------------
library('dplyr')
library('pbapply')
library('nlme')
setwd('/gpfs/igmmfs01/eddie/GenScotDepression/shen/SData/UKB/iv.ABCD/release2.0.1/FamilialRisk_PGRS_MDD')
# Load data ---------------------------------------------------------------
# fam da... |
4f12123d539125a27e63db25e06c932c2fe0a988b5f74a2798d57083aa55be41 | R | 6,504 | 203 | library(tidyverse)
library(covidData)
library(here)
setwd(here())
## note that this file depends on a recent successful covidData `make all`
## function to load one week of data for a particular target variable as of a certain date
load_one_as_of <- function(as_of, target_var)
{
# temporal resolution depends on t... |
dee95f0aebef6deae6da3c6c2eb5cf84346a64c4e4ea88ae6934009d2b6da1f0 | R | 6,515 | 131 | # Basic setups ------------------------------------------------------------
library('dplyr')
library('pbapply')
library('nlme')
setwd('/gpfs/igmmfs01/eddie/GenScotDepression/shen/ActiveProject/ImagingProject/Adolescent_MDD_brain')
# Load data ---------------------------------------------------------------
# fam data
... |
562a7410526108467f87e2fdcf833bd9083e884cb5815361e19c8ae275166bae | R | 6,541 | 130 | # Basic setups ------------------------------------------------------------
library('dplyr')
library('pbapply')
library('nlme')
setwd('/exports/igmm/eddie/GenScotDepression/shen/ActiveProject/ImagingProject/ABCD_MDD_brain/')
# Load data ---------------------------------------------------------------
# fam dat... |
474e444b400e470e07979eb7080afba72416e49a291bf25c6a29dafc72a1e597 | R | 6,542 | 135 | # Basic setups ------------------------------------------------------------
library('dplyr')
library('pbapply')
library('nlme')
setwd('/exports/igmm/eddie/GenScotDepression/shen/ActiveProject/ImagingProject/ABCD_MDD_brain/')
# Load data ---------------------------------------------------------------
# fam dat... |
d815fbd636734be77c1b53c0c5e11eb634009dba8e7cc07c17e50db665a8056b | R | 6,579 | 210 | # A modest attempt at testing the R functions for plausibility checks
# Keep in mind that the checks in Python are authoritative.
### THESE FUNCTIONS ARE NO LONGER MAINTAINED OR KEPT IN SYNC WITH THE AUTORITATIVE PYTHON CHECKS
### THEY ARE KEPT HERE MERELY AS A RESSOURCE FOR TEAMS SPECIALIZING IN R.
# Johannes Brache... |
c07559294fcbe66571a4905318116bb0fbb1b01e531b0e1fc44229bed0f54e4f | R | 6,586 | 161 |
setwd("Z:/Documents/sdata_backup/Shen/iv.ABCD/release2.0.1/FamilialRisk_PGRS_MDD")
# Dot plot ----------------------------------------------------------------
library(dplyr)
library(ggplot2)
library(magrittr)
library(ggpubr)
library(cowplot)
# Settings
load('result/x.Supplementary_materials/FAMrisk_asr_WM_FS.RData'... |
ac1875d9ebf8f812b15869c4872abc70cc8ad291fa1485857ebc50b96f51a87d | R | 6,655 | 132 | # Basic setups ------------------------------------------------------------
library('dplyr')
library('pbapply')
library('nlme')
setwd('/exports/igmm/eddie/GenScotDepression/shen/ActiveProject/ImagingProject/ABCD_MDD_brain/')
# Load data ---------------------------------------------------------------
# fam dat... |
5035f86b6efa442505388224422ff56ab98669c522844d9f6bb9e245b1c27ede | R | 6,664 | 137 | # Basic setups ------------------------------------------------------------
library('dplyr')
library('pbapply')
library('nlme')
setwd('/gpfs/igmmfs01/eddie/GenScotDepression/shen/SData/UKB/iv.ABCD/release2.0.1/FamilialRisk_PGRS_MDD')
# Load data ---------------------------------------------------------------
# fam da... |
bf5a91c17aa37c4e7e8da831a7d57ddf4184f36c78b04447460b9dc5b7692e24 | R | 6,665 | 210 | library(gplots)
library(ggplot2)
######## Two data files
##
##
### function
statm <- function(x,narm=FALSE)
{
moy=mean(x,na.rm=TRUE)
sem=sd(x,na.rm=TRUE)/sqrt(length(x))
mini=min(x)
maxi=max(x)
return(list(mini=mini,maxi=maxi,moy=moy,sem=sem))
}
###### Generative model of a sequence of choices. Three points ... |
96c86a4410c3c1dbdbb77eb1bbefcfecbc43d856418c20e1d90f9f5a8bc27a63 | R | 6,703 | 162 |
setwd("Z:/Documents/sdata_backup/Shen/iv.ABCD/release2.0.1/FamilialRisk_PGRS_MDD")
# Dot plot ----------------------------------------------------------------
library(dplyr)
library(ggplot2)
library(magrittr)
library(ggpubr)
library(cowplot)
# Settings
load('result/x.Supplementary_materials/FamRisk_WM_subcor_FS_har... |
508e3030ee58b67de1dda4d8384e76cd31613ebda0b5d6821d6fcd15ddd23c38 | R | 6,706 | 162 |
setwd("Z:/Documents/sdata_backup/Shen/iv.ABCD/release2.0.1/FamilialRisk_PGRS_MDD")
# Dot plot ----------------------------------------------------------------
library(dplyr)
library(ggplot2)
library(magrittr)
library(ggpubr)
library(cowplot)
# Settings
load('result/i.Main_result/famRisk_noSocialCov.RData')
targetd... |
ccaf1bb2aa105846ab5bd073fbd17e273b0c85479db73474ea23db968ebe5c0f | R | 6,739 | 99 | ### calculate the melting score of long genes based on Genome Architecture Mapping (GAM) insulation scores.
### developed by Dominik Szabo (dominik.szabo@mdc-berlin.de) and Christoph J. Thieme (christoph.thieme@mdc-berlin.de)
library(tidyverse)
#set working directory to the directory code is in, to make sure that fil... |
d155308a632d965c05568da0c4411a2bbf731320d8f5bb0717aecb4bb9ade4fc | R | 6,779 | 232 | #!/usr/bin/Rscript
#Rscript script common-path jaspar-dir id output
#example:
#Rscript pwmmatch.r /cluster/thashim/basepiq/common.r /cluster/thashim/basepiq/pwms/jaspar.txt 141 /cluster/thashim/basepiq/tmp/pwmout.RData
options(echo=TRUE)
args <- commandArgs(trailingOnly = TRUE)
print(args)
commonfile = args[1]
jaspar... |
28876f28fe695e1a8b016e7e79b832ce61ba03eea736c58ed8ac0e07be517903 | R | 6,839 | 178 | ct <- as(otu_table(pediatric_ibd), "matrix")
gm_mean <- function(x, na.rm = TRUE) {
exp(sum(log(x[x > 0]), na.rm = na.rm) / length(x))
}
geoMeans <- apply(ct, 1, gm_mean)
test_that("ensure the results are the same for object in different class ", {
ot <- otu_table(enterotypes_arumugam)
df <- as.data.frame(... |
e2b920274e14f5811746f8545ac9d2bd1ca88d1cb0f044771b55fd44eb735c51 | R | 6,865 | 162 |
setwd("Z:/Documents/sdata_backup/Shen/iv.ABCD/release2.0.1/FamilialRisk_PGRS_MDD")
# Dot plot ----------------------------------------------------------------
library(dplyr)
library(ggplot2)
library(magrittr)
library(ggpubr)
library(cowplot)
# Settings
load('result/x.Supplementary_materials/FamRisk_WM_s... |
5394ac4ca346adeb16de037f1786caa74c2832cbb7248dd757e6ff576e844d8a | R | 6,871 | 162 |
setwd("Z:/Documents/sdata_backup/Shen/iv.ABCD/release2.0.1/FamilialRisk_PGRS_MDD")
# Dot plot ----------------------------------------------------------------
library(dplyr)
library(ggplot2)
library(magrittr)
library(ggpubr)
library(cowplot)
# Settings
load('result/i.Main_result/famRisk_freesurfer.RData... |
64526cf75d4b2eadf610e52ea8d5526db2e0fcaea120518a5041f21d186ac558 | R | 6,891 | 228 | library("googlesheets4")
library(tidyverse)
library(here)
setwd(here())
# historical records of cases, hospitalizations, and deaths using
# data available as of Sunday each week.
most_recent_sunday <- lubridate::floor_date(Sys.Date(), unit = "week")
first_as_of_dates <- data.frame(
measure = c("cases", "hospitalizat... |
17e1dbed85249c627eef10e3ed64a64619a1776ebc01be124b185d559cca5801 | R | 6,904 | 139 | # Basic setups ------------------------------------------------------------
library('dplyr')
library('pbapply')
library('nlme')
setwd('/exports/igmm/eddie/GenScotDepression/shen/SData/UKB/iv.ABCD/release2.0.1/FamilialRisk_PGRS_MDD/')
# Load data ---------------------------------------------------------------
# fam da... |
0d81af1e079fc345f8d3e09f472fcf2218b02c7185f45d6ce10e5e9f79f829a0 | R | 6,964 | 148 | # Basic setups ------------------------------------------------------------
library('dplyr')
library('pbapply')
library('nlme')
setwd('/exports/igmm/eddie/GenScotDepression/shen/SData/UKB/iv.ABCD/release2.0.1/FamilialRisk_PGRS_MDD/')
# Load data ---------------------------------------------------------------
# fam da... |
c8980cbbbc991c3b1e24cca9b9539144da3736e61f00797f32a944bfecaeab20 | R | 7,001 | 137 | # Basic setups ------------------------------------------------------------
library('dplyr')
library('pbapply')
library('nlme')
setwd('/exports/igmm/eddie/GenScotDepression/shen/ActiveProject/ImagingProject/ABCD_MDD_brain/')
# Load data ---------------------------------------------------------------
# fam dat... |
a900df4fc786ac3b39a394b1c239ef663c2f0ec9c1005f455a5af6b6a59a306a | R | 7,052 | 155 | setwd('Z:/Documents/sdata_backup/Shen/iv.ABCD/release2.0.1/AdolescentMDD/')
library(dplyr)
library(plyr)
library(ggplot2)
library(ggridges)
library(ggpubr)
# Load data ---------------------------------------------------------------
FAM.dat=readRDS('data/FamHistory_clean/FAM.dat_Unrelated_clean.rds')
FAM.dat=FAM.dat[,... |
864d15384127eceef2e7c0f7e98df47cf7e0a3350e8270ff2edd075152c37357 | R | 7,116 | 141 | # Basic setups ------------------------------------------------------------
library('dplyr')
library('pbapply')
library('nlme')
setwd('/exports/igmm/eddie/GenScotDepression/shen/SData/UKB/iv.ABCD/release2.0.1/FamilialRisk_PGRS_MDD/')
# Load data ---------------------------------------------------------------
# fam da... |
992ac2a028cf513caddeea3edebd0c548ace6f571498dc604878e928d9370a23 | R | 7,143 | 232 | #' bar and dot plot of effect size of microbiomeMarker data
#'
#' bar and dot plot of effect size microbiomeMarker data. This function returns
#' a `ggplot2` object that can be saved or further customized using **ggplot2**
#' package.
#'
#' @param mm a [`microbiomeMarker-class`] object
#' @param label_level integer, nu... |
3e8c7435e3f917f11f4c6ad87740fe4dacca6459e804a2205c37478b1b110b05 | R | 7,169 | 146 | # Basic setups ------------------------------------------------------------
library('dplyr')
library('pbapply')
library('nlme')
setwd('/gpfs/igmmfs01/eddie/GenScotDepression/shen/SData/UKB/iv.ABCD/release2.0.1/FamilialRisk_PGRS_MDD')
# Load data ---------------------------------------------------------------
# fam da... |
ebb7dcdeaedb847437d424deed32d375f8aefb22f0ee40ea785083d470ef8b95 | R | 7,305 | 163 | ######
# by Shen
# Purposes:
# 1. Create and tidy up depression categorical phenotypes: MDD and broad depression (other unspecified types of depression included)
# 2. Summarise depressive symptoms based on KSADS and CBCL
# 3. Extract individual items in KSADS and CBCL
library(dplyr)
setwd('/gpfs/igmmfs01/eddie/GenSc... |
3fa7996408c3c3a2ed573c748aead175f0375764569a23797501aec860de2081 | R | 7,306 | 195 | library(data.table)
setwd("~/work/ibs")
P = fread("pheno/ukb24282.csv")
NAtoF = function(v){
v[is.na(v)]=FALSE
return(v)
}
save_zip = function(object,path){
fwrite(object,path)
zip(paste0(path,".zip"),path)
}
#Gold-standard previous celiac disease / gluten sensitivity diagnosis
gold = -703:-705
q.cel.glut.gold... |
7209af9aeb33f9fc0b29b01c6b689748e2104eec035ec28b1cf97fb425eef7e0 | R | 7,326 | 223 | #assert existence of
#commonfile
source(commonfile)
#pwmfile
#load(file.path(pwmdir,paste0(pwmid,'.pwmout.RData')))
#tmpdir
#outdir
#####
# make bg
datadir = paste0(tmpdir,'/',pwmid,'/')
nsites = Reduce('+',lapply(list.files(datadir,paste0('positive.tf',pwmid,'-'),full.names=T),function(i){load(i);ncol(pos.mat)}))
if... |
3fe543b3e0a3adf8e34437a9cd122494d49eaba2ba336f9cea9417ba8ad3011b | R | 7,356 | 146 | # Basic setups ------------------------------------------------------------
library('dplyr')
library('pbapply')
library('nlme')
setwd('/exports/igmm/eddie/GenScotDepression/shen/SData/UKB/iv.ABCD/release2.0.1/FamilialRisk_PGRS_MDD/')
# Load data ---------------------------------------------------------------
# fam da... |
5a2b5af911670adcee5276bf5cc8eb7aa6cb0cb326d61f5452d1e996300282a4 | R | 7,365 | 145 | # Basic setups ------------------------------------------------------------
library('dplyr')
library('pbapply')
library('nlme')
setwd('/exports/igmm/eddie/GenScotDepression/shen/ActiveProject/ImagingProject/ABCD_MDD_brain/')
# Load data ---------------------------------------------------------------
# fam dat... |
435bb9a818ebd0727ec9453ec5bc289b16acce0f1dcb5918f8cea9164d7bda05 | R | 7,508 | 178 | ## plot expression and chromatin accessability over the melting score per gene
#script used for plotting of figures 2h + 2i (RNA/ATAC over melting score in OLG, DN_R1 and PGN_R1)
# supplementary figures 5d+e (RNA/ATAC over melting score in DN_R2 and PGN_R2)
# and supplementary figure 5c (correlation of melting scores i... |
4621912376c1eddebb56b2e28868ecb2e0a6fd2cf6f59cf345aa4b8a9e2b4e69 | R | 7,547 | 94 | # 12th May 2021
# Analysing new permutation test results
# 28th Sept 2021
# Updated to consider rho correlations; add milk cases without outlier
library(tidyverse)
library(cowplot)
setwd("/Users/hartfield/Documents/MilkSDS/HOL_Data_Analysis/PermutationTest")
# Reading in tables
datH <- read_table2("CompiledRes/HOL_... |
4c813a6b38ac83a8ff31dd7b6d9c43c6451c6cd07b274e0fcca0740a9e88969f | R | 7,578 | 189 | #function to generate predicted response with confidence intervals from a (G)LM(M)
#works with the following model/class: lm, glm, glm.nb, merMod
#this function average over potential covariates
#it also allows for the specification of one or several interacting variables
#these must be factor variables in the model
#f... |
a24acfcdfda2851e6e380c9304a6ed8ae971309b32902040aa4831bd72a1091d | R | 7,590 | 152 | suppressMessages(require(DescTools))
suppressMessages(require(data.table))
suppressMessages(require(stringr))
suppressMessages(require(argparser))
#parse arguments:
parser <- arg_parser('Calculate insulation scores of a 3-column long matrix in a_start, b_start, value format at user specified insulation square size... |
314bb493850c29386d3d6ccd8a302f07e574b62e06c1afa619d624fbdfc70295 | R | 7,611 | 196 | ---
title: "Zoltar: a forecast repository"
author: "brought to you by the Reich Lab Zoltar Development Team: <br> Matt Cornell, Khoa Le, Abdul Hannan Kanji, Katie House, <br> Yuxin Huang, Evan Ray, Nick Reich <br> http://zoltardata.com"
date: "<br> {height=100px} {height=100px} <br><br>... |
2ab8aede1f1bc375fa7888a3b50a0e12c79c54188345e0e066418fa9caffcea1 | R | 7,616 | 200 | #' Simple statistical analysis of metagenomic profiles
#'
#' Perform simple statistical analysis of metagenomic profiles. This function
#' is a wrapper of `run_test_two_groups` and `run_test_multiple_groups`.
#'
#' @param ps a [`phyloseq::phyloseq-class`] object
#' @param group character, the variable to set the group
... |
674afed2f14723b5387c1dad891efc0b6016d0fdbdc4fb73ca78f27761416cd9 | R | 7,627 | 250 | # marker_table class -----------------------------------------------------------
#' Build or access the marker_table
#'
#' This is the recommended function for both building and accessing microbiome
#' marker table ([`marker_table-class`]).
#' @param object an object among the set of classes defined by the
#' microbio... |
5d9516cd2b1b4b7ce4fa2ea46226edd2474d2b96f254375fa30908c830ed93fa | R | 7,793 | 196 | #' Find makers (differentially expressed metagenomic features)
#'
#' `run_marker` is a wrapper of all differential analysis functions.
#'
#' @param ps a [`phyloseq::phyloseq-class`] object
#' @param group character, the variable to set the group
#' @param da_method character to specify the differential analysis method.... |
2e8e0da505838b9df4db8f0ae445b07d2bfce8c0e04c181db3f9c1bee9c4cf4e | R | 7,858 | 191 | #install.packages("UpSetR")
#install.packages("nVennR")
library(UpSetR)
library(nVennR)
library(data.table)
setwd("~/work/ibs")
NAtoF = function(v){
v[is.na(v)]=FALSE
return(v)
}
#M = fread("/home/cq/work/ibs/filters/all_integrated.csv") #Old, from raw case definitions
M = fread("~/work/ibs/clinical/clinical_dat... |
1415f4df40706a3bd62d7e7996b5c0eaf9f0f3870d1479291d666f1735b9850b | R | 7,908 | 245 | # This function is modified from import_qiime2.R in MicrobiotaProcess
# https://github.com/YuLab-SMU/MicrobiotaProcess/blob/master/R/import_qiime2.R
# and https://github.com/jbisanz/qiime2R
#' Import function to read the the output of dada2 as phyloseq object
#'
#' Import the qiime2 artifacts, including feature table,... |
5c4dac691175ac6c870f63a41de3cdc4ed0d0273c9aafa5a82d7a3b93b7cc789 | R | 8,089 | 151 | ######
# by Shen
library(dplyr)
setwd('/exports/igmm/eddie/GenScotDepression/shen/SData/UKB/iv.ABCD/release2.0.1/FamilialRisk_PGRS_MDD')
tab.dat.dir='/exports/igmm/eddie/GenScotDepression/shen/SData/ABCD/release2.0.1/iii.data'
# merge, QC and save the master file (FreeSurfer)------------------------------------------... |
a2ce70038c42c86d486e2718345f4ee155a005333f0563b8c4a550613685efc2 | R | 8,108 | 171 | library("lme4")
library("ggplot2")
library("lsmeans")
library("car")
library("doBy")
library('emmeans')
source('plot_fit.R')
# Read gaze data
gaze_data<-read.csv(file='./data/all_facial_gestures_gaze_summary.csv',header=TRUE,sep=',')
#Only consider trials where proportion onscreen is more than 0
n_trials_pre<-nrow(ga... |
35868431757eb0425a45500532a8dd9b390ec9a8fcc7e5487ceacacd71fe20d3 | R | 8,119 | 169 | library("lme4")
library("ggplot2")
library("lsmeans")
library("car")
library("doBy")
library('emmeans')
source('plot_fit.R')
dropbox_dir='C:/Users/Holly Rayson/Dropbox/'
# Read gaze data
gaze_data<-read.csv(file=paste0(dropbox_dir,'/joint_attention/juvenile_monkeys/pref_gaze/data/year1/all_facial_gestures_gaze_summary... |
91ffa7a1e377cd5bced8a3199d5abb9fcab652795d7bbc71b69331ab5d7e9bd9 | R | 8,401 | 158 | suppressMessages(require(DescTools))
suppressMessages(require(data.table))
suppressMessages(require(dplyr))
suppressMessages(require(argparser))
`%notin%` <- Negate(`%in%`)
#parse arguments:
parser <- arg_parser('Calculates melting scores for supplied genomic intervals by comparing insulation scores of one cell ty... |
efbd4bc45b3c185db6c23719b7ba05604ad5152423beeb8bf1f077ddc2619a7a | R | 8,412 | 219 | library(MicrobiomeAnalystR)
library(phyloseq)
library(magrittr)
# Human Moving Picture from MicrobiomeAnalyst server ----------------------
download.file(
"https://www.microbiomeanalyst.ca/MicrobiomeAnalyst/resources/data/treebiom.zip",
"data-raw/caporaso.zip"
)
unzip("data-raw/caporaso.zip", exdir = "data-raw... |
115899d1a875444a81faa0e91c3ee02a91cb9bd1cfe4af552aa6396944fbc3d1 | R | 8,452 | 122 | displayHelp <- HTML('
<p style="font-size:30px">
<b>Welcome to the Ciernia Lab Microglia Enrichment Calculator!</b>
</p>
<p style="font-size:20px">
Here we provide a short guide to using the app.
<br>
<br>
For a more extensive overview of the application, you may be interested in our publication (<a href="https://doi... |
156e52d7d5e843b3135de250c50f4c1e239f5698c277eebadfdf1bfc253e53a3 | R | 8,648 | 293 | """
This file is part of BrainMolecularAtlas.
This file makes Fig8b and 9
Copyright (c) 2021-2022 Blue Brain Project/EPFL
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the Li... |
07c9c3c33abcf32178333a90dd50a5afc4c83f389f09ef3e5a4896c438eefaac | R | 8,678 | 226 | # =============================================================================
# TCGA-Assembler version 2
#
# Copyright (C) <2017> <Yitan Zhu>
# This file is part of TCGA-Assembler.
#
# TCGA-Assembler is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public L... |
163ded7bf5fe17ea8d4bf4640b72bf06e96d4230638dd304a094420e9c8e20dc | R | 8,755 | 232 | #assert existence of
#commonfile
source(commonfile)
#pwmfile
#load(file.path(pwmdir,paste0(pwmid,'.pwmout.RData')))
#tmpdir
#load(file.path(tmpdir,paste0(pwmid,'.svout.RData')))
#outdir
#####
# make call
datadir = paste0(tmpdir,'/',pwmid,'/')
if(avoid.seqbias){
osvr=order(-sv.rotate[-(1:2)])+2
sv.rotate[osvr[... |
06cd67eb175e5a839d1b6619fb10045cf52df0075f745cdaf8076796a4ac2125 | R | 8,765 | 231 | #' Differential analysis using limma-voom
#'
#' @param ps ps a [`phyloseq::phyloseq-class`] object.
#' @param group character, the variable to set the group, must be one of
#' the var of the sample metadata.
#' @param confounders character vector, the confounding variables to be adjusted.
#' default `character(0)... |
7056c11936862a672ea28a6fc0395a92cdabc90fd3478dea8f430477ca8e56a1 | R | 8,817 | 246 | #' Statistical test for multiple groups
#'
#' @param ps a [`phyloseq::phyloseq-class`] object
#' @param group character, the variable to set the group
#' @param taxa_rank character to specify taxonomic rank to perform
#' differential analysis on. Should be one of
#' `phyloseq::rank_names(phyloseq)`, or "all" means ... |
4149b256735efbb19b8c508a0ad0cc9e900501cb8fbb601b7f98851381528d16 | R | 9,086 | 333 | aa.residues.mass.monoisotopic = c(
A = 71.037114,
R = 156.101111,
N = 114.042927,
D = 115.026943,
C = 103.009185,
E = 129.042593,
Q = 128.058578,
G = 57.021464,
H = 137.058912,
I = 113.084064,
L = 113.084064,
K = 128.094963,
M = 131.040485,
F = 147.068414,
P = 97.052764,
S = 87.032028,
... |
0e4610eaf393f2952a9b4669c2ee76d48451e85d7d45153f8532e3c56b3fec36 | R | 9,109 | 187 | # Basic setups ------------------------------------------------------------
library('dplyr')
library('pbapply')
library('nlme')
library('irr')
setwd('/gpfs/igmmfs01/eddie/GenScotDepression/shen/SData/UKB/iv.ABCD/release2.0.1/FamilialRisk_PGRS_MDD')
# Load data ---------------------------------------------------------... |
952f301504d8afb7d8e90a6cc7f5fdfe173fb6279cfa7f5ddb487ffb6ad1ffa7 | R | 9,312 | 242 | #' Liner discriminant analysis (LDA) effect size (LEFSe) analysis
#'
#' Perform Metagenomic LEFSe analysis based on phyloseq object.
#'
#' @param ps a \code{\link[phyloseq]{phyloseq-class}} object
#' @param group character, the column name to set the group
#' @param subgroup character, the column name to set the subgro... |
046e3b1149fc165964a2c8af09eac26dcb2b35ed132af3714dc1e4e0b60decec | R | 9,353 | 199 | # Script Comments ---------------------------------------------------------
# this is a script that can be used to update/add new lists to the microglia gele list database
# The new list is then used as input into the MGEnrichment app
# simply update the spreadsheet that is read in as "masterlist"
library(biomaRt)
lib... |
70cddd34c68d81ec2dcb2f5de1cfe4622170de6afb26d002ba91dcb290a867fc | R | 9,558 | 257 | #' Identify biomarkers using supervised leaning (SL) methods
#'
#' Identify biomarkers using logistic regression, random forest, or support
#' vector machine.
#'
#' @param ps a \code{\link[phyloseq]{phyloseq-class}} object.
#' @param group character, the variable to set the group.
#' @param taxa_rank character to speci... |
a4b7984bffe50b1f2388f75df6bf1ee98a64cddd8baa47e4d8a7183b2185f867 | R | 9,849 | 172 | ## plot the empirical cumulative density functions (ECDF) of IS values of long genes.
library(tidyverse)
#set working directory to the directory code is in, to make sure that files are found
#for Rstudio:
setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
#for command line R:
#setwd(getSrcDirectory()[1])
#... |
373b6471dc6a9860ee61598ed398fdf63eb754a083525a24a7d937bab1b65177 | R | 9,853 | 219 | # Script Comments ---------------------------------------------------------
# this is a script that can be used to update/add new lists to the microglia gele list database
# The new list is then used as input into the MGEnrichment app
# simply update the spreadsheet that is read in as "masterlist"
library(biomaRt)
lib... |
8532689a8e8d199b846a5c10f14052d04708cb31e3d7481caab11554477110d6 | R | 10,243 | 322 | test_that("check upper first letter", {
expect_equal(
upper_firstletter(c("abc", "ABC", "Abc")),
c("Abc", "Abc", "Abc")
)
})
test_that("check rank names and para `taxa_rank`", {
## check rank names
# taxonomic profile
ot <- otu_table(
matrix(
sample(100, 40),
... |
7f1a7d4a1952c1629e6edd4fbccf6b6425abc553554c88e5222291a29f560492 | R | 10,257 | 238 |
setwd("Z:/Documents/sdata_backup/Shen/iv.ABCD/release2.0.1/FamilialRisk_PGRS_MDD")
# Dot plot ----------------------------------------------------------------
library(dplyr)
library(ggplot2)
library(magrittr)
library(ggpubr)
library(cowplot)
# Settings
load('result/x.Supplementary_materials/YouthDepree_WM_subcor_FS... |
bca86684b3a68c59e82e29c248ddca16eb760e5209c9e29499cb64658be4c06a | R | 10,439 | 228 | library(ggplot2) # «ê¢ÈOtðvbg·é½ßÌCuðÇÝÝ
library(signal) # nCJbgtB^̽ßÌCuðÇÝÝ
library(gridExtra) # Otðc¡ÉÀ×é½ßÌCuðÇÝÝ
library(ggfortify) # ÝÖÖðvbgµÄÀ×é½ßÌCuðÇÝÝ
library(reshape2) #
sampli... |
9acf82e0e1d47b8ec31e90ce4b26fc3e9f3ff7e84407467be6410a3693d43cc9 | R | 10,495 | 238 |
setwd("Z:/Documents/sdata_backup/Shen/iv.ABCD/release2.0.1/FamilialRisk_PGRS_MDD")
# Dot plot ----------------------------------------------------------------
library(dplyr)
library(ggplot2)
library(magrittr)
library(ggpubr)
library(cowplot)
# Settings
load('result/x.Supplementary_materials/YouthDepree_... |
9ec0aabe88c431121b1f1ee861a73d56fa899c2c929798a71f87111a985a4385 | R | 10,527 | 238 |
setwd("Z:/Documents/sdata_backup/Shen/iv.ABCD/release2.0.1/AdolescentMDD/")
# Dot plot ----------------------------------------------------------------
library(dplyr)
library(ggplot2)
library(magrittr)
library(ggpubr)
library(cowplot)
# Settings
load('result/i.Main_result/YouthDepree_WM_subcor_FS_noSoci... |
83efa944a29d1b5c284f427a553eb68d825f204a5f6190e8ff0dde64222b11d2 | R | 10,570 | 237 |
setwd('/exports/igmm/eddie/GenScotDepression/shen/ActiveProject/ImagingProject/ABCD_MDD_brain/')
# Dot plot ----------------------------------------------------------------
library(dplyr)
library(ggplot2)
library(magrittr)
library(ggpubr)
library(cowplot)
# Settings
load('result/x.Supplementary_materials/... |
a4f70fad51a65cb8ac2525461bba31af97a4600854c50053e7093cf78745035e | R | 10,575 | 238 |
setwd('/exports/igmm/eddie/GenScotDepression/shen/ActiveProject/ImagingProject/ABCD_MDD_brain/')
# Dot plot ----------------------------------------------------------------
library(dplyr)
library(ggplot2)
library(magrittr)
library(ggpubr)
library(cowplot)
# Settings
load('result/x.Supplementary_materials/... |
11ba31d51b9014c062d463a053dac586c89ee54e47bbeeb4a157159841e04241 | R | 10,585 | 237 |
setwd('/exports/igmm/eddie/GenScotDepression/shen/ActiveProject/ImagingProject/ABCD_MDD_brain/')
# Dot plot ----------------------------------------------------------------
library(dplyr)
library(ggplot2)
library(magrittr)
library(ggpubr)
library(cowplot)
# Settings
load('result/x.Supplementary_materials/... |
e4142df7a340e295fa2e3fc0d98ef701e786d5a390c4232e6f82697c1bfc5ac6 | R | 10,840 | 346 | # marker_table class ------------------------------------------------------
#' The S4 class for storing microbiome marker information
#'
#' This Class is inherit from `data.frame`. Rows represent the microbiome
#' markers and variables represents feature of the marker.
#'
#' @name marker_table-class
#' @aliases marker... |
4ec5f4cdf3ed76da1fb1204044e2772956f47995f92bae110cd87ca9abbfda18 | R | 10,945 | 239 | # Basic setups ------------------------------------------------------------
library('dplyr')
library('pbapply')
library('nlme')
setwd('/gpfs/igmmfs01/eddie/GenScotDepression/shen/SData/UKB/iv.ABCD/release2.0.1/FamilialRisk_PGRS_MDD/')
# Load data ---------------------------------------------------------------
... |
fb003ddcdec4a221e367377f37f2765043ab81463edeedeea424422ed042952d | R | 11,269 | 196 | ---
title:: R package for microbiome biomarker discovery
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
# microbiomeMarker
<a href='https://github.com/yiluheihei/microbiomeMarker'/><img src='man/figures/microbiomeMarker.png' height="150" align="right" style="float:... |
18a2a095e2b039806064385d79b3f96828b90a9d937ef7a504c4a1097a9a9fff | R | 11,546 | 284 | setwd("~/work/ibs/")
library(data.table)
library(ggplot2)
library(cowplot)
grep_start = function(col,code){
grepl(paste0("^",code),col)
}
check_code = function(code,P,cols,col_prefix="has",starts_with=FALSE){
if((code=="") | is.na(code)){return(NULL)}
if(starts_with){
noted = P[,lapply(.SD,grep_start,cod... |
0fcb2e942dcb06e2b6cde7d94ed93f88153212627ca370b88973ca56048fec1e | R | 11,644 | 151 | ## plot the trans cis ratio of long genes in ESC and the 3 brain cell-types with pretty raincloud plots. Stratify by melting and non-melting genes
library(tidyverse)
library(lemon)
library(ggpubr)
`%notin%` <- Negate(`%in%`)
#set working directory to the directory code is in, to make sure that files are found
#for R... |
1c9427febb530bce3927581fd434538915afa4cfe1cbc3ca263f3d00b40ea3bc | R | 12,198 | 233 | setUpEnvironment <- function(tcgaAssemblerPath){
setwd(tcgaAssemblerPath)
source(paste(tcgaAssemblerPath, "/Module_A.R", sep=""))
source(paste(tcgaAssemblerPath, "/Module_B.R", sep=""))
}
createDirectory <- function(dirPath){
dir.create(dirPath, showWarnings = FALSE, recursive=TRUE)
}
downloadClinicalData <- func... |
e1e416e855f445434eb5b5e7fb9653f6b605bb52dc7734981b52b2cae96f5267 | R | 12,322 | 299 | # 22nd May 2019
# R Script for analysing SDS results, both high and low N0 results
# 7th Dec 2020
# Permutation test code
# First decide which dataset to use
# Set up so one can run from command line
# Otherwise one can set 'ind' manually
# 1 = High N0 case; 2 = Low N0 case
args <- commandArgs(trailingOnly = TRUE)
i... |
f587e2eebc10d7d1280834aac15602601ca1be85902155d07a36a0d990f177c7 | R | 12,539 | 313 | ---
title: "COVID-19 US Weekly Forecast Summary"
author: <a href="https://covid19forecasthub.org/doc/" target="_blank">The COVID-19 Forecast Hub Team</a> <br><br> <a href="https://covid19forecasthub.org/" target="_blank">https://covid19forecasthub.org/</a>
date: "report generated `r Sys.Date()`"
output:
html_doc... |
d4440e1845fad73cd694cf6db82a4baab243a393ecffaaf1b590e1582a243b41 | R | 12,591 | 258 | library("lme4")
library("ggplot2")
library("car")
library("doBy")
source('plot_fit.R')
library('emmeans')
# Read gaze data
gaze_data<-read.csv(file='./data/all_facial_gestures_gaze_summary.csv',header=TRUE,sep=',')
sex_file<-'./data/juvenile_sex_ids.csv'
sex_data<-read.csv(file=sex_file,header=TRUE,sep=',')
sex_data... |
94a3c2e8080030b34dd447b4bf2f5aef4d799304c4419da065f6b573afd825dc | R | 12,673 | 265 | # Script Comments ---------------------------------------------------------
# this is a script that can be used to update/add new lists to the microglia gele list database
# The new list is then used as input into the MGEnrichment app
# simply update the spreadsheet that is read in as "masterlist"
library(biomaRt)
lib... |
6c8524ee7a00b51ef6f04fdb05ee190fe6a4d386381bf5bac9a30147d4a98136 | R | 12,697 | 309 | library(data.table)
library(ggplot2)
library(cowplot)
theme_set(theme_cowplot())
library(meta)
read_sumstats = function(path){
summ = fread(path)
#CONSIDER TEST_ALLELE AS ALLELE1 for MAURO
#See mauro_ldhub_format, because ldsc doens't understand ALLEL0/ALLEL1
#This is different from freq_table, where it cam... |
7d5da43e76b747e2c57ef9db57c52243e13b6559e4cdea4ef5f176c0dc4750d6 | R | 12,759 | 256 | library("lme4")
library("ggplot2")
library("car")
library("doBy")
source('plot_fit.R')
library('emmeans')
dropbox_dir='C:/Users/Holly Rayson/Dropbox/'
# Read gaze data
gaze_data<-read.csv(file=paste0(dropbox_dir,'/joint_attention/juvenile_monkeys/pref_gaze/data/year1/all_facial_gestures_gaze_summary.csv'),header=TRUE... |
47251321bbdf6451b81f4b9a7cb58dd770e8d5a0f16bf1e3f5f512e7d0bed7ac | R | 12,914 | 440 | ---
title: "Data for Review"
output: html_document
---
```{r echo=FALSE}
library(tidyverse)
library(covidData)
library(plotly)
library("googlesheets4")
# do we want to plot historical data available as of all past weeks or only the
# most recent?
plot_all_historical_as_ofs <- FALSE
# plot historical r... |
33eca503ce0a4a3f06265906580e486df566cc8e1441540f600e2c568eac6f3a | R | 12,960 | 446 | ---
title: "Data for Review"
knit: (function(inputFile, encoding) { rmarkdown::render(inputFile, encoding = encoding, output_file = paste0(substr(inputFile,1,nchar(inputFile)-4),Sys.Date(),'.html')) })
output: html_document
---
```{r echo=FALSE, message = FALSE, warning = FALSE}
knitr::opts_chunk$set(
echo = ... |
1d7fb72c38403f0a741f32804254c6ed5ceb42a4c375624fe7b5701871953498 | R | 13,005 | 325 | #' Differential analysis of compositions of microbiomes with bias correction
#' (ANCOM-BC).
#'
#' Differential abundance analysis for microbial absolute abundance data. This
#' function is a wrapper of [`ANCOMBC::ancombc()`].
#'
#' @param ps a [`phyloseq::phyloseq-class`] object, which consists of a feature
#' table... |
109fb076486e3c467545e8717825ba85a76e4a2bdb2002a2f4cdd2f04046ba76 | R | 13,019 | 414 | # post hoc test -----------------------------------------------------------
#' Post hoc pairwise comparisons for multiple groups test.
#'
#' Multiple group test, such as anova and Kruskal-Wallis rank sum test, can be
#' used to uncover the significant feature among all groups. Post hoc tests are
#' used to uncover spe... |
35fb8093afc9694c17012d46104dcc4db2ebe5ce67b8282fe689fe9191cb3080 | R | 13,047 | 297 | source('add_extra_codes.R')
source('apply_constraints.R')
source('read.tcsv.R')
library(tibble)
library(readxl)
load_data=function(data_dir, groups, obj_states, obj_events) {
unique_subjects<-unique(groups$subject)
all_subj_df<-data.frame()
duration<-300
filepaths <- Sys.glob(paste0(data_dir,"/*.xlsm"))
... |
6a350202ee12be74fce11fa9d3659c37393db171c4f9e1ee27cfc91faa622825 | R | 13,153 | 335 | ---
title: "SCENIC in mDPC OD cluster"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(
tidy = TRUE,
tidy.opts = list(width.cutoff = 120),
message = FALSE,
warning = FALSE,
cache = TRUE #use the cached results without running again
)
```
## referene note:
We generated our scripts... |
11eca2ee5caba082ead9e8495b90773cffa129aab8d2b5f0dc057a85aed54b0f | R | 13,307 | 187 | #plot of change of trans-cis ratios stratified by ESC nucleolus association and domain melting status
library(tidyverse)
library(ggpubr)
library(ggnewscale)
#set working directory to the directory code is in, to make sure that files are found
#for Rstudio:
setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
... |
54496fec6a73d729b064298cd0ec5891b333cf6033000632f42669c56a465d87 | R | 13,567 | 289 | # by XShen
# 16/5/2019
# Aims: remove parents with other major psychiatric conditions,
# clean up depression-related phenotypes in parents,
# remove adolescents with severe substance use conditions,
# add some key covariates: SES, ADHD condition in children and recent social deprivation.
# Before runn... |
db6388c4003c9b1eac78ea7d2a9b180d197be9ddee6e9f0df0687bced929b786 | R | 13,700 | 342 | #' Perform differential analysis using edgeR
#'
#' Differential expression analysis based on the Negative Binomial distribution
#' using **edgeR**.
#'
#' @param ps ps a [`phyloseq::phyloseq-class`] object.
#' @param group character, the variable to set the group, must be one of
#' the var of the sample metadata.
#'... |
82414a8a4cf46a623d6b866674767c83c56a366d3616602a7898cfe4e1b6aba2 | R | 13,711 | 423 | ## codes for cladogram plot are modified from microbiomeViz
## https://github.com/lch14forever/microbiomeViz
#' @title plot cladogram of micobiomeMaker results
#'
#' @param mm a [microbiomeMarker-class] object
#' @param color a color vector, used to highlight the clades of microbiome
#' biomarker. The values will ... |
d56002856b8ac8f066668609a5cdd07537319cade044ecb9998c55bb1003b58f | R | 14,343 | 228 | # Single nuclei transcriptomics of the Allen Brain atlas data set of mus musculus (https://celltypes.brain-map.org/)
# The underlying analysis is part of the manuscript entitled
# "Automated annotation of rare-cell types from single-cell RNA-sequencing data through synthetic oversampling"
# Data anaylsis and visalizat... |
01fb6ffdd59dd3a240a6d09dfa43069512a8678f9c77be662ef5275ac8d321e8 | R | 14,366 | 366 | # execute this script in this directory (data-processed/)
# Provides a shiny dashboard to explore the processed data
library("tidyverse")
library("ggnewscale")
library("shiny")
library("DT")
library("rmarkdown")
library("MMWRweek")
options(DT.options = list(pageLength = 25))
source("../code/processing-fxns/get_next... |
3618f3edeb55b914c8dfec15d5456465b7bb4450d1c88cec414828e2aa4bed07 | R | 14,378 | 366 | # execute this script in this directory (data-processed/)
# Provides a shiny dashboard to explore the processed data
library("tidyverse")
library("ggnewscale")
library("shiny")
library("DT")
library("rmarkdown")
library("MMWRweek")
options(DT.options = list(pageLength = 25))
source("../code/processing-fxns/get_next... |
b016c5383d4d50f25e25279180299790a355a51f279d6022b117683a1c2b2cdc | R | 14,436 | 259 | ---
title: "Hippocampus volume and relevance analysis"
author: "Martin Dyrba"
date: "12 May 2021"
output:
html_document:
fig_width: 9
fig_height: 6
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## Loading and preparing the data
```{r}
library(readxl)
Hippocampus_values <- as.data... |
44cd2219ade9505719a1aeec6bb38a2e2ed03cf485128b142a96755213785e24 | R | 14,966 | 333 | library("drake")
library("tidyverse")
library("shiny")
library("tidyr")
library("dplyr")
library("DT")
library("shinyWidgets")
library("scales")
options(DT.options = list(pageLength = 50))
source("code/processing-fxns/get_next_saturday.R")
fourweek_date = get_next_saturday(Sys.Date() + 3*7)
loadd(truth)
truth_source... |
2bc6efe51e1cfa8547aaecf29ac1808d2d6d0b2ec1ee68b4102c341056879546 | R | 15,065 | 341 | ---
title: "aa_state_weekly_report_county_code"
output: html_document
---
```{r accuracy of models past 6 weeks-county}
#inc cases for past 6 weeks
inc_case_p6_c <- data.frame(inc_case_all_points %>%
rename(location=fips,point=value)%>%
select(target_end_date,location,location_name,point) %>%
... |
47b176a1770a650063783bed9cd0daeceb748cef13d3b9c43f3ffa45584dcc4d | R | 15,149 | 513 | # enrich group of the feature ---------------------------------------------
#' get the mean abundances of each class for each feature
#' @noRd
get_feature_enrich_group <- function(class, feature) {
feature$class <- class
feature_mean <- group_by(feature, class) %>%
group_modify(~ purrr::map_df(.x, mean... |
2c28e2fa52dea20871319b5cbb27fe5ff5c39511f4b154b363043823322265de | R | 15,203 | 252 | #####
# Read the data
#
# read the Excel sheet containing data
library(readxl)
Hippocampus_values <- as.data.frame(read_excel("hippocampus_volume_relevance_DELCODE.xlsx", sheet="DELCODE_LRP_CMP"))
colnames(Hippocampus_values)[colnames(Hippocampus_values)=="prmdiag"] <- "Group"
colnames(Hippocampus_values)[colnames(Hipp... |
9781bb3f7e2aaee99c962f440d6e52205ffe505a1e92689d2efa27c2cb026159 | R | 15,220 | 276 | ---
title: "Hippocampus volume and relevance analysis"
author: "Martin Dyrba"
date: "12 May 2021"
output:
html_document:
fig_width: 9
fig_height: 6
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## Loading and preparing the data
```{r}
# read the Excel sheet containing data
librar... |
c331dccbe2901adde8958fd0c0e4101f9e914c90902261da2cb90bf8f371b0fd | R | 15,481 | 372 | ---
title: "Creating DSM-V MDD severity measure in ABCD"
author: Xueyi Shen
date: "`r Sys.Date()`"
output: github_document
---
* * *
### Contact and credit
X Shen (xueyi.shen@ed.ac.uk)
* * *
### R settings
Required packages:
- dplyr
- readr
Extra packages for Rmarkdown:
- rmarkdow... |
dd8bafe17119b3cfa77c18781415b4ce414ec902e644e773c1f4c85b78499873 | R | 17,197 | 347 | ######
# by Shen
# Purposes:
# 1. Create and tidy up depression categorical phenotypes: MDD and broad depression (other unspecified types of depression included)
# 2. Summarise depressive symptoms based on KSADS and CBCL
# 3. Extract individual items in KSADS and CBCL
library(dplyr)
setwd('/gpfs/igmmfs01/eddie/GenSc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.