sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
6842d8b84d428fcbf9a21971ca9a15d71babe6c3400b0692de91169970507ae9 | R | 65 | 3 | library(testthat)
library(scDblFinder)
test_check("scDblFinder")
|
461fd67f1cca6a5d5f99adb06838e94825db72d948654aeb5a31250ca2c99aa6 | R | 72 | 4 | library(testthat)
library(compareRhythms)
test_check("compareRhythms")
|
622f84762ae4cb087468b22fdff3712f8d5f0196297d6664c6384a9668e9bd7e | R | 83 | 3 | DATA_PATH <- "50_Data/"
COMPONENT_PATH <- "03_Components/"
PAGE_PATH <- "04_Pages/" |
760e4a7ff9deaefc814863ae8ca07943ecb075f86fdb36be96e0cac266739252 | R | 85 | 5 |
## a placeholder
hello <- function(txt = "world") {
cat("Hello, ", txt, "\n")
}
|
6c68579ba7e53e783c4f0348b4200c47bfb1252e5b2caee69a4f412af5a6c3ea | R | 91 | 3 | order_trajectory <- function(rna_mat, metadata, cell_types, feat_genes, reverse = TRUE){
} |
3f20b23a2e28017a7d0da66fdc80c169e8c85e5cc9d792eb1ba8cea24d7d9831 | R | 104 | 7 | setwd(dir = "D:/R_project/UCR_project/")
rm(list = ls())
library(tidyverse)
library(ggplot2)
head(mpg) |
41e885b947fc48f215ec84e161a46b4e8aa40004a3647ac37e210a1e103916ad | R | 108 | 3 | # process August 2023 run of Alena's data
# it appears this is the correct batch, watch for sample switch;
|
82a98ba114142ac85ae9f72c7997a1295cedd264a847baf7f451b9e8d966cc89 | R | 123 | 6 | library(lme4)
library(MASS)
md = lmer(size ~ Time + (1 | tree), Sitka)
md = lmer(size ~ Time + (1 + Time | tree), Sitka)
|
c56a30405b779fe1969b56b6000a98867f710a835b440356dbf3d08b5643ef97 | R | 130 | 3 | dta <- read.csv('./sunspots.csv')
attach(dta)
arma_mod <- arima(SUNACTIVITY, order=c(9,0,0), xreg=rep(1,309), include.mean=FALSE)
|
3e2fb344bca595ef306f78c33a32576e4cb5fa735bd258e18c4d6639673ee461 | R | 143 | 7 | library(rmarkdown)
library(knitr)
args = commandArgs(trailingOnly=TRUE)
render(args[1], output_file=args[2], output_format="word_document")
|
6dfe035f4f2adbac330d77ba5a97b3732637031a38560a760c4648a48f2e57c8 | R | 146 | 5 | library(data.table)
file_path <- "50_Data/mhlw_houdou.csv"
news <- fread(input = file_path)
news[, id := 1:.N]
fwrite(x = news, file = file_path)
|
9120f8bf889fcd993fdbe1f697bcbbd5fef93d6e69cfa6c4f7278cb10202146c | R | 176 | 6 | library(decoupleR)
library(readr)
collectri_hs <- get_collectri(organism='human', split_complexes=FALSE)
write_tsv(collectri_hs, "data/2023-11-15_collectri_homosapiens.tsv")
|
6efe32324f1f3839ec24140e56d76b97519d6395ec6ed93cddc488274f587cc7 | R | 196 | 7 | msg <- function(..., verbose=T) {
if (verbose) {
x <- paste(list(...))
name <- sys.call(sys.parent(1))[[1]]
cat(paste("[", name, "]", sep=""), date(), x, "\n")
}
}
|
d6304cefb5e62290d2e657805f3f71d6dd159d87761192e2503bb864fdb3797b | R | 198 | 14 | args = commandArgs(TRUE)
datafile = args[1]
k = as.numeric(args[2])
d = read.table(datafile)
dl = c(log(d$V1),-log(d$V1))
q = quantile(dl)
IQR = q[4]-q[2]
threshold = exp(q[4]+k*IQR)
threshold
|
b1ce84abe46509ed92e8ffbacdc293b5d89f22dd463ab4f03f3b67f100c9d616 | R | 210 | 17 | #!/usr/bin/env R
#
# Test deconvolution of Z by comparing pi estimate using the gold standard from rnascope.
#
#----------
# set paths
#----------
#-----
# load
#-----
#-----------
# set params
#----------- |
7b14925eff3b9cfa0d43daa12687da75742cb1c77a8759eccfca5b4f863edacd | R | 211 | 12 | require(BMS)
threshold <- function(y,e=0.05) {x=y[y>0];quantile(density(x,adjust=1),p=1-e);}
args = commandArgs(TRUE)
datafile = args[1]
e = as.numeric(args[2])
d = read.table(datafile)
threshold(d$V1,e=e)
|
c4398d1d721d0f1caa2428eaceea2b280ea08144894ffa007c0d2a5d4ca95ecf | R | 212 | 17 | #!/usr/bin/env R
# Get the Z signature matrix [G, K] for deconvolution testing
#----------
# set paths
#----------
#-----
# load
#-----
save.dpath <- ""
load.dpath <- ""
#-----------
# set params
#----------- |
303f9d804456897feca0e9c230539e322b0ea0a8f39273bcf618f6d95cf4f6cb | R | 214 | 4 | ## quiets concerns of R CMD check re: the .'s that appear in pipelines
if(getRversion() >= "2.15.1")
utils::globalVariables(c("datasets", "metrics", "tf", "pre_algo", "in_algo", "post_algo"))
Globals <- list()
|
e65f66ac865112337ab6a6935263830f50f7c6ec3f786ab53acbc4c451297357 | R | 217 | 9 | threshold <- function(y,e=0.05) {x=y[y>0];qlnorm(p=1-e, sdlog = sd(log(x)), meanlog = mean(log(x)))}
args = commandArgs(TRUE)
datafile = args[1]
e = as.numeric(args[2])
d = read.table(datafile)
threshold(d$V1,e=e)
|
86935d45fb6f0f46795d2a4328150750663aec5d3b37536b3d3f2c5bf58eaf22 | R | 218 | 20 | # ÔÚÄÔÖ×ÁöÀïʹÓÃANN
setwd(dir = "D:/R_project/UCR_project/")
rm(list = ls())
library(tidyverse)
library(nycflights13)
library(neuralnet)
challenge <- read_csv(readr_example("challenge.csv"))
|
d0757600220a81c72bdc8308bc68c5dfd04ce3cfe5fbfc0f1b331da99280755d | R | 222 | 18 | #!/usr/bin/env R
#
# Test deconvolution of Z by comparing pi estimate using the snRNAseq-derived
# pseudo bulk samples.
#
#----------
# set paths
#----------
#-----
# load
#-----
#-----------
# set params
#----------- |
aed3e9c22699be1f72d0ed9752daff9febd7b6f362414163827f54602c6d7249 | R | 227 | 9 | threshold <- function(y,e=0.05) {x=y[y>0];qlnorm(p=1-e, sdlog = sd(log(x)), meanlog = mean(log(x)))}
args = commandArgs(TRUE)
datafile = args[1]
e = as.numeric(args[2])
d = read.table(datafile)
exp(threshold(log(d$V1),e=e))
|
f431f36258790446bd55e107f71939d685aaeca873c8c56a8a5178fa557ce657 | R | 227 | 11 | # Siwei 12 Jan 2024
# test Hanwen's FACS data with flowCell and ggCyto
# init ####
library(ggcyto)
# load data ####
raw_flowFrame <-
read.FCS("293T_256_STOP1.fcs",
transformation = F,
alter.names = T)
|
88c1c1add0ead00ddb49784dd4ffaa5683db048af9cff4f4697aa6f5aa33b1af | R | 236 | 11 | require("fdrtool")
threshold <- function(y,e=0.05) {x=c(log(y),-log(y)); exp(qhalfnorm(p=1-e, theta=sd2theta(sd(x))))}
args = commandArgs(TRUE)
datafile = args[1]
e = as.numeric(args[2])
d = read.table(datafile)
threshold(d$V1,e=e)
|
0a5866c37c5f74d071e3886fde458be619c4feef2bac219a48379dc2e5a02882 | R | 238 | 9 | .onload <- function(libname, pkgname){
# utils::globalVariables("na.omit")
# utils::globalVariables(".")
# utils::globalVariables("tissueSiteDetailGTExv8")
# utils::globalVariables("tissueSiteDetailGTExv7")
#
# invisible()
}
|
0f88c2829ac94babbd828b97502cc5738a527083ca7745a42083d7c2b95257bb | R | 239 | 17 | #!/usr/bin/env R
# Analyze and summarize results of differential expression analyses in bulk RNAseq data.
#----------
# set paths
#----------
#-----
# load
#-----
save.dpath <- ""
load.dpath <- ""
#-----------
# set params
#----------- |
9c61557f5e63d2444b35cf523d63faa5e245ed4846ea9a2869e91a8ada22253f | R | 244 | 11 | row.vars <- function(x, na.rm=F) {
x <- x - rowMeans(x, na.rm=na.rm)
if (na.rm)
n <- rowSums(!is.na(x))
else
n <- ncol(x)
rowSums(x^2,na.rm=na.rm)/(n-1)
}
row.sds <- function(...) {
sqrt(row.vars(...))
}
|
b9993d031f9cd7f008ecd5b010ccd65f5789ff6c707512401e54eae1b93354d3 | R | 249 | 13 | #' @keywords internal
"_PACKAGE"
## usethis namespace: start
#' @import data.table
#' @importFrom magrittr %>%
#' @importFrom speedglm speedlm
## usethis namespace: end
NULL
ignore_unused_imports <- function() {
SingleCellExperiment::applySCE
}
|
2dc9f4aa5f253775a6fc228fe911c64198ef5d6718faa6a280a7b07b9d4f6159 | R | 267 | 8 | install.packages(c('BiocManager','Hmisc', 'RcppEigen','RcppNumerical'),
dependencies='Depends',
repo = "http://cran.us.r-project.org")
BiocManager::install(c('DESeq2','apeglm', 'rhdf5', 'tximport'))
library(DESeq2)
library(apeglm)
|
4f81950e8f6954fd71183f62748197350f2bc63487fe882ae63bca915a1d07ed | R | 269 | 12 | Component.NewsList <- function() {
return(
box(
width = 4,
title = tagList(icon("newspaper"), i18n$t("情報源リンク集")),
collapsed = T,
closable = F,
collapsible = T,
dataTableOutput("news") %>% withSpinner()
)
)
} |
eaeed1a2fcef46bf270d508bfc007b74256b6df011e13b6a37e1134fbc422211 | R | 279 | 18 | #!/usr/bin/env R
# Compare gene sets between snRNAseq derived marker genes and bulk RNAseq derived genes
# from differential expression analysis.
#----------
# set paths
#----------
#-----
# load
#-----
save.dpath <- ""
load.dpath <- ""
#-----------
# set params
#----------- |
54e4e6e63701b13def68d09becc3b12e7b9c1b2c221f335d17e7f49fe68fc663 | R | 280 | 37 | # »æÖƿɱä¼ô½Ó»ùÒòµÄ±í´ïµÄÏà¹ØÐÔ
# »¹ÓÐÒ»²¿·Ö»ùÒòÔÚ´óÄÔÖеıí´ïÊÇÏÈÉÏÉýºóϽµ£¬Ò²»Ò»¸ö·ÅÔÚ´óÂÛÎÄ
setwd(dir = "D:/R_project/UCR_project/")
rm(list = ls())
|
6f271b582ddf259c4999e161707a8107659b7c1631c462a3da0c1e92b482baad | R | 283 | 12 | library(itsmr)
options(digits=10)
# Test Hannan-Rissanen method on lake dataset using itsmr::hannan
# Python test is: test_hannan_rissanen::test_itsmr
res <- hannan(lake, 1, 1)
print(res$phi)
# [1] 0.69607715
print(res$theta)
# [1] 0.3787969217
print(res$sigma2)
# [1] 0.4773580109
|
4984d673c212fa2fed41016792c68bb5935fbb7527590a4688ae6820ad548e98 | R | 288 | 6 |
## Identify non-variable probes from bulk fetal brain DNAm data ##
source(paste0(scriptsPath, "1_1_extractNonVarProbes.r"))
extractNonVarProbes(path.betas=paste0(PathToBetas,"FetalBrainBetasEX3_23pcw_LOOZ_newmethod_ethsnp.rdat"), path.output=outputPath, name.output="nonVarprobes.rds") |
4b841432d8bdfb81fea5bcc29922fbb1a81b9aa43930e44193e834c7cef44055 | R | 297 | 19 | ---
title: "my-vignette"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{my-vignette}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
```{r setup}
library(CARD)
```
|
6078e21b84f014f31fc1ba240ef0437860ef131de3c88e6ffa0dcb23b0d3ff86 | R | 302 | 8 | read.table(file="tmp.paired.RICseq.signal.list") -> intact
read.table(file="tmp.other.RICseq.signal.list") -> random
t.test(intact,random,alternative = "greater") -> test
cat(test$p.value,"\t")
cat(mean(intact$V1),"\t")
cat(median(intact$V1),"\t")
cat(mean(random$V1),"\t")
cat(median(random$V1),"\t")
|
d0d5f48280ca04e8c9b070966977a5018e845e720c9e178c29d6b8159f0b920c | R | 302 | 12 | library(readxl)
library(purrr)
# Function to read all sheets from a file
read_all_sheets <- function(file_path) {
sheets <- excel_sheets(file_path)
sheets_data <- lapply(sheets, function(sheet) {
read_excel(file_path, sheet = sheet)
})
names(sheets_data) <- sheets
return(sheets_data)
}
|
24a84cf2e6b4c7d375b031189b74ac16a9543ae1c17324635c52c3dd029344d8 | R | 309 | 8 | #----------
# set paths
#----------
base.path <- paste0("/dcs04/lieber/lcolladotor/deconvolution_LIBD4030/",
"DLPFC_snRNAseq/processed-data/sce")
sce.fname <- "sce_DLPFC.Rdata"
rt.fpath <- "/users/smaden/ratio-tables_dlpfc-ro1.rda"
se.fpath <- "/users/smaden/se_marker-genes_dlpfc-ro1.rda" |
5d9a7d3b317563eb108c07adc68a4c5d12e6c5a4a193b37beaf77052f0eaebe5 | R | 309 | 14 |
tags=c("PD","Control")
c1=as.character(patstat[which(patstat[,2]==tags[2]),1])
c2=as.character(patstat[which(patstat[,2]==tags[1]),1])
sip=diversity(data[c1,])
sic=diversity(data[c2,])
sipm=cbind(sip,tags[2])
sicm=cbind(sic,tags[1])
divstat=as.data.frame(rbind(sipm,sicm))
colnames(divstat)=c("val","id") |
f68f39dc5ac0bfead9e9cf1ae198ffc1f144073f3d77e687fa7033c37ee9fac7 | R | 309 | 13 | #!/usr/bin/env R
#
# Submitting calculations using bash scripts generated with sgejobs.
#
#
#if (!requireNamespace("remotes", quietly = TRUE))
# install.packages("remotes")
## Install with:
#remotes::install_github('LieberInstitute/sgejobs')
library(sgejobs)
job_single('jhpce_job', create_logdir = FALSE)
|
d31a9d7677e1231cc3660b6105007d4182b80a1d4f22079619010ed5377075d6 | R | 321 | 20 | #!/usr/bin/env R
#
# Transform Z matrix using MuSiC weighting formula.
#
# Note: may need to rerun with the total mRNA denominator values for scaling.
#
#----------
# set paths
#----------
save.dpath <- ""
load.dpath <- ""
# signature matrix
z.fpath <- file.path(load.dpath, "")
#-----
# load
#-----
# signature matri... |
d883eb40d40cab1b50e6b3f746b1bce732a652cf7e168b8f8d82bb21a77dcd00 | R | 330 | 27 | # MEMEÕÒµ½Ò»¸ö¸»¼¯ÔÚintergenic UCRÉϵÄmotif£¬ÏÂÃæ»æÖÆÒ»¸ölogo
setwd(dir = "D:/R_project/UCR_project/")
rm(list = ls())
library(tidyverse)
library(ggseqlogo)
motif <- read.table(
file = "01-data/11.1-Get_intergenic_UCR_closest_pc_gene/CCMMKCTGVCWGCYK_counts.txt",
sep = " "
)
|
73d3fd187ae1cc71ceef24f951228f58fb0ce6d17a50ccdc0eeb27e843fd46db | R | 336 | 15 | #' The steps below are needed to regenerate
#' the data objects and documentation files
#' included with the package and then
#' run all tests.
#' install.packages("devtools")
#' devtools::install_github("klutometis/roxygen")
library(devtools)
library(roxygen2)
document("dmrff")
system("R CMD INSTALL dmrff")
reload(... |
28137e70fbdebd985c9df9e8197296881ec0d6e09663f3c390accde692fd637f | R | 338 | 13 | args = commandArgs(TRUE)
infile = args[1]
outfile = args[2]
require(ggplot2)
d = read.table(infile,header=F)
colnames(d) = c("signature")
p <- ggplot(d,aes(x=log(signature))) +
geom_histogram(bins=100) +
xlab("signature") + ylab("density") + theme_classic() +
theme(axis.text.x = element_text(angle=90))
... |
a0b407bc3275f6c07d1e3f94d91cfa348e53951b8821bf9c8dc5c485a4bc469e | R | 339 | 10 | # Function to write gmt file to disk
write_gmt <- function(gmt_list, file_name) {
conn <- file(file_name, "w")
for (gene_set_name in names(gmt_list)) {
gene_set <- gmt_list[[gene_set_name]]
line <- paste(gene_set_name, gene_set_name, paste(gene_set, collapse = "\t"), sep = "\t")
writeLines(line, conn)
... |
350b874d8e287be697669a0795e8a126d9397b73cb5a580114ec70f464dedeb8 | R | 340 | 14 | threshold <- function(y,e=0.05) {x=y[y>0];exp(quantile.density(density(log(x),adjust=1),p=1-e));}
args = commandArgs(TRUE)
#libpath = paste(args[1],"/Rlib",sep="")
libpath = file.path(args[1],"Rlib")
datafile = args[2]
e = as.numeric(args[3])
suppressMessages(require(BMS,lib.loc=libpath))
d = read.table(datafile)
... |
a9cd08460105545585749e77b54af183cce589fb73bb475d33739fed464f9c02 | R | 341 | 13 | #threshold <- function(y,e=0.001,epsilon=10^-3) {x=y+epsilon;qlnorm(p=1-e, sdlog = sd(log(x)), meanlog = mean(log(x)))}
require(BMS)
threshold <- function(y,e=0.05) {x=y[y>0];exp(quantile(density(log(x),adjust=1),p=1-e));}
args = commandArgs(TRUE)
datafile = args[1]
e = as.numeric(args[2])
d = read.table(datafile)... |
5bfc046052971989d8ad4878f3f2d4278a8e548d238185fcc12b1b96068e8d25 | R | 342 | 11 | library(tidyverse)
#' Get a named vector of genes ranked by score from smallest to largest value
get_ranked_gene_list <- function(df, score_col = "signed_padj", name_col = "gene_name") {
# Make sure smallest first (how fgsea wants it ordered)
df <- df %>% arrange(!!sym(score_col))
set_names(df[[score_col]]... |
6bee8d35758abed6bf721c6ec212918199679f44d5b1d4ad0de24e4285727dec | R | 345 | 13 | # function to read GMT file from disk
read_gmt <- function(file_path) {
con <- file(file_path, "r")
gmt_list <- list()
while(TRUE) {
line <- readLines(con, n = 1)
if (length(line) == 0) { break }
split_line <- strsplit(line, "\t")[[1]]
gmt_list[[split_line[1]]] <- split_line[-c(1, 2)]
}
close(... |
f3a466b0bafded2d76f54ed46831e4d6fd2c1c61baad477e430c92b53a6d8589 | R | 351 | 13 | args = commandArgs(TRUE)
infile = args[1]
outfile = args[2]
require(ggplot2)
d = read.table(infile,header=F)
colnames(d) = c("signature","taxon")
p <- ggplot(d,aes(x=taxon,y=signature)) + geom_col() +
scale_y_log10() +
xlab("taxon") + ylab("signature") + theme_classic() +
theme(axis.text.x = element_tex... |
63f729bda752b743d40efaebab69758d627481e82df66c92b7c889343b7d6808 | R | 359 | 11 | library(itsmr)
options(digits=10)
# Test innovation method on lake dataset using itsmr::ia
# Python test is: test_innovations::test_itsmr
res <- ia(lake, 10, 10)
print(res$theta)
# [1] 1.0816255264 0.7781248438 0.5367164430 0.3291559246 0.3160039850
# [6] 0.2513754550 0.2051536531 0.1441070313 0.3431868340 0.182740079... |
20fb54f39db03ddd36b6f837082c7e3282506adfadb2d7fd9517b83bc9475022 | R | 360 | 15 | styler::style_dir(
path = here::here("code"),
filetype = c("R", "Rmd"),
transformers = biocthis::bioc_style()
)
code_dirs <- list.files(here::here("code"))
my_dirs <- code_dirs[grepl("^0[1-9]",code_dirs)]
purrr::walk(my_dirs, ~styler::style_dir(
path = here::here("code", .x),
filetype = c("R", "Rmd"),
tr... |
216caa946880998067773da3693542993eb1f3de50f89b60883187feeb09968e | R | 362 | 7 | library('rsconnect')
load(here::here("shiny_apps", ".deploy_info.Rdata"))
rsconnect::setAccountInfo(name=deploy_info$name, token=deploy_info$token,
secret=deploy_info$secret)
options(repos = BiocManager::repositories())
rsconnect::deployApp(appFiles = c('app.R', "sce_hpc_small.rds"),
appName = 'tran2020_HPC', a... |
6af3b42aa0cf22c0da120c897bac9d677c844136432adf18de09f407320524ee | R | 362 | 7 | library('rsconnect')
load(here::here("shiny_apps", ".deploy_info.Rdata"))
rsconnect::setAccountInfo(name=deploy_info$name, token=deploy_info$token,
secret=deploy_info$secret)
options(repos = BiocManager::repositories())
rsconnect::deployApp(appFiles = c('app.R', "sce_nac_small.rds"),
appName = 'tran2020_NAc', a... |
0966e239949ca508f334baa98e672b0baac64ffddcbdb58dd8e5a175b3ae64cf | R | 364 | 7 | library('rsconnect')
load(here::here("shiny_apps", ".deploy_info.Rdata"))
rsconnect::setAccountInfo(name=deploy_info$name, token=deploy_info$token,
secret=deploy_info$secret)
options(repos = BiocManager::repositories())
rsconnect::deployApp(appFiles = c('app.R', "sce_sacc_small.rds"),
appName = 'tran2020_sACC',... |
a43f083449f4163742d17e3b542611be404a971ee256ae3d8acbbb1385600e86 | R | 364 | 7 | library('rsconnect')
load(here::here("shiny_apps", ".deploy_info.Rdata"))
rsconnect::setAccountInfo(name=deploy_info$name, token=deploy_info$token,
secret=deploy_info$secret)
options(repos = BiocManager::repositories())
rsconnect::deployApp(appFiles = c('app.R', "sce_amyg_small.rds"),
appName = 'tran2020_Amyg',... |
90f97a575a715aa7aba7126200fda1d4cc23f13c18a30668101d3caf92cfcd44 | R | 366 | 7 | library('rsconnect')
load(here::here("shiny_apps", ".deploy_info.Rdata"))
rsconnect::setAccountInfo(name=deploy_info$name, token=deploy_info$token,
secret=deploy_info$secret)
options(repos = BiocManager::repositories())
rsconnect::deployApp(appFiles = c('app.R', "sce_dlpfc_small.rds"),
appName = 'tran2020_DLPFC... |
02465076439cd5d80567b181110e77a1b8db8b150c81bdb4319deee532d06ee3 | R | 374 | 14 | # 1. primate brain result
# read_rds_files("data/results_rdata")
load("data/primateBrainData.RData")
# 2. mayo RNA-seq
load("data/mayoTEKRABber_balance.RData")
# 3. age inference
kznf_infer <- utils::read.csv("data/kznf_bucket.csv")
te_infer <- utils::read.csv("data/Dfam_TE_simiiformes.csv", row.names = 1)
library(d... |
7c6cc386baff0d56f566d97d399f0ad25962f8385a8735a6f929f22c067d0f84 | R | 375 | 24 | # ʶ±ðUCRËùÔÚµÄÍâÏÔ×Ó·¢»Óʲô¹¦ÄÜ
setwd(dir = "D:/R_project/UCR_project/")
rm(list = ls())
library(tidyverse)
library(ensembldb)
# ʹÓÃensDb()º¯ÊýÁ¬½Óµ½ENSEMBLÊý¾Ý¿â£¬²¢Ñ¡ÔñÏàÓ¦µÄÎïÖÖ
ensembl_db <- EnsDb("human") # Ìæ»»"species"ΪÄãËùÑо¿µÄÎïÖÖ£¬Èç"human"»ò"mouse"
|
c00bc396ac0df2fee065ca57a4e1997adc8a791e25f2d2b4ea396ac9bfe5d8a8 | R | 376 | 20 | library(aif360)
install_aif360()
load_aif360_lib()
dd <- aif360::binary_label_dataset(
data_path = system.file("extdata", "data.csv", package="aif360"),
favor_label=0,
unfavor_label=1,
unprivileged_protected_attribute=0,
privileged_protected_attribute=1,
target_column="income",
protected_attribute="s... |
d668702e0b75abb29ad483dcd59192b65e61bebecb0ee05eae4047df75771210 | R | 381 | 18 | # How many statistically coding UCR-related genes are associated with AS
setwd(dir = "D:/R_project/UCR_project/")
options(stringsAsFactors = FALSE)
rm(list = ls())
library(tidyverse)
library()
UCRs_from_PCGs <- read.table(
file = "02-analysis/16-New_classification/01-UCR_from_protein_coding_gene.bed")
length(uniqu... |
497b569325f74b748c43b3918341cb40580ff1fde8f6147721c1515ed5653b86 | R | 385 | 7 | library('rsconnect')
load(here::here("shiny_apps", ".deploy_info.Rdata"))
rsconnect::setAccountInfo(name=deploy_info$name, token=deploy_info$token,
secret=deploy_info$secret)
options(repos = BiocManager::repositories())
rsconnect::deployApp(appFiles = c('app.R', "sce_amy_small.rds", "cell_colors_amy.rds"),
appN... |
9eb162038fa09fb5b7ce7881c64e1ca703be5584fc7977896c2355373f0ef932 | R | 385 | 7 | library('rsconnect')
load(here::here("shiny_apps", ".deploy_info.Rdata"))
rsconnect::setAccountInfo(name=deploy_info$name, token=deploy_info$token,
secret=deploy_info$secret)
options(repos = BiocManager::repositories())
rsconnect::deployApp(appFiles = c('app.R', "sce_hpc_small.rds", "cell_colors_hpc.rds"),
appN... |
f79ebbce6d139cde13db8b7609a61b3cc15c86d73dec3baa79cc0eceb30effc4 | R | 385 | 7 | library('rsconnect')
load(here::here("shiny_apps", ".deploy_info.Rdata"))
rsconnect::setAccountInfo(name=deploy_info$name, token=deploy_info$token,
secret=deploy_info$secret)
options(repos = BiocManager::repositories())
rsconnect::deployApp(appFiles = c('app.R', "sce_nac_small.rds", "cell_colors_nac.rds"),
appN... |
a785d1165091e47c8080c6b46fbcbea7df17b0252c8f71004c50ee5efe501c08 | R | 388 | 7 | library('rsconnect')
load(here::here("shiny_apps", ".deploy_info.Rdata"))
rsconnect::setAccountInfo(name=deploy_info$name, token=deploy_info$token,
secret=deploy_info$secret)
options(repos = BiocManager::repositories())
rsconnect::deployApp(appFiles = c('app.R', "sce_sacc_small.rds", "cell_colors_sacc.rds"),
ap... |
22bd48f24c2ab2b7b53f20b4a49a3b23be5e067060b4243e0e7e7b3896c62c21 | R | 389 | 14 | fluidRow(
box(
title = "マップから見る発生・対応状況",
width = 12,
closable = F,
footer = tags$small(icon("lightbulb"), i18n$t("凡例クリックすると表示・非表示の切替ができます。")),
fluidRow(
column(
width = 6,
echarts4rOutput("onset_to_confirmed_map", height = "500px") %>% withSpinner()
)
)
)
) |
8fb151ba65c98a00ed74231ff1a1f8eac396496b6193a8e945e4c3b58b6e59aa | R | 390 | 20 |
#----------------------------------------------------------------- iSODA UI ----
isoda_ui = function(id){
ns = shiny::NS(id)
shiny::includeMarkdown("./man/isoda.md")
}
#------------------------------------------------------------- iSODA server ----
isoda_server = function(id, module_controler) {
shiny::modul... |
3eb47db720680198caa5321efa4388eabb08ea166a36d446a929a10280457856 | R | 391 | 7 | library('rsconnect')
load(here::here("shiny_apps", ".deploy_info.Rdata"))
rsconnect::setAccountInfo(name=deploy_info$name, token=deploy_info$token,
secret=deploy_info$secret)
options(repos = BiocManager::repositories())
rsconnect::deployApp(appFiles = c('app.R', "sce_dlpfc_small.rds", "cell_colors_dlpfc.rds"),
... |
a9762d383608d27d0cfccfe48580642042c966243f256ff1623471d6bd9f2b19 | R | 391 | 16 | args = commandArgs(TRUE)
infile = args[1]
threshold = as.numeric(args[2])
outfile = args[3]
require(ggplot2)
threshold
d = read.table(infile,header=F)
p <- ggplot(d,aes(x=log(V1))) +
geom_histogram(bins=100,aes(y=..count..)) +
#geom_density() +
geom_vline(xintercept=log(threshold),color="red",linetype=... |
9305398f8295e76b44bbe5a0f761dbe2435bca241902a2a4cc7990a837f4696a | R | 393 | 11 | require("ggplot2")
plotdots = function(d, name=paste("figure",date(),"pdf",sep=".") ) {qplot(1:length(d$V1),d$V1,geom=c("point","line"))+geom_hline(yintercept=0.3170793,color="red",linetype=2)+theme_classic()+xlab("removals")+ylab("delta diameter");ggsave(name,width=4.5,height=3.2);}
args = commandArgs(TRUE)
file = ... |
153627f828f630a36bc329baafe3dac1781e07bb46f6d25846458fc4cc52eb07 | R | 400 | 20 | #' Sort_major_minor
#'
#' Sorting and reordering table
#' @param data data
#' @param col1 col1
#' @param col2 col2
#' @export
#' @return None
Sort_major_minor <-
function(data, col1, col2) {
for (i in 1:dim(data)[1]) {
if (data[i ,col1] < data[i, col2]) {
save = data[i, col2]
data[i, col2] ... |
93556d109376a69d9a88aa2c9ae88231ea6ee45ef6035345f51a04983688f063 | R | 400 | 23 | #!/usr/bin/env R
# Use DESeq2 to do differential expression analysis of bulk RNAseq data.
library(DESeq2)
#----------
# set paths
#----------
save.dpath <- "Human_DLPFC_Deconvolution/processed-data/005_de-bulk"
load.dpath <- ""
# bulk rnaseq datasets
#-----
# load
#-----
#-----------
# parameters
#-----------
# va... |
09d7d4ae3adc1bfab478107d0921919785fe0cc480e8ec31cf73ab1eb9b5622f | R | 405 | 19 | args = commandArgs(TRUE)
datafile = args[1]
species = args[2]
genNum = as.numeric(args[3])
k = as.numeric(args[4])
data = read.table(datafile)
rep = scan("samples.txt")
d = c(data[data$V2==species,3],sample(rep,genNum-length(data[data$V2==species,1]),replace=TRUE))
#d = data[data$V2==species,3]
q = quantile(d)
IQR ... |
eb87ac5785800a7577f824088d5ae9f5f381c04034974bf69da67dbdeff1c8ed | R | 408 | 27 | #!/usr/bin/env R
#
# Transform Z matrix using bias corrections from Bisque.
#
library(SingleCellExperiment)
#----------
# set paths
#----------
save.dpath <- ""
load.dpath <- ""
# signature matrix
z.fpath <- file.path(load.dpath, "")
# bulk rnaseq data
# sce
#-----
# load
#-----
# signature matrix
#---------------... |
212af8871efe15fbf7e8ed2b45f8a2b944ab0a46264c19d03f6de64dfd04414e | R | 409 | 17 | Component.Notification <- function(status = "info", context = "") {
return(fluidRow(
box(
width = 12,
closable = T,
enable_label = T,
label_text = "New",
label_status = "warning",
solidHeader = T,
status = status,
title = tagList(icon("bullhorn"), i18n$t("お知らせ")),
... |
0463864d9310a3f36593412cbd4e84e2268502293ffed601790f70aee9342ff7 | R | 411 | 13 | #!/usr/bin/env Rscript
# Command line arguments
args = commandArgs(trailingOnly=TRUE)
input <- as.character(args[1:length(args)])
library(data.table)
df = read.delim(input[1], sep = "\t")
counts = as.data.table(df[!duplicated(df[["UID"]]),c(3, 13:ncol(df))])
mirna = counts[, lapply(.SD, sum), by = miRNA]
write.tabl... |
64441ae8ae84881515bffcd04ec02795a775eaeea90ced0bf8a5f2f82de4234a | R | 411 | 19 | args = commandArgs(TRUE)
datafile = args[1]
species = args[2]
genNum = as.numeric(args[3])
k = as.numeric(args[4])
data = read.table(datafile)
rep = scan("samples.first.txt")
d = c(data[data$V2==species,3],sample(rep,genNum-length(data[data$V2==species,1]),replace=TRUE))
#d = data[data$V2==species,3]
q = quantile(d... |
da58165f80f91a6634735ea7b02123e24370dffd65bcdc6ec4982fd5987e4633 | R | 416 | 7 | library('rsconnect')
load(here::here("shiny_apps", ".deploy_info.Rdata"))
rsconnect::setAccountInfo(name=deploy_info$name, token=deploy_info$token,
secret=deploy_info$secret)
options(repos = BiocManager::repositories())
rsconnect::deployApp(appFiles = c('app.R', "sce_{{regionlower}}_small.rds", "cell_colors_{{regio... |
8c0b0709944d132d84661615d166937e79edcddcf896d3826f192de338ae13eb | R | 425 | 15 | fluidRow(
box(
title = i18n$t("現在の感染状況"),
width = 6,
height = "550px",
icon = icon("現在の感染状況"),
sidebar = boxSidebar(
id = "CurrentBoxtableOfEachPrefecturesBoxSidebar",
width = 100,
icon = icon("info-circle"),
i18n$t("現在の感染状況")
),
echarts4rOutput("currentActive", ... |
1685f3357d5995c5de5bf24fa9e627cb936516dacb1d52b69fcede0c8dc42e37 | R | 426 | 19 |
#----------------------------------------------------------------- About UI ----
about_ui = function(id){
ns = shiny::NS(id)
shiny::includeMarkdown("./man/about.md")
}
#----------------------------------------------------------- About server ----
about_server = function(id, main_output) {
shiny::moduleServer(... |
a4436e0b77173834ded88c3a63c7315264f497a5f2b94594b7e27d06fdb96574 | R | 430 | 15 | ## Default repo
local({r <- getOption("repos")
r["CRAN"] <- "http://cran.r-project.org"
options(repos=r)
})
install.packages(c('ggplot2', 'dplyr', 'data.table', 'Rtsne', 'umap', 'lgr', 'rlist'))
if (!requireNamespace("devtools", quietly=TRUE))
install.packages("devtools")
devtools::install_github(... |
26327670f7083bce138c2cb86db98db6ae9a6bf78936e36e570ec0aeecee67a8 | R | 435 | 19 | # Function to download fetal whole brain atlas
#
# Function to download the seurat object containing fetal whole brain atlas
#
#' @param filename filename of downloaded seurat object
#'
#' @return seurat object of fetal whole brain atlas downloaded as filename
#'
#' @author John F. Ouyang
#'
#' @export
downloadWBref... |
897f92a4261beff982e239067666536c638b05e1bf7f325c0978c5d0d362dc6b | R | 435 | 19 | # Function to download fetal midbrain subatlas
#
# Function to download the seurat object containing fetal midbrain subatlas
#
#' @param filename filename of downloaded seurat object
#'
#' @return seurat object of fetal midbrain subatlas downloaded as filename
#'
#' @author John F. Ouyang
#'
#' @export
downloadMBref... |
9680734ec666558660113f6037c0971d7bc0118c16f3811c6a227115b7474a1d | R | 438 | 37 | # get the proportion of genes overlap with type I UCRs from different pathways
setwd(dir = "D:/R_project/UCR_project/")
options(stringsAsFactors = FALSE)
rm(list = ls())
library(tidyverse)
library(readxl)
GOResults <- read_xlsx(
path = "03-results/10-GO_enrichment_analysis/meatscape_coding_UCR_genes_GO/metascape_r... |
0afc58a89686d7ef3c657304bb9464aabbbabd5739b90e71fd6532f10f3e6ef5 | R | 449 | 14 | # Define the directory containing the R files
directory_path <- "path/to/your/Rscripts"
# List all files in the directory ending with .R
r_files <- list.files(path = directory_path, pattern = "\\.R$", full.names = TRUE)
# Remove the current script from the list if its path was determined
r_files <- r_files[basename(r... |
5824d6239cd5864b142e45abb46117fad2baf0d9d27a0356599832a6b9ad247e | R | 449 | 19 | source("Bootlier/bootlier.R")
args = commandArgs(TRUE)
datafile = args[1]
species = args[2]
genNum = as.numeric(args[3])
data = read.table(datafile)
d = c(data[data$V2==species,3],rep(1,genNum-length(data[data$V2==species,1])))
result = bootstrap.identify.outliers(d)
outliers=result$data.outlier.set
if (length(outl... |
3f77279b9778c87994269d9600aa5388fd111e262634ba2af47380e2e56b600d | R | 453 | 19 | # Color configuration
lightRed <- "#F56954"
middleRed <- "#DD4B39"
darkRed <- "#B03C2D"
lightYellow <- "#F8BF76"
middleYellow <- "#F39C11"
darkYellow <- "#DB8B0A"
lightGreen <- "#00A65A"
middleGreen <- "#01A65A"
darkGreen <- "#088448"
superDarkGreen <- "#046938"
superDarkGreen2 <- "#023D20"
lightNavy <- "#5A6E82"
midde... |
337073a2a7bb6ab6b3595228eb05cbb0fb2c5f961a01b928d1379cfa83670dde | R | 454 | 13 | load("data/primateBrainData.RData")
brain_meta <- data.frame(
region = sort(unique(metadata$brain_region))
)
brain_meta$cluster <- c("cluster1", "cluster1", rep("cluster2", 8),
"cluster3", "cluster1", rep("cluster3", 2),
rep("cluster4", 2), rep("cluster5", 6), "clus... |
3161851eaa2a7c2420863272a8b952b19b6ff8ebce63fd4a268d9372b3e4bdd7 | R | 462 | 12 | medfile=read.csv(file="C:/Users/federico.baldini/Downloads/lux_park.clinical (49).csv",header=T,fill = T)
idsel=read.csv(file="Y:/Microbiome/NDcollect/HQ/tablesBS/treshold19/finFiles/id_list_final.csv",header=T)
idsel=as.character(idsel[,1])
ind=vector()
for (i in 1:length(idsel)){
ind[i]=which(as.character(medfile... |
2b84b85dfd3f7893002cd87533912315d8571d39754e9ef54b8e1b2382b75802 | R | 464 | 16 | output$processSankey <- renderEcharts4r({
# maxValue <- max(processDataSpecific$value)
processDataSpecific() %>%
e_charts() %>%
e_sankey(source, target, value, focusNodeAdjacency = T) %>%
e_theme("essos") %>%
e_color(background = "#FFFFFF") %>%
e_grid(left = "1%") %>%
e_tooltip()
})
process... |
f18c3ccbce078fc7fdc0f88099113ba5f6154e0654be91cf4f27ac4bdea46bf9 | R | 465 | 18 | context("Comprehensive Test for Binary Dataset Creation")
test_that("running dataset test", {
dd <- aif360::binary_label_dataset(
data_path = system.file("extdata", "data.csv", package="aif360"),
favor_label=0,
unfavor_label=1,
unprivileged_protected_attribute=0,
privileged_protected_attribute=... |
ba8eb6259dc365f798f1c01c16118dcdf957465bc958b0fbbaaedb0c91ff7b1f | R | 468 | 20 | #threshold <- function(y,e=0.001,epsilon=10^-3) {x=y+epsilon;qlnorm(p=1-e, sdlog = sd(log(x)), meanlog = mean(log(x)))}
threshold <- function(y,e=0.05) {x=y[y>0];qlnorm(p=1-e, sdlog = sd(log(x)), meanlog = mean(log(x)))}
args = commandArgs(TRUE)
datafile = args[1]
e = as.numeric(args[2])
d = read.table(datafile)
t =... |
0b60e9a03060e9a3c8b01dea9232fd6ad0eeb45b30624c8c425eafd7d29aabf2 | R | 471 | 21 | UserListItemWrappter <- function(image = NULL,
href = NULL,
icon = NULL,
title = NULL,
subtitle = NULL) {
titleWrapper <- if (is.null(href)) {
title
} else {
tags$a(
href... |
a13f8937c3be3b752e121e946fd7df29cc2899487b25f48523f19f620608db30 | R | 471 | 31 |
# https://blog.csdn.net/qq_43210428/article/details/133563175
# R°ü°²×°ÃüÁî ------------------------------------------------------------------
install.packages("ggside",destdir = "¶þ½øÖưü´æ´¢Â·¾¶",lib = "D:/R/Rpkgs/R/win-library/4.2")
install.packages("ggside", lib = "D:/R/Rpkgs/R/win-library/4.2")
.libPaths("D:/R... |
a1db3c45643eccf7c269bc4141faf488177bc9f13065adfeb69a5f9cd843a68d | R | 475 | 5 | library(scImpute)
scimpute(count_path = "../data/francesconi/francesconi_withDropout.csv", infile = "csv", outfile = "csv", out_dir = "../data/francesconi/scimpute", Kcluster = 1)
scimpute(count_path = "../data/chu/chu_original.csv", infile = "csv", outfile = "csv", out_dir = "../data/chu/scimpute", Kcluster = 2)
... |
4bb15064247c6097a6ec8c84df5db246b887a2c4a8f8df6413ec33c3eff1fde0 | R | 480 | 19 | require(robustbase)
args = commandArgs(TRUE)
datafile = args[1]
species = args[2]
genNum = as.numeric(args[3])
k = as.numeric(args[4])
data = read.table(datafile)
s = scan("samples.txt")
d = log(c(data[data$V2==species,3],sample(s,genNum-length(data[data$V2==species,1]),replace=TRUE)))
#d = log(c(data[data$V2==speci... |
19dee7d294cb8ce7125e0eebbf1723c396c1dd1f6e3d06234646b70766eb5e35 | R | 483 | 21 | # Neocortical Localization and Thalamocortical Modulation of
# Neuronal Hyperexcitability contribute to Fragile X Syndrome
# Communication Biology
# Script Runfile
# Author: E. Pedapati
# Version: 3/27/2022
source("commbio_R_demographics.R")
rm(list = ls())
source("commbio_R_preprocessing.R")
rm(list = ... |
e3b9f87c94597caac2c39cd7affb91fa741d013f6e683aab6fab7ea86a98aaed | R | 483 | 12 | setwd("MERFISH_Moffit/")
library(Seurat)
Moffit <- Read10X("data/Moffit_RNA/GSE113576/")
Mo <- CreateSeuratObject(counts = Moffit, project = 'POR', min.cells = 10)
Mo <- NormalizeData(object = Mo)
Mo <- FindVariableFeatures(object = Mo, nfeatures = 2000)
Mo <- ScaleData(object = Mo)
Mo <- RunPCA(object = Mo,... |
384bbfe147374062827d802452b3ed2a69791ea7486d2423a36baf1eea867923 | R | 489 | 20 | fluidRow(
box(
title = tagList(
icon("table"),
i18n$t("各都道府県の状況")
),
width = 12,
sidebar = boxSidebar(
id = "tableOfEachPrefecturesBoxSidebar",
width = 25,
materialSwitch(
inputId = "tableGrouping",
label = tagList(icon("object-group"), i18n$t("グルーピング表示"... |
bb08ac5c3acd60c1e8d0002d9b6d7a3486d1153d4bdc97d6e9ccff3f5c3d7402 | R | 490 | 27 | # Siwei 28 Mar 2024
# plot Fig 4E
# init ####
library(readxl)
library(scales)
library(ggplot2)
library(RColorBrewer)
# load data ####
df_raw <-
read_excel("lysosomal_genes.xlsx",
sheet = 3)
df_2_plot <-
df_raw
ggplot(df_2_plot,
aes(x = risk_vs_nonrisk,
y = mouse_aging_LDAM)) +
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.