sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
9e4e29b2ae0e89578bf3ecaecb9968aa3d6a5375a68f46b65280b01cff54236f | R | 355 | 15 | # This program executes the scripts of the PAH biomarker project
# libraries -----
library(soucer)
# listing figure scripts ----
print(source_all(c('import.R',
'exploration.R',
'analysis.R',
'paper.R'),
message = T... |
b1cf7d2b8e844d6b835ee79481e01372e6c83c39b85a56ccc0e6b36c888f4281 | R | 365 | 16 | #' @importFrom R6 R6Class
#' @include utils.R
#' @include model_helpers.R
#' @include grid_tuner.R
DeepLearningGridTuner <- R6Class(
classname = "DeepLearningGridTuner",
inherit = GridTuner,
public = list(
# Methods --------------------------------------------------
eval_one_fold = deep_learning_eval_o... |
0aff721ead29365f28e2fa20759b95cfccf87d0ff0b4a4ec65b4f3c7bd6556be | R | 375 | 6 | source("../MSstatsExternalTool.R")
inputFile <- normalizePath("Rat_plasma_with_qvalues.csv")
outputdir <- file.path(getwd(), "TestResult");
outputdir <- paste(outputdir, "/", sep="")
dir.create(outputdir, showWarnings=FALSE)
MsStatsExternalTool(c("GC", "--dataFileName", inputFile, "--normalization", "globalStandards", ... |
35752024f5bba84457a06841944f8152e96f14b68358461c6da027c3e6fc174f | R | 381 | 16 | #' @importFrom R6 R6Class
#' @include utils.R
#' @include model_helpers.R
#' @include bayesian_tuner.R
DeepLearningBayesianTuner <- R6Class(
classname = "DeepLearningBayesianTuner",
inherit = BayesianTuner,
public = list(
# Methods --------------------------------------------------
eval_one_fold = deep... |
981dede86903295b747ad14758f2d2f63614eef31ca771d2533b550100fe7c0f | R | 399 | 7 | #' @details
#' In univariate models with a numeric response variable, Mean
#' Squared Error ([mse()]) is used by default as loss function. In univariate
#' models with a categorical response variable, either binary or with more than
#' two categories, accuracy ([accuracy()]) is used by default. You can change
#' the de... |
63578315323e292b04c6448d5058f232d4751e2a65fa3a0a4a799af2dc3c04ae | R | 417 | 7 | source("../MSstatsExternalTool.R")
inputFile <- normalizePath("Human_plasma.csv")
outputdir <- file.path(getwd(), "TestResult");
outputdir <- paste(outputdir, "/", sep="")
dir.create(outputdir, showWarnings = FALSE)
MsStatsExternalTool(c("DSS", "--dataFileName", inputFile, "--numSample", "2", #"--power", ".8",
... |
6f7da77e8b5860bbc76e82874c59047c1a0a0cd64681970ee8510c11bafb65b5 | R | 419 | 16 | #' Perform a row-wise relative standard deviation calculation and return a numeric vector of the coefficient of variation
#'
#' @param mat input data matrix
#'
#' @return A numeric vector of the coefficient of variation
#' @export
#'
#' @examples
#' mat <- matrix(rnorm(50),5,10)
#' get_cv(mat)
get_cv <- function(mat){
... |
3407a677f871325827fb0f124eceae55b3e8b71dac7e19ae199e8ad5bdfb6f4e | R | 423 | 16 | #' Median location Normalization
#'
#' @param df Numeric matrix or dataframe
#'
#' @return Global median location normalized numeric matrix
#' @export
#'
#' @examples
#' mat <- matrix(rnorm(50),5,10)
#' normalize_median(mat)
normalize_median = function (df){
df_med = apply(as.matrix(df), 2, function(x) median(x, na.r... |
bf9e5ef5ceb8b69f2438eb6757193056e91db055d5759209c33fab420e1d62ca | R | 441 | 25 |
library(pheatmap)
library(RColorBrewer)
valColor <- brewer.pal(9, 'PuBu')
maxLogPval <- 5
data1 <- read.table('GOTABLESORTED/MP.celltype.txt', header=T, row.names=1, sep='\t')
data1[data1>maxLogPval] <- maxLogPval
pdf('Plots/MP.heatmap.pdf')
pheatmap(data1,
annotation_colors = setAnnoColor, color=valColor,
show_... |
a44cd8c94b5675c89d84f6d3e336ac51d1fa58017d98ec927094501962c6a5b5 | R | 451 | 7 | #' @param validate_params (`logical(1)`) Should the parameters be validated? It
#' is not recommended to set this parameter to `FALSE` because if something
#' fails a non meaningful error is going to be thrown. `TRUE` by default.
#' @param seed (`numeric(1)`) A value to be used as internal seed for
#' reproducibl... |
3be57efcf1bbeaed758fcf1187aae491b9b4490e0afe7de5ce90b6005f880b28 | R | 469 | 29 |
library(pheatmap)
library(RColorBrewer)
library(viridis)
maxLogPval <- 5
data1 <- read.table('logPvalMat.txt', header=T, row.names=1)
data1[data1>maxLogPval] <- maxLogPval
print(summary(as.vector(as.matrix(data1))))
#valColor <- magma(15)
valColor <- brewer.pal(9, 'PuBu')
pdf('dysPeak.LDSC.logPval.pdf')
pheatmap... |
c0239f7fd85dbf0bb0ca2bada0bc1e8c11875653ebc6868b226fde484593c255 | R | 470 | 30 |
library(pheatmap)
library(RColorBrewer)
library(viridis)
maxLogPval <- 5
data1 <- read.table('logPvalMat.txt', header=T, row.names=1)
data1[data1>maxLogPval] <- maxLogPval
print(summary(as.vector(as.matrix(data1))))
#valColor <- magma(15)
valColor <- brewer.pal(9, 'PuBu')
pdf('allPeak.LDSC.logPval.pdf')
pheatma... |
cb4b4b5c4f7203ae3a53bf9f74a70ff7ac2f2454abf38647500330638216f8ce | R | 470 | 7 | #' @description
#' All the parameters marked as (__tunable__) accept a vector of values with
#' wich the grid is generated for grid search tuning or a list with the min
#' and max values for bayesian optimization tuning. The returned object contains
#' a `data.frame` with the hyperparameters combinations evaluated. In ... |
6bb922bcc367dabc6213dd7e6a27a6dafaa7f8b40ebc3c39480d5714aa906f37 | R | 475 | 30 |
library(Seurat)
args <- commandArgs(TRUE)
snRNA_object <- args[1]
cellType <- args[2]
outFile <- args[3]
##
seuset <- readRDS(snRNA_object)
subseuset <- subset(seuset, idents=cellType)
valMat <- subseuset@assays$RNA@data
z_score <- function(x){(x - mean(x)) /sd(x)}
zmat <- apply(valMat, 1, z_score)
zmat <- t(zm... |
56b9bfb5f5ab116ba351f813adb68575878f368da756f69a42bb800480dbb9c0 | R | 484 | 10 | install.packages(c("gplots", "lme4", "reshape", "reshape2",
"ggplot2", "ggrepel", "data.table", "dplyr", "tidyr",
"survival", "doSNOW", "snow", "foreach", 'stringr',
"randomForest", "minpack.lm", "optparse"),
repos='http://cran.us.r-project.org'... |
6659ef60484585f9e6c67b80fce513af88c8112abf38b024948a3840a88d7ca7 | R | 511 | 23 | #' @importFrom R6 R6Class
#' @include utils.R
GenoPreparator <- R6Class(
classname = "GenoPreparator",
public = list(
# Properties --------------------------------------------------
Geno = NULL,
# Methods --------------------------------------------------
initialize = function(Geno) {
sel... |
815dd10475bc8056c1c0bb29a393263af09006d88f715bb7cd30719264927faf | R | 547 | 28 |
library(Seurat)
library(Signac)
args <- commandArgs(TRUE)
snATAC_object <- args[1]
cellType <- args[2]
outFile <- args[3]
##
seuset.atac <- readRDS(snATAC_object)
subseuset <- subset(seuset.atac, idents=cellType)
valMat <- subseuset@assays$RNA@data
z_score <- function(x){(x - mean(x)) /sd(x)}
zmat <- apply(valM... |
855c0825af1d87f78ba6b8193ca1218ea9c6e574edfc5b40cd0a01e259f42daf | R | 567 | 22 | #' @importFrom R6 R6Class
MarkersPreparator <- R6Class(
classname = "MarkersPreparator",
public = list(
# Properties --------------------------------------------------
Geno = NULL,
# Methods --------------------------------------------------
initialize = function(Geno) {
self$Geno <- Geno
... |
cd1bc2e4779c6f3522eb0b6f4de784a545f2659cf5f994cf794c8f4b367052eb | R | 567 | 25 | #' @importFrom R6 R6Class
#' @include model_helpers.R
#' @include grid_tuner.R
RadialGridTuner <- R6Class(
classname = "RadialGridTuner",
inherit = GridTuner,
public = list(
# Attributes --------------------------------------------------
Pheno = NULL,
y = NULL,
predictors = NULL,
geno_prepa... |
138fbd162e80c6ad44fee091057d23f29cb2661e941500cec227707477a520c2 | R | 577 | 19 | command_args <- commandArgs(trailingOnly = FALSE)
script_args <- commandArgs(trailingOnly = TRUE)
# print(command_args)
file.arg.name <- "--file="
if (length(script_args) > 0 && length(grep(file.arg.name, command_args)) > 0) {
report_file <- script_args[1]
report_dir <- dirname(report_file)
if (report_dir != "")... |
72f2ee7767c94f2e1ae6e44605f57441d2524b45202aaf08b1051648e2715362 | R | 580 | 23 | ## waverepo_installs.R
## This file contains the commands to install extra packages
## required to run the vignette..
## 1. Install sjemea
install.packages(pkgs=c("./sjemea_0.40.tar.gz"),
repos = NULL, type="source")
## It is also available from the web if you wish:
##install.packages(c("sjemea"),
##... |
4256f61720d7a089dfe86e9d9b1f353e6c02a2c27724fb38ccf22edf93a388da | R | 596 | 19 | command_args <- commandArgs(trailingOnly = FALSE)
script_args <- commandArgs(trailingOnly = TRUE)
# print(command_args)
file.arg.name <- "--file="
if (length(script_args) > 0 && length(grep(file.arg.name, command_args)) > 0) {
script_file <- sub(file.arg.name, "", command_args[grep(file.arg.name, command_args)])
s... |
3ce87f51a6d7024708fbbf360c1168b442403baf5f4ff5d91b171a403674128e | R | 600 | 26 |
library(RColorBrewer)
library(Vennerable)
dir.create('Plots')
#======================================== Chow-Ruskey Plot
data1=read.table('Plots/VennInput.txt', header=T)
### a,b,c,d,e
## 00000 10000 01000 11000 00100 10100 01100 11100 00010 10010 01010 11010 00110
## 10110 01110 11110 00001 10001 01001 11001 00... |
dbbf70342273763a55f7e59f870d31ed027c018e02e6ec282f9589c76a66080f | R | 603 | 26 | #' @importFrom R6 R6Class
#' @include utils.R
#' @include model_helpers.R
#' @include bayesian_tuner.R
RadialBayesianTuner <- R6Class(
classname = "RadialBayesianTuner",
inherit = BayesianTuner,
public = list(
# Attributes --------------------------------------------------
Pheno = NULL,
y = NULL,
... |
fb91a12f6943ad015e9d86194e65b4319bcbfafbd3e19060a4b0bf6088a3a41c | R | 632 | 27 |
library(plotrix)
library(RColorBrewer)
df <- read.table('GWAS_eQTL.asso.txt', header=T)
GWAS_overlap <- df$overlapGWAS[1]
GWAS_spec <- df$totalGWAS[1] - df$overlapGWAS[1]
dataTypeList <- c('GWAS_common','GWAS_spec')
countVal <- c(GWAS_overlap, GWAS_spec)
fracVal <- round(countVal / df$totalGWAS[1], 4)
fracVal <... |
dc70cfca236f4b9a218430f2821b5066d133e9c9fdb0c7ff15996055ae5cc595 | R | 636 | 31 | library(pheatmap)
library(RColorBrewer)
##===================================== make log2fc heatmap
data1 <- read.table('PDGenes.valMat.txt', header=T, row.names=1)
color_range <- colorRampPalette(c('blue','white','red'))(15)
pdf(paste0('Plots/PDGenes.log2fc.heatmap.pdf'))
pheatmap(data1, color= color_range,
clus... |
0c83241ce04b944fd201f6177776c25f090c7ddc62c9d1398babefe7dbf0e3bd | R | 678 | 30 | # Script to install all the required packages for SKM library
is_installed <- function(package) {
return(all(package %in% rownames(installed.packages())))
}
is_windows_os <- function() {
return(.Platform$OS.type == "windows")
}
ok <- TRUE
if (is_windows_os()) {
if (!is_installed("installr")) {
install.pac... |
a9d62d33efb02293ca2517ead2f61f2555f3d84a8f14519edcd9feb9d61a9a36 | R | 687 | 16 | #' MouseEmbryo, E8.5
#' Counts matrix for mouse embryo, E8.5 (data extracted from Pijuan-Sala et al., 2019).
#'
#' SCE object with log-normalised counts matrix (pre-calculated with custom script) strored in assay logcounts.
#' colData contains information about sample (i.e. batch), celltype and provided color-code for ... |
1243024ca047ac99244c19d9d787d51795f66b7b90ca204d12392564f54ccfe6 | R | 693 | 21 |
CellLabelFile <- read.table('/home/ajl1213/Projects/PD/data/snATAC/04_GetAtacCount/CellLabel/AtacPeak.CellLabel.txt', header=T)
BulkDiffPeakFile <- read.table('/home/ajl1213/Projects/PD/data/ChIP/2_CountMatrix/ValTable/H3K27ac.valTable.filter.txt', header=T)
downPeaks <- BulkDiffPeakFile$peakID[which(BulkDiffPeakFi... |
a8678454253ecabab1306d54f7bffbd085c3a6ff4d47cc600f3a44c0ff60011f | R | 696 | 24 | library(preprocessCore)
#=========================================================================================================
## Quantile normalization
# H3K27ac
data <- read.table("CountMatrix/H3K27ac.readCount.denoised.txt",head=T,row.names=1)
peakList <- read.table('/home/ajl1213/Projects/PD/data/snATAC/04_... |
d3d95ca1ef5fd9d0f0520df8d7ac4f702a0a7aeb6313d3cbac7797f80ff77695 | R | 701 | 27 | #Install QuaSAR Packages
a<-installed.packages()
packages<-a[,1]
if (!is.element("bitops",packages)){
install.packages("bitops" , repos='http://cran.us.r-project.org')
}
if (!is.element("reshape",packages)){
install.packages("reshape" , repos='http://cran.us.r-project.org')
}
if (!is.element("gtools",packages)){
ins... |
71331b3e2441e79b266aba473e22fecbecb974b9b8311acd0b3d0f7aa4ac74e1 | R | 702 | 32 | # Generates paper tables and figures
# tools --------
library(knitr)
library(rmarkdown)
library(bookdown)
library(flextable)
library(writexl)
library(soucer)
library(figur)
source_all(c('./tools/project_tools.R'),
message = TRUE, crash = TRUE)
insert_head()
... |
66c1de5d640cd6565664d7ee58cdb12543f46912ddc1b4293433690ea2ed4dcb | R | 745 | 22 | library(preprocessCore)
#=========================================================================================================
## Quantile normalization
data <- read.table("CountMatrix/RNA.rawCount.txt",head=T,row.names=1)
valMat=as.matrix(data[, 2:ncol(data)])
qq_values <- normalize.quantiles.robust(valMat)
c... |
d6c73c765c8c09a1e8c4042d5720b7f78d304f377271dc9398f7224f8475f51f | R | 746 | 33 | #' @importFrom R6 R6Class
#' @include cross_validator.R
CustomCV <- R6Class(
classname = "CustomCV",
inherit = CrossValidator,
public = list(
# Constructor --------------------------------------------------
initialize = function(folds, name = "CustomCV") {
private$folds <- folds
folds_numbe... |
9f5ab0e72a9a5133181bcaac8ceaf68ce4fca062cb5970c9a75faef7a2cca99a | R | 747 | 26 | # Links to development packages ------
insert_head()
# container -----
links <- list()
# links -----
insert_msg('Mdlink objects')
links <- c('_trafo_' = 'https://github.com/PiotrTymoszuk/trafo',
'_figur_' = 'https://github.com/PiotrTymoszuk/figur',
'_coxExte... |
fd480f044d8367c1c7070406b108e2cd41480d9ae49d50a0765aa1dfb9f351c7 | R | 778 | 34 |
library(ggplot2)
library(RColorBrewer)
dir.create('Plots')
colList <- c(brewer.pal(9, 'PuBu')[7], 'darkorange')
#
data1 <- read.table('var_cRE_asso.v2.txt', header=T)
data1$PeakType <- factor(data1$PeakType, levels=c('Down','Up','nonDys'))
label <- c()
label[grep('NOSN', data1$SampleID)] <- 'NOSN'
label[grep('PDS... |
b0daf156b997a7b623205d1a1eefcbbf111bf280ac87ad386e71f6236e856945 | R | 785 | 44 |
library(pheatmap)
library(RColorBrewer)
dir.create('Plots')
maxVal <- 15
#
col_range <- brewer.pal(10, 'YlOrBr')
downPlotDF <- read.table('Down.plotMat.txt', header=T, row.names=1)
downPlotDF[downPlotDF > maxVal] <- maxVal
pdf('Plots/Down.GO.pdf', width=10, height=8, pointsize=3)
pheatmap(downPlotDF,
color= col... |
ed889f0293547d8c066a140db4a86ad2265b1bc79874039108b7a09afe124d77 | R | 791 | 21 | # The output is a 2-row matrix, with each row representing
# true_labels and predict_labels of one fold
setwd("C:/Users/Plus0/Desktop/data1/Baron Human")
Labels <- read.csv("Labels.csv", header = T)
n_folds = 5
cols = dim(Labels)[1]
rows_block = cols%/%n_folds
for (i in 0:(n_folds-1)){
lower = rows_block... |
ba577ee6f2c6a30c473cd1843ae40a008a057778f42d03fcc94919eebc9e0983 | R | 819 | 20 | # Find significant trans-caQTLs
options(stringsAsFactors=F)
dat = data.frame()
for (i in 1:22) {
dt = data.table::fread(paste0("/proj/steinlab/projects/R00/eQTLanalysis/path_QTL/data/progenitor_TF_match_chrom_chr",i,".txt.gz"))
dat = rbind(dat,dt)
cat("chr ",i,"\n")
}
dat = dat[,-c(4,7)]
colnames(dat) = c... |
446eae29ce7a8e51024fafab9f2f6c398fa482666ab0a6dc71a296b3222f0b83 | R | 827 | 48 |
library(pheatmap)
library(RColorBrewer)
data1 <- read.table('matchedGWAS.celltype_asso.sample.txt', header=T)
df <- NULL
for (sampleID in unique(data1$SampleID)){
valList <- c()
for (cellType in unique(data1$CellType)){
fc <- data1$foldEnrich[which(data1$SampleID==sampleID & data1$CellType==cellType)]
... |
99f0303a78279c8aa74559e37e5efab3a1e7f65ab9886604433226501ef80a2c | R | 852 | 23 | #' Process source data to raw
#'
#' @param dat source peak area output from Skyline
#'
#' @return formatted raw dataframe
#' @export
source_to_raw <- function(dat) {
colnames(dat) = sapply(strsplit(colnames(dat), " "), "[", 1)
colnames(dat) = sapply(strsplit(colnames(dat), "-"), "[", 1)
if ("PeptideModifie... |
b8a303cd7f8d38dd40cbaafda649059be24868f9f70bf86716fc4891fe432742 | R | 895 | 35 |
library(plotrix)
library(RColorBrewer)
data1 <- read.table('GWAS_eQTL_HiC.comparison.count.txt', header=T)
#
eqtl_spec_target <- data1$eqtl_spec[1]
common_target <- data1$common[1]
total <- eqtl_spec_target+common_target
#
dataType <- c('common_target', 'eqtl_spec_target')
count <- c(common_target, eqtl_spec_targ... |
dab783f591471d0946d6a682b33f45eb54d8840be4968d8b37f67eb01640a555 | R | 897 | 22 | 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]
k = comma... |
2b639b05b3982ea67bc5b5258087d4425b3f01d5ff4db542ca88c3be81080df1 | R | 900 | 25 | #' Genomic Maize data.
#'
#' Phenotypic and Genotype maize data.
#'
#' @format A list with two fields: Pheno and Geno. Pheno is a data frame with
#' 2888 observations and 4 variables. Geno is a data frame with 722 observations
#' of 723 variables.
#'
#' @source M. Bandeira e Sousa et al., "Genomic-Enabled Prediction in... |
f4ef69607009d1ede4c2d7fb96f0f33514a4c5e898c3c10bb94f6e90e61f709b | R | 959 | 22 | # Get TF-eQTLs to serach for motifs within chromatin accessible regions
# Data from http://humantfs.ccbr.utoronto.ca/download.php
tfcsv = read.csv("/proj/steinlab/projects/R00/eQTLanalysis/path_QTL/data/tf_list.csv")
tfcsv = tfcsv[which(tfcsv$Is.TF. == "Yes"),]
tf_motif = tfcsv[which(tfcsv$TF.assessment == "Known moti... |
2d325657313b068babcc7eab9cf6827609c4c072de71991fb9f735ad2d5f6301 | R | 961 | 23 | # Get TF-eQTLs to serach for motifs within chromatin accessible regions
# Data from http://humantfs.ccbr.utoronto.ca/download.php
tfcsv = read.csv("/proj/steinlab/projects/R00/eQTLanalysis/path_QTL/data/tf_list.csv")
tfcsv = tfcsv[which(tfcsv$Is.TF. == "Yes"),]
tf_motif = tfcsv[which(tfcsv$TF.assessment == "Known moti... |
261ac966554c63f2eb9a582962e382da31c0d5e86ea7797c397107a92005ad79 | R | 1,012 | 26 | # Cran packages
install.packages("rmarkdown", repos = "https://mran.revolutionanalytics.com/snapshot/2016-01-02")
install.packages(c("DBI", "XML", "sp", "RSQLite", "Rcpp",
"MatrixModels", "robustbase", "lme4", "MALDIquant", "colorspace",
"cellranger", "data.table", "uuid", "readr", "aplpack",
"gplots", "m... |
abdc0445bc71efc59c321603f56a80c6e6c5eaf429716fa08d9758ffc6860ade | R | 1,014 | 37 | #' @importFrom R6 R6Class
#' @include utils.R
#' @export
CrossValidator <- R6Class(
classname = "CrossValidator",
public = list(
# Properties --------------------------------------------------
name = NULL,
folds_number = NULL,
records_number = NULL,
testing_proportion = NULL,
# Construct... |
9821bf57c7d19265c9b3e356051acaf14a4a0aa9e286a9ba7bb455eb18a758e2 | R | 1,015 | 26 | library(tidyverse)
library(magrittr)
library(readxl)
####################
##Prepare Hartl2021 network
##https://doi.org/10.1038/s41593-021-00887-5
#Reading gene-module assignments from Supplementary Table 1
path = "C:\\Users\\mpariha1\\Desktop\\upload_to_google_drive\\OneDrive - Johns Hopkins\\Paper new an... |
918b450bca1c9b7dbff3034588190e5ed9bb9a06a11199200dd604c6537b6ad1 | R | 1,073 | 40 | #!/env/maftools
library(maftools)
dir.create('Plots')
genomeVer <- 'hg19'
input_files <- c(
'annovar/X4870NOSN.hg19_multianno.exonic.txt',
'annovar/X4689NOSN.hg19_multianno.exonic.txt',
'annovar/X5628NOSN.hg19_multianno.exonic.txt',
'annovar/X5130_1NOSN.hg19_multianno.exonic.txt',
'annovar/X4996NOSN.hg19_multianno... |
cdfaacbfee03e94eaab68275552e42ec9f439dfa08865e6323ee3d2c7220a73d | R | 1,082 | 22 | #' @return
#' ## When `format` is `"list"`
#'
#' For univariate models a named `list` with the element `"predicted"` which
#' contains the predicted values is returned. For categorical variables the
#' returned `list` includes the element `"probabilities"` too with a
#' `data.frame` of the predicted probabilities of ea... |
52ee5eda25b45d705356852f5f6531589b082b44d70114e8d74dcb3ee5ae93ef | R | 1,089 | 24 | #Install External R Packages
#When a user installs a tool in Skyline this checks to make sure the required packages are also installed. If the packages don't exist on the users machine skyline will
#require the user to install them before they can continue using the tool. This InstallPackages.r file checks for the qc... |
1ab231f17a66d45ec5f1367c00896a2fa20c8572b80e24044dc82061692d9809 | R | 1,096 | 37 | # this R script is for scSpace spatial-informed clustering step
source('../scripts/utils.R')
# parameters
sc_data_file <- '~/workspace/spatial_cluster/human_heart/sc_data.csv'
sc_meta_file <- '~/workspace/spatial_cluster/human_heart/sc_meta.csv'
pseudo_coords_file <- '~/workspace/spatial_cluster/human_heart/pseudo_coo... |
e31e8ab72fb1681c40afa16e28768709c6e406401c985bb5bf854f7e9f08caf0 | R | 1,099 | 41 |
library(Vennerable)
inputDIR <- '/home/ajl1213/Projects/PD/SciAdv_Anal/CombinedTargetID/01_FindTarget/RESULT'
dir.create('Plots')
minAbcScore <- 10
#======================================== Chow-Ruskey Plot
DopaN <- read.table(paste0(inputDIR,'/DopaN.selectList.txt'), header=T)
DopaN <- DopaN[which(DopaN$abcScore ... |
fd40ca3421747d7180bca0104e95bc2bc83d9cae4a9bd6046d73d031190507c0 | R | 1,099 | 42 | #' @importFrom R6 R6Class
#' @include cross_validator.R
KFoldCV <- R6Class(
classname = "KFoldCV",
inherit = CrossValidator,
public = list(
# Constructor --------------------------------------------------
initialize = function(folds_number, records_number, name = "KFoldCV") {
super$initialize(
... |
e8635ff189977234d9a8386578ed0ee89fd7936124430c1c73c8f1f5dad63b3a | R | 1,100 | 49 |
library(edgeR)
dir.create('ValTable')
data1 <- as.data.frame(read.table('/home/ajl1213/Projects/PD/data/ChIP/2_CountMatrix/AdjustedBulk/H3K27ac.cellAdjusted.qq.combat.txt', header=T, row.names=1))
#
diagnosis=c()
diagnosis[grep('NOSN', colnames(data1))] <- 'NOSN'
diagnosis[grep('PDSN', colnames(data1))] <- 'PDSN... |
6650711070336d629043d0ad2fef005a3b4e352247ffcaab706feff64242b592 | R | 1,103 | 48 |
library(pheatmap)
library(RColorBrewer)
col_range <- colorRampPalette(c('white','yellow','darkorange','red','darkred'))(20)
celltype_colors <- brewer.pal(8, 'Dark2')
maxVal <- 60
##
data1 <- read.table('AbcScoreMat.filtered.ordered.txt', header=T, row.names=1)
# row annotation
annoRow <- data.frame(maxCell=data1... |
fd6ed0ea0f1d32e2fa838722ecdc320b120c4b3c43afe8055465b7f65edebeb3 | R | 1,106 | 49 |
library(edgeR)
dir.create('ValTable')
data1 <- as.data.frame(read.table('/home/ajl1213/Projects/PD/data/RNAseq/2_Cellularity/AdjustedBulk/RNA.cellAdjusted.combat.qq.txt', header=T, row.names=1))
#
diagnosis=c()
diagnosis[grep('NOSN', colnames(data1))] <- 'NOSN'
diagnosis[grep('PDSN', colnames(data1))] <- 'PDSN'
... |
8a2b62b006b2408a30753a35b354bd1059a646bc78eb9ee637b63d7c70a0133e | R | 1,108 | 58 | data(Maize)
folds <- cv_kfold(nrow(Maize$Pheno), k = 5)
results <- gs_fast_bayesian(
Maize$Pheno,
Maize$Geno,
traits = "Y",
folds = folds,
is_multitrait = FALSE,
iterations_number = 10,
burn_in = 5,
thinning = 5,
seed = NULL,
verbose = TRUE
)
print(results)
#> $Predictions
#> # A tibble: 2,88... |
9eeabc655c956c08cf7b67854421ee3b5c760642802620a97bfcecb4660fb156 | R | 1,109 | 46 | #' @import dplyr
#' @importFrom R6 R6Class
GSPredictorPreparator <- R6Class(
classname = "GSPredictorPreparator",
public = list(
# Properties ---------------------------------------------------------------
Pheno = NULL,
Geno = NULL,
predictors = NULL,
X = NULL,
# Methods ----------------... |
a361adb681cf8ba09bd93d3a3ebd9a741fe6a7230e375ff78264f7dbab6864c7 | R | 1,115 | 43 | #' @importFrom R6 R6Class
#' @include cross_validator.R
RandomCV <- R6Class(
classname = "RandomCV",
inherit = CrossValidator,
public = list(
# Constructor --------------------------------------------------
initialize = function(folds_number,
records_number,
... |
7fa5d8088924b86b996aa7cd3ce075dcea70cf0e7518842fdfcce0a1f1cc7d85 | R | 1,133 | 57 |
library(pheatmap)
library(RColorBrewer)
dir.create('Plots')
cellTypeList <- c('DopaN','GabaN','Oligo','OPC','Ast','Micro','Endo','Peri')
maxPval <- 10
# DOWN
col_range <- brewer.pal(9, 'YlGnBu')
data1 <- read.table(paste0('PvalMat/Down.logPval.txt'), header=T)
dataLabel <- paste0(data1$cellType, '.', data1$termI... |
107c1f2c2ba70153d0cd5b7fc88255a8ad84b845418deec9c2221dd90b567044 | R | 1,141 | 52 | #' @importFrom R6 R6Class
#' @include utils.R
FoldsManager <- R6Class(
classname = "FoldsManager",
public = list(
# Properties ---------------------------------------------------------------
folds = NULL,
current_number = 0,
initialize = function(folds) {
self$folds <- folds
},
# ... |
9e7def2ce7e1f5fc0ddf5f0cdcd1cd2151d11b6f84035b2695f428f8163d6e25 | R | 1,148 | 56 |
dir.create('Plots')
##
data1=read.table('SnpTable/MergedPD.PeakAsso.txt', header=T)
nTotal=nrow(data1)
nTotal
nonPeakSNP=data1[which(data1$peakLabel=='none'),]
peakSNP=data1[which(data1$peakLabel!='none'),]
##
nNonPeakSNP=nrow(nonPeakSNP)
nPeakSNP=nrow(peakSNP)
fracNonPeakSNP=round(nNonPeakSNP/nTotal*100, digi... |
2d49b9d22cc6229a9fe6e910b26094c7a5a89649df356c8f8eb50ab5ac3addd9 | R | 1,152 | 35 | library(Seurat)
library(SingleR)
library(scRNAseq)
library(SingleCellExperiment)
library(Matrix)
library(plyr)
memory.limit(50000)
setwd("C:/Users/Plus0/Desktop/Inter-dataset/PbmcBench")
rm(list=ls())
gc()
load("matrix_data.RData")
load("labels.RData")
for (ref in c("inDrop")){
for(test in c("10Xv2",... |
9c4ca2d8660635816d36fe5a31a469990a5345a74b0cf0d1365acbe12222bb8d | R | 1,161 | 56 | ---
title: "R Notebook"
output: html_notebook
---
```{r}
#loading the tools
library(readr)
library(forcats)
library(lme4)
library(ggplot2)
library(stargazer)
library(lmerTest)
library(rcompanion)
library(tidyverse)
library(emmeans)
library(ggResidpanel)
library(jtools)
```
```{r}
#loading the dat... |
dcd9527ccd9e4f35601d67bb7e5be60ba9f62588907ec29040212bdd69841bee | R | 1,164 | 21 | # Extract the trans-caQTL results with motif match
options(stringAsFactors = F)
library(data.table)
type = commandArgs(trailingOnly=TRUE)[1]
i = commandArgs(trailingOnly=TRUE)[2]
ss = fread(paste0("/proj/steinlab/projects/R00/eQTLanalysis/path_QTL/data/",type,"_all_TF_chrom_chr",i,".txt.gz"),data.table=F)
ss$gene =... |
3e0ec864792f31ba0c02cbd314bde91a62e04a5676003bdc1e0338e81cd5044c | R | 1,169 | 34 | # this script renders a word file with the figures and supplementary material
insert_head()
# rendering the figures and tables ------
insert_msg('Rendering the figures and tables')
render('./paper/markdown/figures_and_tables.Rmd',
output_format = word_document2(number_sections = FALSE, ... |
02995fcfd9100928b67da3f844594d8c022bafbcea38d0a0553a846d1e49e2c5 | R | 1,205 | 35 | library(Seurat)
library(SingleR)
library(scRNAseq)
library(SingleCellExperiment)
library(Matrix)
library(plyr)
memory.limit(50000)
setwd("C:/Users/zhangjn.CSDOMAIN/Desktop")
rm(list=ls())
gc()
load("matrix_data.RData")
load("labels.RData")
for (ref in c("10Xv2", "10Xv3", "CEL_Seq", "Drop_Seq","inDrop", ... |
6a63d168a2667897c95eed598da720035e4837e527231c8c9d41d2200caf0bd5 | R | 1,225 | 24 | #' @details
#' ## Tuning
#'
#' The general tuning algorithm works as follows:
#'
#' 
#'
#' For grid search tuning, the hyperparameters grid is generated (step one in
#' the algorithm) with the cartesian product of all the provided values (all the
#' posible combinations) in a... |
11a6f667e246aa35ea2054ce0de05c72c173c0f24437f05d3b11113a76833374 | R | 1,234 | 31 | # If you have not used the TwoSampleMR package before, please uncomment lines 4-6 to install ------
# install.packages("devtools")
# library(devtools)
# install_github("MRCIEU/TwoSampleMR")
# Load the TwoSampleMR package --------------------------------------------------------------------
library(TwoSampleMR... |
35d77f81f9cc0ba197774d17905f2950c1d3d9bbe6e4657551d8fd0c4109c716 | R | 1,239 | 34 | #' @importFrom GPfit predict.GP
#' @title Utility Computing Function
#'
#' @description
#' Computing Utility.
#'
#' @param x_vec a vector of scaled hyperparameters
#' @param GP an object of class GP
#' @param acq Acquisition function type to be used
#' @param y_max The current maximum known value of the target utility... |
8df3c45c84407c7f815986f07a32fe80747536a132179278cd97bdc2e57dd261 | R | 1,263 | 43 |
library(ggplot2)
library(RColorBrewer)
library(viridis)
dir.create('Plots')
nGroup=10
cellTypeList <- c('DopaN', 'GabaN', 'Oligo', 'OPC', 'Ast', 'Micro', 'Endo', 'Peri')
celltype_colors <- brewer.pal(8, 'Dark2')
idx <- 1
## Increasing order of contact score
for (cellType in cellTypeList){
data1=read.table(... |
7f6763dee6d1a509b11581bb1c2871016e8050d6b31390f63f1fe0c3276278fb | R | 1,278 | 35 | # this R script is for scSpace spatial-informed clustering step
source('../scripts/utils.R')
# parameters
sc_data_file <- '~/workspace/scSpace/data/[9]human_covid19/original_data/sc_data_sampled.csv'
sc_meta_file <- '~/workspace/scSpace/data/[9]human_covid19/original_data/sc_meta_sampled.csv'
pseudo_coords_file <- '~/... |
0a0f514c342f94051b5721ee3224acfb35e0de7cd34706278b8034d4f3203d1f | R | 1,314 | 34 | #Install External R Packages
#When a user installs a tool in Skyline this checks to make sure the required packages are also installed. If the packages don't exist on the users machine skyline will
#require the user to install them before they can continue using the tool. This InstallPackages.r file checks for ______... |
c0423e39bf588b363845d55cd1df0f66de28a3f312abc62e37f1f2fb21f22dac | R | 1,321 | 63 | setwd("~/data_science/SKM")
roxygen2::roxygenise()
data(Maize)
# Data preparation of G
Line <- model.matrix(~ 0 + Line, data = Maize$Pheno)
LineGeno <- Line %*% Maize$Geno %*% t(Line)
Env <- model.matrix(~ 0 + Env, data = Maize$Pheno)
KEnv <- Env %*% t(Env) / ncol(Env)
# Identify the model
X <- list(
Env = list(x... |
8141d7ff1a44e9711ad78ca0c9320bf9a44e1c22cdbabedf23bd662213b3e968 | R | 1,338 | 65 | library(shiny)
library(shinydashboard)
source('Healthy_reg.R')
source('Healthy_allreg2.R')
source('Summary.R')
WebApp <- function() {
########## UI ##############
ui <- dashboardPage(
dashboardHeader(title = "SexRankBrain"),
dashboardSidebar(
sidebarMenu(
menuItem("Healthy (spec... |
d5cf6d2627c2aa4394aed613ea03e870ffaf54f7ff995c9a8c3c1b4515b94dfb | R | 1,341 | 23 | #' @return
#' An object of class `"<%= ClassName %>"` that inherits from classes
#' `"Model"` and `"R6"` with the fields:
#'
#' * `fitted_model`: An object of class [<%= refFunction %>] with the model.
#' * `x`: The final <%= XType %> used to fit the model.
#' * `y`: The final <%= YType %> used to fit the model.
#' * `... |
ff11f45a6cd0f3f8c41c25471c4f10ceebbd50e9d88d6e61854ba7a2e41da25f | R | 1,344 | 31 | # If you have not used the TwoSampleMR package before, please uncomment lines 4-6 to install ------
# install.packages("devtools")
# library(devtools)
# install_github("MRCIEU/TwoSampleMR")
# Load the TwoSampleMR package --------------------------------------------------------------------
library(TwoSampleMR... |
06a7541886ecbae153f4f651e0984c78fc8c342bb680f989351926457fcda643 | R | 1,351 | 54 | ---
title: "Zwang2023_LMER"
output: html_notebook
---
```{r}
#loading the tools
library(readr)
library(forcats)
library(lme4)
library(ggplot2)
library(stargazer)
library(lmerTest)
library(rcompanion)
library(tidyverse)
library(emmeans)
library(ggResidpanel)
library(jtools)
```
```{r}
#loading the... |
5f2ca881ba5a4a8dca6a9821844599ba6818877737a2cc96e6895d7a0731d419 | R | 1,380 | 37 | # Using 5_fold cross validation, read the expression matrix with their true labels,
# then predict their labels and save the result in variable "result_test"
# The output, "result" is a 2-row matrix, with each row representing
# true_labels and predict_labels of every fold
library(Seurat)
library(SingleR)
libra... |
a05c88d9e0903acc759f54be8756545f5d7473d93b1f403eaac20880847bbbc7 | R | 1,386 | 25 | 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... |
596b3a4588241040e7a5e410c196189b95e6cd0609ab4a2059bc79c1f9389d69 | R | 1,396 | 44 | library(ggplot2)
args <- commandArgs(TRUE)
geneID <- args[1]
chrID <- args[2]
pt1 <- as.numeric(args[3])
pt2 <- as.numeric(args[4])
#
#data1 <- read.table(paste0(geneID,'/',chrID,'_',pt1,'_',pt2,'_',geneID,'.txt'), header=T)
data1 <- read.table(paste0(geneID,'/',geneID,'.pval.txt'), header=T)
data1$adjP <- p.adju... |
3046e2fc11389f686dfa70d229473b74931f74cbdff8f33c8f77c5c0b74888ee | R | 1,433 | 62 | library(ggplot2)
dir.create('Plots')
data1 <- read.table('GOTABLESORTED/Merged.MP.txt', header=T, sep='\t')
data1$termID <- factor(data1$termID, levels=data1$termID)
## barplot
g1 <- ggplot(data=data1, aes(x=data1$termID, y=data1$nGene))+
geom_bar(stat='identity') +
theme_classic() +
theme(axis.text... |
9f460a2e610dd5a45549cd22ab9817a6da0c64ffceb60e15b7bb983551186a9a | R | 1,459 | 60 |
library(ggplot2)
library(pheatmap)
library(RColorBrewer)
dir.create('Plots')
#pval_thresh <- 0.05
adjPval_thresh <- 0.05
log2fc_thresh <- 1
##
valTable <- read.table(paste0('ValTable/RNA.valTable.txt'), header=T)
#valTable.filter <- valTable[which(valTable$adjPval < adjPval_thresh & abs(valTable$logFC) > log2fc_... |
7e35fe7ef18ffe8f8bebe87be1558ae34c4da274968bc425c294e4d1874dd32e | R | 1,466 | 43 |
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"),]
type = "neuron"
L = "N"
dat = data.frame()
for (i in 1:22) {
cat("Running chr",i,"\n")
ss = fread(paste0("/pine/scr... |
05d52f29f71d463b8d36551b41ee6e61b01eb60b4ef3f6093deec8167230c685 | R | 1,498 | 58 |
library(dplyr)
library(Seurat)
library(patchwork)
args=commandArgs(TRUE)
sampleID=args[1]
print(sampleID)
### Load dataset
inputDIR=paste(sampleID,'/outs/filtered_feature_bc_matrix/', sep='')
data1 = Read10X(data.dir =inputDIR)
### Make Seurat object
seuset = CreateSeuratObject(counts = data1, project = sampleID,... |
24442bd680266f3a6ea8db05bfac4126f163baaa8326476c0642c2b3a64edbdb | R | 1,513 | 43 | ##################################################################################################
### CELL-SPECIFICITY geneset enrichment analysis with limma ######################################
##################################################################################################
Cell_Specificity_funct... |
c0260014387c739d645f88b396705a5d4fa4a670f01e426ccc3041a4da0a9ba7 | R | 1,544 | 38 | # Using 5_fold cross validation, read the expression matrix with their true labels,
# then predict their labels and save the result in variable "classRes_val_all"
# The output is the predict_labels of every fold
library(singleCellNet)
library(Matrix)
setwd("C:/Users/Plus0/Desktop/data1/Baron Human")
raw_data <- ... |
6ab307e1137d262d3fabee8c2a2fc68c87298b257e915fae3f0ea46ba3492dd4 | R | 1,552 | 61 | library(data.table)
library(DESeq2)
library(Hmisc)
norm <- as.data.frame(counts(dds, normalized=T))
norm$gene <- row.names(norm)
norm <- as.data.table(norm)
norm <- norm[,c(46, 1:45)]
norm
coldata <- as.data.frame(dds@colData)
write.csv(coldata, 'coldata.csv')
# auto increment sample replicates with... |
be1bb951b0c3de41a45e39e289332550502886f5a61518c061292dbc5ba7126d | R | 1,567 | 53 | # Performs data analysis
# tools ----
library(soucer)
library(rms)
library(rlang)
library(glmnet)
library(caret)
library(furrr)
library(survminer)
library(coxExtensions)
library(exda)
library(rstatix)
library(DescTools)
library(somKernels)
library(clustTools)
library(ggrep... |
c78c1d112c4a9e741c96458131a50e328f3a9963d892407991f4e8dade188e98 | R | 1,599 | 47 | # If you have not used the TwoSampleMR package before, please uncomment lines 4-6 to install ------
# install.packages("devtools")
# library(devtools)
# install_github("MRCIEU/TwoSampleMR")
# Load the TwoSampleMR package --------------------------------------------------------------------
library(TwoSampleMR... |
0ee21c0400274f5bb891eb72260f4a7ed7331ae951037f3de4db2504d0ca3171 | R | 1,601 | 68 | #' @importFrom R6 R6Class
#' @include cross_validator.R
#' @include utils.R
KFoldStrataCV <- R6Class(
classname = "KFoldStrataCV",
inherit = CrossValidator,
public = list(
# Properties --------------------------------------------------
data = NULL,
# Constructor -----------------------------------... |
eda8cb12f23410d488d0d062272f1b7b55917c755fbb432283290b6467cdefb1 | R | 1,607 | 56 | ##R Script Template : Skyline Tool Store
# Created by Yuval Boss, Department of Genome Sciences at UW.
options (echo = FALSE)
debug <- FALSE
##
## Command line processing for Argument Collector
##
parse.cmdline <- function () {
# set up for command line processing (if needed)
# arguments are specified position... |
dd79b6676cdb55943de67f2a82fcf52885075fcfca2d1693b382de3c5a268012 | R | 1,617 | 30 | slice_id <- c(151507, 151508, 151509, 151510, 151669, 151670, 151671, 151672, 151673, 151674, 151675, 151676)
data_list <- list(
test_slice = slice_id,
train_slice = list(c(151508, 151509, 151510), c(151507, 151509, 151510), c(151507, 151508, 151510), c(151507, 151508, 151509),
c(151670, 15167... |
c8f63b1d869b667d576af5de04f18e5972fa4d24def5c66858e118e9f0cfa4b5 | R | 1,638 | 55 |
library(ggplot2)
library(RColorBrewer)
dir.create('Plots')
data1 <- read.table('AllelicReads.GWAS_matched.pval.txt', header=T)
data1$label <- factor(data1$label, levels=c('altEnrich','refEnrich','unchanged'))
col_list <- c(brewer.pal(8, 'Set2')[1],brewer.pal(8, 'Set2')[2],'grey')
#
p1 <- ggplot(data1) +
geo... |
35d2eb9ac1af89b60d98e6783f26312b253af01dcafe61032a4a20cd077e81fb | R | 1,658 | 79 | get.coordinates <- function(object,xcrd = "pixel_x",ycrd = "pixel_y"){
#' @export get.coordinates
return(object@tools$Staffli@meta.data[c(xcrd,ycrd)])
}
l2.norm <- function(x){
return(sqrt(sum(x**2)))
}
l2.distance <- function(x,y){
return(l2.norm(x-y))
}
project.on.vector <- function(data,v,reduce.dim = FAL... |
b5a6211da23ea51965fd8e05012d94ab2cef4b76cbda455a66fd089fef8be33a | R | 1,724 | 48 |
library(rGREAT)
dataTypeList <- c('Down','Up')
cellTypeList <- c('DopaN', 'GabaN', 'Oligo', 'OPC', 'Ast', 'Micro', 'Endo','Peri')
dir.create('GOBP')
dir.create('GOMF')
dir.create('MousePheno')
for (dataType in dataTypeList){
for (cellType in cellTypeList){
print(paste0(dataType, ', ', cellType))
peakFil... |
acc0450bddaa4b999674cb30a846a36a73816edc32b37df7053d403eb3270424 | R | 1,733 | 47 | # Find the SNPs significantly associated with TF eGenes
options(stringsAsFactors=FALSE)
library(data.table)
#----------------------------------- Preferences -------------------------------------------#
k = commandArgs(trailingOnly=TRUE)[1]
type = commandArgs(trailingOnly=TRUE)[2]
if (type == "progenitor") {
L =... |
685321b86ffbbcde53af1e0adc5c576b56945b0ad02286fa227fefc6ad3b4578 | R | 1,735 | 40 |
library(Signac)
library(GenomicRanges)
library(ggplot2)
seuset.atac <- readRDS('/home/ajl1213/Projects/PD/SciAdv_Data/snATACseq/2_SignacProcess/SeuratObjects/PD.SN.snATAC.postAlign.geneExp.label.anno.rds')
Macs2Path <- '/home/ajl1213/bin/macs2'
#================================ Peakcall
seuset.atac@active.assay <- ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.