sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
ed7f27e9ebdf7e24c0c7485a0202ed78d0df210c1485033eff0fa2427b3daef7 | R | 3,494 | 112 |
options(stringsAsFactors = FALSE)
library(data.table)
library(bmediatR)
##################################################################################
##################################################################################
###
###
### Run bmediate.R for each pair of listed SNP-gene candidates for trans... |
b813f467b34cd0b16cb9d35e9e64402262137d8e179ec49df27fd5fe89429aa3 | R | 3,519 | 112 | ptions(stringsAsFactors = FALSE)
library(data.table)
library(bmediatR)
##################################################################################
##################################################################################
###
###
### Run bmediate.R for each pair of listed SNP-gene candidates for trans-e... |
eb4bb3a8fa611a22a557d5b57ee46ef71172800e024e79aced75f95f187ba9d9 | R | 3,522 | 73 | indDiscr <- function(data=NA,staging=TRUE,digits=2,doPlot=TRUE){
indivDiscr <- data.frame(subject=data$subject,
TST_diff = data$TST_device - data$TST_ref, # TST
SE_diff = data$SE_device - data$SE_ref, # SE
SOL_diff = data$SOL_dev... |
83edf5b3243376cb425fa455607bec62dc3ae9da9ebd29270acaa652dc723ded | R | 3,541 | 91 | indEBE <- function(data=NA,idCol="subject",RefCol="reference",deviceCol="device",doPlot=TRUE,
stage=0,stageLabel="wake",digits=2){
# renaming variables
colnames(data) <- gsub(idCol,"ID",colnames(data))
colnames(data) <- gsub(RefCol,"ref",colnames(data))
colnames(data) <- gsub(deviceC... |
c027576f5927e12288fac384b862174bc6dbb03cb5aaec522ac0cb0d73c8b9f3 | R | 3,556 | 63 | if (!require("pacman")) install.packages("pacman")
pacman::p_load(tidyr, betareg, emmeans, lmtest, multcompView)
df_Acc = read.csv('Model_accuracy/Data/CompleteAccuracy_classification.csv')
# 1. Comparing overall balanced accuracy accross tumours types
shapiro.test(df_Acc[df_Acc$X == 'Balanced Accuracy... |
ddc459786f350dbe98105995652a2f7f68d1b8d2a783d3d6f36f10cf60d43a7a | R | 3,560 | 97 |
library(Seurat)
library(Signac)
library(ggplot2)
library(RColorBrewer)
## Load data
seuset.atac <- readRDS('/home/ajl1213/Projects/PD/SciAdv_Data/snATACseq/2_SignacProcess/SeuratObjects/PD.SN.snATAC.postAlign.geneExp.label.anno.rds')
dir.create('CountByIndiv')
#======================================================... |
3025b7120defa30cb3f20180e96a94e90d104574b35bb2401262db62f6ba4eb5 | R | 3,572 | 78 | library(dplyr)
library(purrr)
library(SummarizedExperiment); library(qs);library(ggplot2); library(gridExtra);library(pryr); library(tibble); library(furrr); library(tidyr); library(readr)
library(dplyr); library(data.table); library(grid); library(limma); library(pheatmap); library(RColorBrewer); library(broom); li... |
849be21bb06bde9ddd38e738717ae786318aa076e26f5b72bed02277b0f336c5 | R | 3,584 | 92 |
###############################################################################################
##### Figure S1A
###############################################################################################
pro = read.csv("/proj/steinlab/projects/R00/eQTLanalysis/path_QTL/bmediate/data/progenitor_bmediatR_results_fi... |
819650101ec0068611d1dae748e6e1eae1a7c28bcc33fd6aea2753bfa7f7566b | R | 3,589 | 80 | ### Run RBP enrichment tests ###
# Run RBP enrichment tests for the significant AUC genes
# Run the tests for the given transcript region, e.g. 5'UTR, CDS, 3'UTR
library(Biostrings)
library(transite)
library(tidyverse)
library(argparse)
library(dplyr)
parser <- ArgumentParser()
parser$add_argument("-sub", help="csv f... |
3c3f8a792b328e73dcab91de836f4878fad9d48edc74e4bd5a543588a18feb5a | R | 3,619 | 70 | library(MASS);library(sfsmisc);library(dplyr);library(purrr)
library(SummarizedExperiment); library(qs);library(ggplot2); library(gridExtra);
library(pryr); library(tibble); library(furrr); library(tidyr); library(readr)
library(dplyr); library(data.table); library(grid); library(limma);
library(pheatmap); library... |
993f1eaf10d8fe394ad46b9a3bddc0047c8e0d397f38a6967e0708e243add00d | R | 3,631 | 110 | #' Peptide/Protein group inference
#'
#' @param dat input dataframe
#' @param protGrp logical variable indicating if protein groups should be inferred
#' @param average logical variable indicating if abundances should be averaged
#'
#' @return dataframe with the peptide/protein groups inferred and abundances averaged o... |
efc331883a24942c98a4b2b2ee7b33a12c24f5b9a0255e81e2101698ab5720e8 | R | 3,664 | 94 | #' Sci Data Paper Figure 5a/5b
#'
#' @import pheatmap
#' @import RColorBrewer
#'
#' @return figure5a_b.pdf
#' @export
get_fig5a_b=function() {
# warnings off
w <- getOption("warn")
options(warn=-1)
if( !exists("fig"))
dir.create("fig")
# load data and filter significant protein groups
data("dif... |
e91393cd3a7d1f3860c8c00be303599be53550de2d85bb000ae8332499d7bf87 | R | 3,729 | 130 | options(stringAsFactors = F)
library(bmediatR)
library(data.table)
library(limma)
type = commandArgs(trailingOnly=TRUE)[1]
chr=commandArgs(trailingOnly=TRUE)[2]
library(data.table)
library(DESeq2)
gtf = fread("/proj/steinlab/projects/R00/eQTLanalysis/phenofiles/gene_transcript_v92.csv",data.table = F)
gtf = gtf[whi... |
9abab3ad57ed2f2462d41b6f26e4d28a933ef22c3be48e9fdda729efaa9876d6 | R | 3,774 | 133 | #' @importFrom R6 R6Class
#' @importFrom e1071 svm
#' @include utils.R
#' @include model.R
#' @include model_helpers.R
SupportVectorMachineModel <- R6Class(
classname = "SupportVectorMachineModel",
inherit = Model,
public = list(
# Constructor --------------------------------------------------
initiali... |
9ee2f93642f10a5ea319e8eb5fec78983b4a0c56cbfea06bd912390e65fe63da | R | 3,781 | 110 | #' @include utils.R
#' @include validator.R
#' @include mixed_model_model.R
#' @title Fit a Mixed Model (lme4GS)
#'
#' @templateVar ClassName MixedModel
#' @templateVar XType list
#' @templateVar YType `vector`
#' @templateVar refFunction lme4GS::lmerUvcov()
#'
#' @description
#' `mixed_model()` is a wrapper of the `l... |
b4030baff87df3ec43831a25899317ab523632248287b5c7349e03dd30f94b71 | R | 3,805 | 154 | # Use all default hyperparameters (no tuning) ------------------------------
x <- to_matrix(iris[, -5])
y <- iris$Species
model <- support_vector_machine(x, y)
# Predict using the fitted model
predictions <- predict(model, x)
# Obtain the predicted values
predictions$predicted
# Obtain the predicted probabilities
pred... |
651acd88e0c8961cb8ba8ee673e004e31b66779d84433ea8a1cf659d000c8290 | R | 3,813 | 151 | # Use all default hyperparameters (no tuning) -------------------------------
x <- to_matrix(iris[, -5])
y <- iris$Species
model <- generalized_boosted_machine(x, y)
# Predict using the fitted model
predictions <- predict(model, x)
# Obtain the predicted values
predictions$predicted
# Obtain the predicted probabilitie... |
d60ac680eecc1ff55f3f05a47504891514d5f13ed2a415c19a51eb93c9b7a87c | R | 3,825 | 103 | library(Seurat)
library(ggplot2)
library(ggrepel)
library(RColorBrewer)
library(viridis)
load('CellTypeDEGs/snATAC.cellTypeMarkers.rda')
load('CellTypeDEGs/snATAC.cellTypePeaks.rda')
load('CellTypeDEGs/snATAC.cellTypeDEGs.rda')
dir.create('CellTypeDEGs/Figs')
cellTypeList=c('DopaN', 'GabaN', 'Oligo', 'OPC', 'Ast', '... |
b3c635d6dd7f8a94652dcba58135475072fb9169da5fdda8a33c470151b65a8e | R | 3,831 | 80 | ####################################################################################################
# Script to calculate encrichment of MAGMA for each module using genesettest #
# #
##############... |
bacd71c553a30cce3d8ea319c7681a697e4cfe36e09a125502694692f6d961d5 | R | 3,854 | 75 | ####################################################################################################
# Script to Remove confounders effect + QSVA #
# "Cell-population enrichment" studies #
# ... |
762efcdaf1a820b48eb147e76ba775b96521510335fc29c91754b4c1b2b0272c | R | 3,871 | 119 |
options(stringsAsFactors = FALSE)
library(data.table)
library(bmediatR)
type = "neuron"
##################################################################################
setwd("/proj/steinlab/projects/R00/eQTLanalysis/path_QTL/bmediate/scripts/")
###################################################################... |
3e518f3b1393e9fd6b573a520c9af3a1939aa942f8de53e26a7aae593cdf5e9d | R | 3,915 | 73 | ##########################################################################################
## logFC comparison for detected proteins across timepoints (for the same bait)
##
## Author: Joshua King To Ching
##########################################################################################
library(readxl)
library... |
a139ff48f145feeae382bb722651a52d707c45e5118d356e933205987fb9c5b0 | R | 3,942 | 103 | ---
title: "FAFB_neuron_to_MIPmask"
output: html_document
---
### Generate image stacks from FAFB neurons for MIP search
as described in Taisz and Galili et al., 2022
Data available via Virtual Fly Brain: <https://fafb.catmaid.virtualflybrain.org/>
MIP search described in Otsuna et al., 2018 <https://www.biorxiv.or... |
1f14fa612c2ba82f5ae1a5152ef0deb42c50a030944374d78dc8b716225b577e | R | 3,969 | 127 | library(Seurat)
library(ggplot2)
library(ggrepel)
library(RColorBrewer)
library(viridis)
load('CellTypeDEGs/snRNA.cellTypeDEGs.rda')
dir.create('CellTypeDEGs/GO')
minPct <- 0.2
minLog2fc <- 0.2
qval_thresh <- 0.05
##==================================================================================================... |
7febfc8c1d2e2ba740996626b944913acd94db63e306c8715ac28ea642b46a58 | R | 4,007 | 132 | library(ggplot2)
library(RColorBrewer)
nIter <- 3
sampleList <- c(
'X4870_1NOSN',
'X4870_2NOSN',
'X4689NOSN',
'X5628_1NOSN',
'X5628_2NOSN',
'X5130NOSN',
'X4996_1NOSN',
'X4996_2NOSN',
'X5006NOSN',
'X5244PDSN',
'X4831PDSN',
'X5532PDSN',
'X5215PDSN',
'X5627PDSN',
'X5778PDSN',
'X5742PDSN',
'X5649PDSN',
'X5591PDSN'
)
c... |
87113e1cc5606f826ec62972a2310392e573208bf5d910ef67065c62e7d233dc | R | 4,012 | 120 |
library(ggplot2)
dir.create('Plots')
## Down
# factor list
cellTypeList <- c('DopaN','GabaN','Oligo','OPC','Ast','Micro','Endo','Peri')
#windowList <- c('15kb','100kb','200kb')
windowList <- c('100kb')
dataTypeList <- c('snDEG','bulkDEG')
list_factors <- c()
for (cellType in cellTypeList){
for (winDist in wind... |
b0ea3b694cccc28f8b62dcd5f3b46af8e9ecdeda1c8d0d6e3ba9267650005961 | R | 4,017 | 134 | library(ggplot2)
library(RColorBrewer)
nIter <- 3
sampleList <- c(
'X4870NOSN',
'X4689NOSN',
'X5628NOSN',
'X5130_1NOSN',
'X5130_2NOSN',
'X4996NOSN',
'X5006_1NOSN',
'X5006_2NOSN',
'X5244PDSN',
'X4831PDSN',
'X5215PDSN',
'X5627PDSN',
'X5778PDSN',
'X5742PDSN',
'X5649PDSN',
'X5591PDSN'
)
cellTypeList <- c('DopaN', 'GabaN... |
4a3eba00a9193bd143236e6fdc39a75a97715e509dc7d4aeeed4bdb8aa8c15a4 | R | 4,027 | 79 | ####################################################################################################
# Script to calculate encrichment of DRONC celltypes for each module using genesettest #
# #
##############... |
57774f5b014c6e8fb59a2dd0d4eed80bf7530643665a36febbd37ce3f439dc72 | R | 4,029 | 75 | ####################################################################################################
# Calculate accross module association of MAGMA enrichment to cell type enrichment #
# #
##############... |
558a4fd34d3e2af4e7a8fa5db76900c24d7289b9e155936d8927f6891fe370bb | R | 4,047 | 98 | ###############################################################################################
# Script to clean confounder effects #
# "Regional-coexpression" and "Age-period" studies #
# ... |
c9fce17be3643f8861f0034b730b4ab97175695996ec14017afc777a27deca17 | R | 4,060 | 80 | ####################################################################################################
# Calculate accross module association of MAGMA enrichment to GO term ratio #
# #
##############... |
b478fb3597a7e8aa5d945658bc7c0c5969f44becfeeeffabeb3dd40d7b634dbf | R | 4,093 | 86 | # Run ClusterProfiler enrichment on a cluster of genes
# https://guangchuangyu.github.io/2016/01/go-analysis-using-clusterprofiler/
# https://yulab-smu.top/biomedical-knowledge-mining-book/clusterprofiler-go.html
# https://yulab-smu.top/biomedical-knowledge-mining-book/enrichment-overview.html#ora-algorithm
# The backg... |
9ab4bc2b1c4d6bcdf7739e4de04cf3da35aa49a766d6f82a7d1920091d3f1f8d | R | 4,145 | 164 | # Use all default hyperparameters (no tuning) -------------------------------
x <- to_matrix(iris[, -5])
y <- iris$Species
model <- generalized_linear_model(x, y)
# Obtain the variables importance
coef(model)
# Predict using the fitted model
predictions <- predict(model, x)
# Obtain the predicted values
predictions$p... |
b9548b3a396ea3760ea2c9b71973d3e8377cd58b1506095c357899fde882d5a6 | R | 4,163 | 120 |
options(stringsAsFactors=F)
library(DESeq2)
library(reshape)
library(limma)
library(stringi)
library(data.table)
r00data <- readRDS(file = "/proj/steinlab/projects/R00/eQTLanalysis/phenofiles/r00_ranged_summarized_experiment_gene_counts2.rds")
dds <- DESeqDataSet(r00data, design = ~1)
donorlist_pro <-read.table("..... |
664ae76b97cee2cc56969a1b09ce1261b52d52083677b437bfcfe34332f41664 | R | 4,192 | 141 | #' @importFrom R6 R6Class
#' @importFrom gbm gbm.fit
#' @include utils.R
#' @include model.R
#' @include model_helpers.R
GeneralizedBoostedMachineModel <- R6Class(
classname = "GeneralizedBoostedMachineModel",
inherit = Model,
public = list(
# Constructor --------------------------------------------------
... |
10d09ae41a9175e2ee23b414839f4c3cc774e60d8608261d819a2f50d4eadc16 | R | 4,275 | 122 | #' @include utils.R
#' @include validator.R
#' @include gs_fast_bayesian_cross_evaluator.R
#' @title Fast Bayesian Cross Validation for Genomic Selection
#'
#' @description
#' This function performs a cross validation using the Fast Bayesian method
#' which requires to fit only one model per trait.
#'
#' @param Pheno ... |
20abb03fbd53b2ae7ba1f8494a8ddf1c5621fa31716d614fff82ae1d25a71f75 | R | 4,282 | 120 | #' @include utils.R
#' @include validator.R
#' @include partial_least_squares_model.R
#' @title Fit a Partial Least Squares Regression Model (PLSR)
#'
#' @templateVar ClassName PartialLeastSquaresModel
#' @templateVar XType `matrix`
#' @templateVar YType `vector` or `m̀atrix`
#' @templateVar refFunction pls::plsr()
#'... |
d4a634bafad3f838cd60ff60adfd8b2f9481ac048f4fb24594e55e72253aa13d | R | 4,316 | 110 | library(data.table)
library(DESeq2)
library(ggplot2)
library(ggrepel)
setwd('/Users/malleyce/Downloads/DRGs/')
load('/Users/malleyce/Downloads/DRGs/DRGs.Nociceptors.DDS.RData')
#how to subset
#dds.subset <- dds[,dds@colData@listData$condition %in% c('H9noc_D28','GTEx_Hypothalamus','GTEx_Hippocampus','GTEx_Cortex',"GTE... |
c158beb1c9062354c53db1b6f24bc3a7a550324265e7b07b6064739755836383 | R | 4,329 | 120 | ---
title: "Eye_Tracking"
author: "AZ"
date: "2022-08-31"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r Libraries, warning = FALSE}
library(readxl)
library(Rmisc)
library(dplyr)
library(ggplot2)
```
```{r import data, include=FALSE}
#Define the path
Path = "/Vol... |
8a839de445a39205d2a482ea84837ad8536f2ddb379d5e332e184d50f6ebce51 | R | 4,332 | 171 | # Use all default hyperparameters (no tuning) ----------------------------------
x <- to_matrix(iris[, -5])
y <- iris$Species
model <- random_forest(x, y)
# Obtain the variables importance
coef(model)
# Predict using the fitted model
predictions <- predict(model, x)
# Obtain the predicted values
predictions$predicted... |
9cc754ec977df057b0ab40b6a3a003d6d6bf6310310862f60436d00759961e33 | R | 4,338 | 76 | library(shiny)
library(shinydashboard)
library(ggplot2)
library(reshape2)
SummaryUI <- function(id, label = "summary"){
fluidPage(
# First Section
fluidRow(
h2("About"),
h5("SexBrainRank application is build
to help user exp... |
3bf4055aee4b753bb5767f8bdb728fc653c60300ac0c7f5d078ea8b3ccf2dca0 | R | 4,363 | 101 | options(stringAsFactors = F)
library(data.table)
gtf = fread("/proj/steinlab/projects/R00/eQTLanalysis/phenofiles/gene_transcript_v92.csv",data.table = F)
gtf = gtf[which(gtf$type == "gene"),]
end = gtf$end
idx = which(gtf$strand == "-")
gtf$start[idx] = gtf$end[idx]
type = commandArgs(trailingOnly=TRUE)[1]
i = comma... |
35b46cb1deaf9e70385a8d74061018224bd57272b578ceeb3a536f628556ebe5 | R | 4,365 | 86 | ####################################################################################################
# Script to calculate GO term ratio in modules #
# #
##############... |
326e490b62f9de009ea3955c5fdf16fac95fea588529680cf41615a99ec2ebb9 | R | 4,390 | 154 | #' @import dplyr
#' @importFrom R6 R6Class
#' @include utils.R
#' @include model_helpers.R
#' @include folds_manager.R
GSCrossEvaluator <- R6Class(
classname = "GSCrossEvaluator",
public = list(
# Properties ---------------------------------------------------------------
predictor_preparator = NULL,
... |
63e2f9099654384589dca3202f37f10b54a6fb51dc08e4fdcdc946b801c96165 | R | 4,413 | 106 | # Find TF eGene motifs within chromatin accessbile regions throughout the genome
options(stringAsFactors = F)
# Filter chromatin regions with motifs
chr = commandArgs(trailingOnly=TRUE)[1]
i1 = commandArgs(trailingOnly=TRUE)[2]
i2 = commandArgs(trailingOnly=TRUE)[3]
# Get TFs PWM list from https://pubmed.ncbi.nlm.n... |
c59bd07fbe910d604aaa4c5ff8f7e2b8ecb843fe7bd39ef52bc268b9ef270ae9 | R | 4,416 | 108 | # Find TF eGene motifs within chromatin accessbile regions throughout the genome
options(stringAsFactors = F)
# Filter chromatin regions with motifs
chr = commandArgs(trailingOnly=TRUE)[1]
i1 = commandArgs(trailingOnly=TRUE)[2]
i2 = commandArgs(trailingOnly=TRUE)[3]
# Get TFs PWM list from https://pubmed.ncbi.nlm.n... |
5cbceb1979757c2d98e80a34170755993495bad7a3a8bdef2e8a744d6fbe6fe2 | R | 4,480 | 126 | # Missing value inspection for selection and survival bias
-----------------------------------------------------------
### Install and load MICE package
#install.packages("mice")
library(mice)
### Visualise missing value pattern
dat <- dplyr::select(ukb_lbl, depr_c.0, wb.0, mean_sbp.0, high_bp.0,
... |
aecc2a5f2cb3d09282941503db5062b6f763a3dff7f5386bacc934a0971b8b22 | R | 4,533 | 94 | library(MASS);library(sfsmisc);library(dplyr);library(purrr)
library(SummarizedExperiment); library(qs);library(ggplot2); library(gridExtra);
library(pryr); library(tibble); library(furrr); library(tidyr); library(readr)
library(dplyr); library(data.table); library(grid); library(limma);
library(pheatmap); library... |
8bd3b8311be9861a954f6f0998ad4799a71636cb53320756b571edae2584876c | R | 4,538 | 129 | library(ggplot2)
library(pheatmap)
library(RColorBrewer)
dir.create('Plots')
#======================================================================================================================================
# zscore heatmap (diff peaks)
#pval_thresh <- 0.05
adjPval_thresh <- 0.05
log2fc_thresh <- 0
##
valTa... |
f7a3078687aac9633dd43a96563769817d1b45d67b0c6540d891295e8cf1c817 | R | 4,554 | 87 | options(stringAsFactors=FALSE);
library(data.table)
##chrs
Gchrs=c(1:22);
Pchrs=paste0("chr",c(1:22));
library(data.table)
gtf = fread("/proj/steinlab/projects/R00/eQTLanalysis/phenofiles/gene_transcript_v92.csv",data.table = F)
gtf = gtf[which(gtf$type == "gene"),]
Genofile = '/proj/steinlab/projects/R00/eQTLanalysi... |
febacfd37bc5540eaf6384ad59ec43fd9ac0b75fbd1fd5b19a75b14fe5ec072e | R | 4,555 | 94 | #Run INSPEcT on Kallisto transcript quantitations
#Calculate first guess rates
#for this version calculate the rates from single replicates,
#so that the replicate values can be used for the AUC calculations
library('INSPEcT')
log <- file(snakemake@log[[1]], open="wt")
sink(log)
sink(log, type="message")
#input files... |
6fb81538e6c922cb697a149c337749c209beb827b10309e00799cf5a93f967e1 | R | 4,606 | 155 | # Principal component analysis of the study features following min/max normalization
insert_head()
# container list -----
pca <- list()
# globals: analysis tables -----
insert_msg('Globals setup')
pca$variables <- pah_study$mod_variables$variable
pca$analysis_tbl <- pah_study[... |
57e1248695998a3c408767be219050f41d41a3b81d0bffdb29a7019c07a537f2 | R | 4,608 | 117 |
options(stringAsFactors = F)
library(GenomicRanges)
library(data.table)
library(rtracklayer)
k = commandArgs(trailingOnly=TRUE)[1]
bim = fread(paste0("/work/users/n/i/nil1/replication_data_xQTL/eQTLchr",k,"_1Mb.csv"), data.table=F)
# liftover the data
path = "/proj/steinlab/projects/R00/eQTLanalysis/hg19ToHg38.ov... |
1ecfb12af07849e35d817a297adf54fc97040956eb688401d09499a5c9f9c201 | R | 4,630 | 159 | #' @import dplyr
#' @importFrom R6 R6Class
#' @include model.R
#' @include bayesian_model.R
#' @include model_helpers.R
#' @include geno_preparator.R
#' @include markers_preparator.R
GSRadialModel <- R6Class(
classname = "GSRadialModel",
inherit = BayesianModel,
public = list(
# Properties ----------------... |
797649807f13dd29cc9615b432b4f8274e59eb23fab298188a9f009c2fd2d085 | R | 4,634 | 157 | ##########################################################################################
## Generate network plot and pie charts for SCZ PPI data
##
## Author: Yu-Han Hsu
##########################################################################################
rm(list=ls())
library(igraph)
library(qgraph)
library(... |
62a579b876a2ed3c782592249f5b8dd8ac34df96f7344f8723a6ca51afd413e0 | R | 4,686 | 135 |
#############################################################################
###############
############### Combine trans-cis eQTLs
############### author: Nil Aygun
###############
#############################################################################
options(stringsAsFactors = F)
library(data.table)
type ... |
332c4c74cae5e0559f172bfffdb7c3c2098f01a343ef6d9b1bae5a5bd0836dd9 | R | 4,714 | 158 | # context("Testing get_DE_genes")
library(geneBasisR)
### set up inputs
## libs
library(SingleCellExperiment)
set.seed(32)
## toy data
counts = matrix(c(rep(0,10),1,1,1,0,0, 1,1,1,0,0, 1,1,0,0,0,1,0,0,0,0,0,1,1,0,0), nrow = 5, ncol = 7)
sce_correct = SingleCellExperiment(list(logcounts = counts))
colnames(sce_corre... |
74fe3369f1edd69fe4946a400d0fcb64d689e5738cbeefdd02c15986c4f896a2 | R | 4,730 | 118 | load("C:/Users/Proprietario/Desktop/OneDrive - Universit? degli Studi di Bari/age.WGCNA.paper/age.WGCNA.paper_moduleList_grch38.RData")
jaccard = function(x,y){ length(intersect(x,y))/length(union(x,y)) }
caudate = moduleList[2:4]
dlpfc = moduleList[7:10]
hippo = moduleList[12:15]
caudate.all = lapply(caudate,function... |
a39ff908c0a782496cc764b1cbc4a1093eaf76fc7a942f9a0ae4b3f34ba8b93b | R | 4,798 | 132 | #############################################################################
###############
############### Combine trans-cis eQTLs
############### author: Nil Aygun
###############
#############################################################################
options(stringsAsFactors = F)
library(data.table)
type =... |
68e8b739eb3efd7f9926f38a71c925b63c84a229603ce0123f450168f77a211a | R | 4,811 | 86 | ####################################################################################################
# Script to Combine WGCNA network output (module assignments, connectivity etc) in a single file #
# "Regional-coexpression","Age-period" and "Cell Population" studies #
# ... |
9de581042623bf2eba3d940b9ec7953d2203dc8c4a197519ea6baad9aa1b0815 | R | 4,832 | 104 | #Run INSPEcT on Kallisto transcript quantitations
#Calculate first guess rates
library('INSPEcT')
log <- file(snakemake@log[[1]], open="wt")
sink(log)
sink(log, type="message")
#input files
nas_exon_file <- snakemake@input[['nas_exon_file']]
nas_intron_file <- snakemake@input[['nas_intron_file']]
tot_exon_file <- sna... |
a14548b15d19ffd097d91c81de2ce50e554b7744540b915eb6b6de7017412632 | R | 4,883 | 190 | axis.projection <- function(object,
ab.column = "AB",
a.label = "A",
b.label ="B",
split.on = NULL,
include.orthogonal = FALSE){
#' @export axis.projection
new.col <- pas... |
a0ac9b8d8c4610c240da3da2868754a9743e86750574453ecd39102b4213ec3f | R | 4,999 | 133 | library(Seurat)
library(Signac)
library(ggplot2)
library(MASS)
library(GenomeInfoDb)
library(EnsDb.Hsapiens.v75)
library(patchwork)
library(rtracklayer)
library(viridis)
sampleList <- c(
'X4870NOSN',
'X4996NOSN',
'X5006NOSN',
'X5130NOSN',
'X5628NOSN',
'Public1NOSN',
'Public2NOSN',
'X4831PDSN',
'X5215PDSN',
'X5244PD... |
2a36a0e663376e381e0db92c9aa30476424ed50ca2ae2e01ff0042a651638d0a | R | 5,028 | 127 |
enriched.modules = readRDS("age.WGCNA.paper/consensus/new_consensus_raw_data_metanets.rds")
colnames(enriched.modules$risk.module.negative.corrected)[1:2] = c("new.network","module")
perinatal = c("DLPFC Perinatal",
# "META Perinatal",
"Werling2020",
"Walker2019",
... |
1d41cae290728a77d7f4d6e9743b8ca8e9e45f67e7281c1e8f2fcc4627460eee | R | 5,048 | 103 | ebe2sleep <- function(data=NA,idCol="subject",RefCol="reference",deviceCol="device",epochLenght=30,
staging=TRUE,stages=c(wake=0,light=1,deep=2,REM=3),digits=2){
# renaming variables
colnames(data) <- gsub(idCol,"ID",colnames(data))
data$ID <- as.factor(data$ID)
colnames(data) <- ... |
13c9266514b09f41d451ceb9c64fa1abfe447491aee955725a18d92fc234a50d | R | 5,104 | 80 | # continuation of noci-deseq2.R plotting percent of genes expressed over normalized count of 100----
length(expressed.D28.100ct[Category=='GPCR', GeneId]) /length(genelist.all[Category=='GPCR', GeneId]) *100 #22.55639
length(expressed.D28.100ct[Category=='Neuropeptide', GeneId]) /length(genelist.all[Category=='Neurop... |
975af523a1b0b88b6bd17e0ca64a5514bf93788b43caddbc46d5d87ae9021248 | R | 5,139 | 245 | data(IrisMatrix)
test_that("Univariate numeric", {
x <- list(list(x = x_num, model = "BRR"))
model <- bayesian_model(
x = x,
y = y_num,
testing_indices = 10,
seed = 1,
verbose = FALSE
)
y <- y_num
y[10] <- NA
x <- list(x_1 = list(x = to_matrix(x_num), model = "BRR"))
expect_bayesia... |
c30842deee368a654f627a576162952d942792c40fc1c22cd778df0e8f475879 | R | 5,148 | 157 | # Univariate cox modeling. Numeric variables are splined
# with their second order terms
insert_head()
# container list -----
multi_cox <- list()
# parallel backend -------
insert_msg('Parallel backend')
plan('multisession')
# globals: median-centered analysis table -----
... |
e2574f9ce714f4593e25a615f347aa73eb2b8113abb209cd861636c9d9aaa187 | R | 5,165 | 102 | shinyjs::hide('step1-btn1')
shinyjs::hide('step1-dl2')
output$`step1-dl1` <- downloadHandler(
filename=function(){'example_input.csv'},content = function(file){write.csv(example.dat,file,row.names = T)}
)
user.dat<-reactive({
req(input$expr)
tmp<-fread(input$expr$datapath);rnames<-tmp[[1]];tmp<-as.matrix(tmp[,-1,... |
bc9d458a219ebefc4b02373c5ec9d5056f63dfcb378ed1e7cb66e41ff48a4f20 | R | 5,235 | 172 | #' @importFrom R6 R6Class
#' @importFrom glmnet cv.glmnet
#' @include utils.R
#' @include model.R
#' @include model_helpers.R
GeneralizedLinearModel <- R6Class(
classname = "GeneralizedLinearModel",
inherit = Model,
public = list(
# Constructor --------------------------------------------------
initial... |
66e487fc5c9b3d2deb0aa14df8359bfa106e97865fc4869ef064a49b574f3d94 | R | 5,288 | 101 | # venn diagram for expression past a cutoff----
# let's set cutoff for "expressed" to 10 for norm counts.
genes.present <- unique(c(chloride.channel, porins, sodium.channel,
calcium.channel, voltage, ligand,
gap, potassium))[unique(c(chloride.channel, porins, sodium.... |
9daa9a9175b5cd0b3042e61571b0149b2f25adc9ee4d1776b8587ceab8dbb126 | R | 5,289 | 270 | data(IrisMatrix)
test_that("Univariate numeric (no tuning)", {
x <- x_num
x <- cbind(x, 1)
colnames(x)[ncol(x)] <- "temp"
model <- suppressWarnings(support_vector_machine(
x,
y_num,
seed = 1,
verbose = FALSE
))
expect_support_vector_machine(
model = model,
x = to_matrix(x),
y =... |
7434b6c20402df766e1c9e0e6e8a3ec3669a8ad3b66abade40bab96374c8a3a8 | R | 5,348 | 140 | #' Sci Data Paper Supplementary Figures 1 and 2
#'
#' @import readr
#' @import ggplot2
#' @import dplyr
#' @import ggridges
#'
#' @return supplfigure1.pdf;supplFigure2.pdf
#' @export
get_supfig1_2=function() {
# warnings off
w <- getOption("warn")
options(warn=-1)
if( !exists("fig"))
dir.create("fig"... |
6160ca52645fa229f5d383451c3ffd3340efab597bbbc02c9cd589c2f6f758ab | R | 5,359 | 115 | # Necessary libraries
suppressPackageStartupMessages(library(LFQbench))
# Parse the variables out of the command line, if called from command line
command_args <- commandArgs(trailingOnly = FALSE)
script_args <- commandArgs(trailingOnly = TRUE)
# print(command_args)
file.arg.name <- "--file="
if (length(script_args) ... |
142bc5bdee8c45391f19b3a00795cb55b6811e05db69e323caae6ebf0953b171 | R | 5,367 | 215 | # Use all default hyperparameters (no tuning) -------------------------------
x <- to_matrix(iris[, -5])
y <- iris$Species
model <- deep_learning(x, y)
# Predict using the fitted model
predictions <- predict(model, x)
# Obtain the predicted values
predictions$predicted
# Obtain the predicted probabilities
predictions$... |
bae09cd7e42acd05203ff734eec631a1d0a7621be009d6b40d71289820db839d | R | 5,396 | 151 | #!/home/ajl1213/anaconda2/bin/R
library(Seurat)
library(dplyr)
dir.create('SeuratObjects')
##===================================================================================================================================================
## Load data
data1 <- Read10X(data.dir='/home/ajl1213/Projects/PD/SciAdv_D... |
8eade8d0c0c4a3a451bf4e0544e6f2bf35e60c6aa51daa8997c520994bdd3363 | R | 5,403 | 110 | library(dplyr)
library(purrr) ; library(gapminder)
library(SummarizedExperiment); library(qs);library(ggplot2); library(gridExtra);library(pryr); library(tibble); library(furrr); library(tidyr); library(readr)
library(dplyr); library(data.table); library(grid); library(limma); library(pheatmap); library(RColorBrewer... |
fe050f1fc39ea207605bc2e6c2b328fbca679da7933cd6d27144db83f708b795 | R | 5,414 | 137 | ---
title: "Eye_Tracking"
author: "AZ"
date: "2022-08-31"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r Libraries, warning = FALSE}
library(ggplot2)
library(dplyr)
library(afex)
library(emmeans)
library(ggpubr)
```
```{r import data, include=FALSE}
#Define path... |
ac285c336d607537785aec51d95b5c1074a9373cadcec5b2813ec180bdea0dab | R | 5,448 | 140 | # Project: Cost and utilities inputs for economic evaluation
# Created by: James Hedley
# Date created: 29th November 2021
# Last updated: 15th December 2021
# Load libraries
library(tidyverse)
library(haven)
library(readxl)
# Set directories
usyd <- '//shared.sydney.edu.au/research-data/'
anzdataloc <-... |
62bdc6cfb24e6457af18a092be51f256669d0dbafa5b903506741f68aea88de6 | R | 5,449 | 177 | #' Sci Data Paper Supplementary Figure 5
#'
#' @import lme4
#' @importFrom grDevices dev.off pdf
#' @importFrom graphics axis barplot par text
#' @return supplfig5.pdf
#' @export
get_supfig5 <- function() {
printPVCA = function(theDataMatrix, metaDT, main){
pct_threshold = .4 # Amount of variability des... |
eefad484ad966e82180a66f69ab8a1496f5c4fb0e5a8a2f9285465243021b859 | R | 5,462 | 169 | #!/anaconda2/scEnv
library(ggplot2)
library(RColorBrewer)
dir.create('Plots')
celltypes <- c('DopaN', 'GabaN', 'Oligo', 'OPC', 'Ast', 'Micro', 'Endo', 'Peri')
## celltype eQTL barplot
data1 <- read.table('sigEQTL.cRE_asso.txt', header=T)
data1$CellType <- factor(data1$CellType, levels=celltypes)
pdf('Plots/ce... |
89613860792454624dd53a0f6dc6a854c885417645095e37d86237919c046fb9 | R | 5,594 | 153 | ##########################################################################################
## Rare variant risk enrichment analysis of SCZ PPI networks
## using gene-based scores and KS test
##
## Author: Yu-Han Hsu
##########################################################################################
rm(list=ls()... |
ac72f36436e38e940e35a2dc19f5e4fb69bc347b6946fc97271be5131e2872e5 | R | 5,619 | 116 |
#' calc_Minkowski_distances
#'
#' Function returns Minkowski distances for kNN-graphs constructed from counts matrix in sce (stored in assay logcounts) using specified genes.
#'
#' @param sce SingleCellExperiment object containing gene counts matrix (stored in 'logcounts' assay).
#' @param genes Character vector conta... |
698359fe7b58e10b66bc30dcaa0ac0d61738c2d47e59f0d280c6c0aa3256bca5 | R | 5,646 | 174 |
library(Seurat)
library(Signac)
library(Rmagic)
library(GenomeInfoDb)
library(EnsDb.Hsapiens.v75)
library(ggplot2)
library(patchwork)
library(RColorBrewer)
library(viridis)
dir.create('Plots')
##=========================================================================================================================... |
69b6e142eb966801caeb25b13f7602a9a71e152c7ba1b5072fe77c80612d331c | R | 5,764 | 114 | run_scPred<-function(DataPath,LabelsPath,CV_RDataPath,OutputDir,GeneOrderPath = NULL,NumGenes = NULL){
"
run scPred
Wrapper script to run scPred on a benchmark dataset with 5-fold cross validation,
outputs lists of true and predicted cell labels as csv files, as well as computation time.
Parameters
... |
fdeb413ed6fa44d47ef12508ed402713ddda9326509a4d41a1d95e96474122b2 | R | 5,771 | 163 | #' Takes the RBT file from XMALab and converts it into a 4-D array
#'
#'\code{import_rbt} takes the RBT file output by XMALab, and converts it into an
#' array of dimensions \[4 x 4 x n_frames x n_rigid_bodies]. The 4x4
#' component is the transformation matrix. If the RBT file contains only one
#' RBT (as whe... |
a199c39bc39ad8bbd52630e0587e69bec12e19edc1e4fb9a2b928770371d1422 | R | 5,780 | 122 | ####################################################################################################
# Script to Estimate beta for WGCNA via connectivity match #
# "Cell-population enrichment" studies #
# ... |
70c352df2f05faa44484f5b6f9a8562800cefbe8a707cf56ca459e9bfd413409 | R | 5,783 | 130 | if (!require("pacman")) install.packages("pacman")
pacman::p_load(ggplot2, devtools, dynRB,reshape2,vegan,factoextra, dplyr, corrplot, ggrepel, tibble, Rtsne)
source('R_scripts/ggbiplot2.R')
######
##I. Species-specific overlap
######
#0. Data load and preparation
animal = read.csv('Data/animal.csv')
huma... |
9735e4e37e78e9e4f9d9cefcb0fcc554ad08799d6d4249a61abc05d6acc01a2d | R | 5,800 | 121 | ####################################################################################################
# Script to Estimate beta for WGCNA via connectivity match #
# "Cell-population enrichment" studies #
# ... |
0d8a5263a78e399b68245e10cda08b8e96c98d04dbd1729700d588ef02156524 | R | 5,820 | 145 | ######################################################################
####### Figure 6A
######################################################################
chr = 4
t = 1
label = "chr4:56362263:C:G"
infile = "/proj/steinlab/projects/R00/eQTLanalysis/Raw_data/cell/progenitor/chr4/P-chr4-ENSG00000174780.ps.gz"
ldlink... |
5d6589c586ade51fdd225f6deffb771c56b11d7ac50ecc5772db8de4375cd2f8 | R | 5,837 | 162 | # Clustering the joint (IBK + LZ) data set as suggested by the reviewer 1
insert_head()
# container -------
clust_rev <- list()
# Analysis globals -------
insert_msg('Analysis globals')
clust_rev$variables <- unique(multi_plots$coefs$variable)
clust_rev$distances <- c('euclidean... |
819029e6062af6eafc88ae1191ab6dcdb63eee8d0bec906c06d2a8f4f0bbadc4 | R | 5,870 | 192 | #' Sci Data Paper Figure 3
#'
#' @import plyr
#' @import grid
#' @import gridExtra
#' @import cowplot
#' @import ggplot2
#'
#' @return figure3.pdf
#' @export
get_fig3 <- function() {
# warnings off
w <- getOption("warn")
options(warn=-1)
if( !exists("fig") )
dir.create("fig")
# load data
data(raw, en... |
0684e9d6c15a5dcccdb2f520954394d090219633fbddf6acc7525197a28183dc | R | 5,952 | 155 | ##########################################################################################
## Compare and plot co-expression z-scores of bait-interactor pairs subsetted by
## different variables, using co-expression data derived from 4 transcriptomic datasets:
## Stickels2021, Maynard2021, Velmeshev2019, BrainSpan
##
#... |
40ac98f3c5eea683da7d8321f680b06063e42b40ba64f659cf9de0869e969782 | R | 5,991 | 154 | library(reshape2)
library(data.table)
library(DESeq2)
library(ComplexHeatmap)
library(RColorBrewer)
setwd('/Users/malleyce/Downloads/DRGs/')
genelist <- as.data.table(readxl::read_xlsx('/Volumes/ncatssctl/NGS_related/BulkRNA/ISB012/Tao/Marker genes in category.xlsx'))
genelist
load('DRGs.Nociceptors.DDS.RData')
dds.... |
4007eaeafeaf5b99be79390bd371a2d1cc2711770d992e0eec6c510a7ea57538 | R | 5,992 | 183 | # Correlation of the risk tool values in the study cohorts
#
# The purpose is to check to which extent the established risk assessment tools
# overlap with each other and with the newly established Elastic net score
#
# The Reveal scores are skipped from the final analysis
insert_head()
# container -----... |
126dea5af51b4012ec6a8e73f4814cdf64eb11d1d59c0d33efddb53aacae8bf0 | R | 5,998 | 82 | library(biomaRt)
library(clusterProfiler)
library(org.Hs.eg.db)
library(limma)
library(tidyverse)
cc <- readRDS("C:/Users/mpariha1/Desktop/upload_to_google_drive/OneDrive - Johns Hopkins/Shared Data/Giulio's ML code/Enrichments/grch38[PGC125new]/SNPextension/consensus_genes/consensus_gene_list_new.withHartl.rds"... |
1c8d05f9422e770d71081f9631ede00547758e765facabd4210c84a2519e02f5 | R | 6,005 | 154 | ##########################################################################################
## Overlap enrichment analysis between SCZ PPI networks vs. cell-type-specific DEGs
## found in SCZ patients vs. controls (using scRNA-seq data from Ruzicka et al.)
##
## Author: Yu-Han Hsu
#######################################... |
1ed81fb28e109a5a2ff7e9bf055c7adaca7a916702d1dec8050ef1aaf55dcc6f | R | 6,019 | 164 | #' @include utils.R
#' @include validator.R
#' @include generalized_linear_model_model.R
#' @title Fit a Penalized Generalized Linear Model
#'
#' @templateVar ClassName GeneralizedLinearModel
#' @templateVar XType matrix
#' @templateVar YType `vector` or `matrix`
#' @templateVar refFunction glmnet::glmnet()
#'
#' @des... |
765c06b7f681a9d06cccb087884ed600fd4e1a0da2a50dd138bcef24a91231d2 | R | 6,035 | 105 | library(dplyr)
library(purrr)
library(SummarizedExperiment); library(qs);library(ggplot2); library(gridExtra);library(pryr); library(tibble); library(furrr); library(tidyr); library(readr)
library(dplyr); library(data.table); library(grid); library(limma); library(pheatmap); library(RColorBrewer); library(broom); li... |
c13fe3df419f8a10a1752f2982ae88cf593c5a0af221ad5a418d79f15d3b6a5c | R | 6,083 | 111 | # setwd("~/Working/GitHub/twin-data-models")
setwd("C:/GitHub/twin-data-models")
rm(list = ls())
# Load libraries
library(umx)
library(tidyverse)
# Set up session 01 data
famData.ses01 <- readRDS("QTAB_familywise_ses01.RDS")
mzData.ses01 <- famData.ses01 %>% filter(zyg == 1 | zyg == 2)
dzData.ses01 <- famData.ses01 %... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.