sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
1088ce3f12877f89307e6a0ff89353f5a612cca4ee745a5dd8cadaaa095a8fb6
R
628
19
#' Utility function to get the plotted values #' #' Get the plotted values from an output matrix if \code{return.value = T}. #' #' @param output The output from \code{plot_FRmatch()} or \code{plot_FRmatch()} if \code{return.value=T}. #' #' @return A data frame of row names, column names, and values. #' #' @seealso \co...
8069157a8f5b768a868ff3c376d16d756e51f6c50cd436f6ba670343f0464e44
R
630
23
rm(list = ls()) library(lme4) library(lmerTest) library(sjstats) library(psycho) # data preparation data = read.csv(file = "D:/Workspace/EEG_Data/data/neural_features.csv",fileEncoding="UTF-8-BOM") as.factor(data$parti) as.factor(data$task) as.factor(data$gender) trans_data = data trans_data$alpha = lo...
7afb3ff4aea303866ad0289bf023e9d4f9706729521c1cedddbed09e81be4d4f
R
637
23
#!/usr/bin/env Rscript library( "ANTsR" ) library("extremevalues" ) args<-commandArgs(TRUE) aslImg <- args[1] m0Img <- args[2] outname <- args[3] #init <- cbf_pasl_robust( asl_img, m0_img ) #cbf <- cbf_pasl_quantify( init$delta, init$m0 ) pasl <- antsImageRead( aslImg, 4 ) m0 <- antsImageRead( m0Img, 3 ) pasl.proce...
7c7978524bfebd7a0624a22c1ed594ffb3c29a323947a43715ef8207b3aeacab
R
659
21
# Extract Coefficients for different learning models from glm objects extractCoefficients_TP <- function(df){ unnest(df, cols = coef_TP) |> select(-c("statistic", "p.value")) |> pivot_wider(names_from = term, values_from = c("estimate", "std.error")) } extractCoefficients_IF <- function(df){ unnest(df,...
bc4e3a77556fddae4d9e4831644ed817af8c3c6826894cfa827f0c57f6423b22
R
684
13
library(EnsDb.Mmusculus.v79) library(GenomeInfoDb) annotations <- GetGRangesFromEnsDb(ensdb = EnsDb.Mmusculus.v79) annotations@seqnames@values=paste0('chr',annotations@seqnames@values) annotations@seqinfo@seqnames=paste0('chr',annotations@seqinfo@seqnames) annotations@seqinfo@genome=rep('mm10',length(annotations@seqin...
3140e5282b557335967fbf9aa10a251a35696fa314103186b23525f1ab5e7aa7
R
695
30
Pb_F <- function(SampleData){ Pb_vector <- rep(NA, 43) for (i in 1:nrow(SampleData)) { if(SampleData[i,5] == "E1" ){ Pb_vector[i] <- "control" } if(SampleData[i,5] == "E2") { Pb_vector[i] <- "control" } if(SampleData[i,5] == "E3" ){ Pb_vector[i] <- "control" } if(Sample...
589dd2622b66f2c89e0a283629da2ffb248d71109c8d9dc4eecd9164682f35c9
R
695
30
Zn_F <- function(SampleData){ Zn_vector <- rep(NA, 43) for (i in 1:nrow(SampleData)) { if(SampleData[i,5] == "E1" ){ Zn_vector[i] <- "control" } if(SampleData[i,5] == "E2") { Zn_vector[i] <- "treated" } if(SampleData[i,5] == "E3" ){ Zn_vector[i] <- "treated" } if(Sample...
c94d85bf7af4b268aa9b0dc57f77817e460d2b6867387586c7aba163dc4e1b87
R
695
30
FH_F <- function(SampleData){ FH_vector <- rep(NA, 43) for (i in 1:nrow(SampleData)) { if(SampleData[i,5] == "E1" ){ FH_vector[i] <- "control" } if(SampleData[i,5] == "E2") { FH_vector[i] <- "treated" } if(SampleData[i,5] == "E3" ){ FH_vector[i] <- "control" } if(Sample...
06d7c0986477ad81f58fe4cdcd0537f702c388e3a571ad7b98849861d87763ed
R
706
30
BPA_F <- function(SampleData){ BPA_vector <- rep(NA, 43) for (i in 1:nrow(SampleData)) { if(SampleData[i,5] == "E1" ){ BPA_vector[i] <- "control" } if(SampleData[i,5] == "E2") { BPA_vector[i] <- "control" } if(SampleData[i,5] == "E3" ){ BPA_vector[i] <- "treated" } if(S...
aa60a8df3a87ff9e063c2b13a36f9eec4bbdf526a1efbc622b7127987f64f192
R
706
30
Eth_F <- function(SampleData){ Eth_vector <- rep(NA, 43) for (i in 1:nrow(SampleData)) { if(SampleData[i,5] == "E1" ){ Eth_vector[i] <- "control" } if(SampleData[i,5] == "E2") { Eth_vector[i] <- "treated" } if(SampleData[i,5] == "E3" ){ Eth_vector[i] <- "control" } if(S...
b0ab02fdabc0965048e8a1ad7c1e60beee4836ce7810a1866c0c3c9a407f26b8
R
706
30
VPA_F <- function(SampleData){ VPA_vector <- rep(NA, 43) for (i in 1:nrow(SampleData)) { if(SampleData[i,5] == "E1" ){ VPA_vector[i] <- "control" } if(SampleData[i,5] == "E2") { VPA_vector[i] <- "control" } if(SampleData[i,5] == "E3" ){ VPA_vector[i] <- "treated" } if(S...
ddd678fdd20e9cc4ba94e22d48465149ab19ba061896670a22bd895a578409be
R
781
42
#/home/toolkit/tools/R4.2.0/bin/R #A=readRDS('compare_real.rds') A=readRDS('compare_real_scaleCicero.rds') B=readRDS('compare_random.rds') a=apply(A,2,median) b=apply(B,2,median) length(which(b<a[4]))/500 pdf('p11_compare_boxplot.pdf',width=4,height=5) boxplot(A,col=c(rep('grey60',4),rep('indianred1',2)),pch...
0ccd7bceebd88e506569c2d9c1608acf7674ba0a4b0d23b3e39eb33a9597d3db
R
864
41
# Functions: Probit regression for stimulus and respective learning model or # stimulus-only model # Transition Probability modelTP <- function(df) { glm(response ~ stimulus + TP, family = binomial(probit), data = df) } # Item Frequency modelIF <- function(df) { glm(response ~ stimulus + IF, fam...
e2c74a0d7b833cd3f0e32de2e00a2a4f1531591f2e11c7be2594c5d1c36d81a7
R
887
52
#/home/toolkit/tools/R4.2.0/bin/R library(Seurat) library(Signac) source('https://gitee.com/jumphone/BEER/raw/master/BEER.R') library(data.table) library(stringr) pbmc=readRDS('./eQTL/scAtlas_pbmc.rds') SNP_TSS=read.table('./eQTL/SNP_TSS_500k.bed.loop.txt',sep='\t',row.names=NULL,header=FALSE) SNP_TSS_TAG=SNP_TSS...
fb8067e150c2229f12d84bc34dacbe4041c55434e86b55c9d2d30619639cab95
R
898
36
context("Test linear algabra") ## .cor_vectors is correct test_that("(Code) .cor_vectors works with len is 0", { res <- .cor_vectors(c(1,0),c(0,0)) expect_true(is.na(res)) }) ###################### ## .angle_from_vector is correct test_that(".angle_from_vector works", { res <- .angle_from_vector(rep(1/sqrt(2...
e5be20cb92438916644d960f2f1af582cecb275998de7d398c0ef94e3892a245
R
932
30
# MARJAN BIRIA December 2022 # Hierarchical Linear Regression of spectroscopy data in OCD and HV groups, and three voxels: ACC, SMA, OCC # Box Cox transformation library(MASS) x = df$GABA b <- boxcox(lm(x ~ 1)) # Exact lambda lambda <- b$x[which.max(b$y)] lambda # = -0.1010101which is used in the next formula to tra...
53799232eb1a40a141ae6aaf8f0a651d68e831320ead5ebe87f0b936929496a3
R
940
41
#/home/toolkit/tools/R4.2.0/bin/R library(Seurat) library(stringr) library(data.table) LIST=read.table('LIST.txt',sep='\t') pbmc=readRDS('./eQTL/scAtlas_pbmc.rds') #ORGAN=t(matrix(unlist(str_split(colnames(pbmc),'_')),nrow=2))[,1] #TYPE=colnames(pbmc)#t(matrix(unlist(str_split(colnames(pbmc),'_')),nrow=2))[,2] ...
3d9ccd5a7d187e3a88ee848ca5f138d182de8025ae7f34f55021c727a6ca4cdf
R
950
28
test_that("pmQueryTotalCount rejects empty query", { result <- pmQueryTotalCount(query = "[Title/Abstract]", api_key = NULL) expect_equal(result$total_count, 0) expect_equal(result$query_translation, "Not valid search terms") }) test_that("pmQueryTotalCount rejects blank query", { result <- pmQueryTotalCount(q...
fbe80a0815f70a2c6e2837f9e1f9395202a07fa1bd215a5c59bcf4f4c5b6a37b
R
981
36
#!/usr/bin/Rscript # benchmarks df <- read.csv("./data/Petrovski_DatasetS1.csv", sep="\t", head=TRUE) omim <- subset(df, OMIM.Haploinsufficiency != "") omimd <- subset(df, OMIM.de.novo...Haploinsuficciency != "") mgil <- subset(df, MGI.Lethality.orthologs != "") mgis <- subset(df, MGI.Seizure.orthologs != ...
39740be3b03ecf036e88a92d1f6a5c2a8db3fd3334d7657e6a6b384477b9e5ac
R
996
73
# /home/toolkit/tools/R4.2.0/bin/R library(Signac) library(Seurat) library(GenomeInfoDb) #library(EnsDb.Hsapiens.v86) #hg38 library(EnsDb.Mmusculus.v79) library(ggplot2) library(patchwork) set.seed(1234) #############################################################i library(monocle) library(cicero) pbmc=readR...
641de6e8560971041a0e127014a212f8f5c3977814d4e2b6e873b918abccc594
R
1,006
21
# Shared setup for the PACNet web-app tests. Run from the repo root with: # Rscript -e 'testthat::test_dir("tests/testthat")' # Packages are attached by webApp/global.R, exactly as in the app. repo_root <- normalizePath(file.path(testthat::test_path(), "..", "..")) app_file <- function(f) file.path(repo_root, "webApp...
3247f77cf2f0bae7378d38dbb9421d5f59f8a236bca0e4759bfb92a2dec6127e
R
1,025
42
# Function to create a predictor for repetiton preference # Add a simple preference for repetition (0 == 0.4 | 1 == 0.6) library(tidyverse) # Add function to shift down vector n rows and replace with NA shiftdown <- function(x, n){ c(rep(NA, n), head(x, -n)) } CountRepetitionPreference <- function(df){ # Sto...
55da8417affd13e055fc843b340c9b2aa88132988b236355dcdce54ade664ef7
R
1,039
25
#' Plot minimum spanning tree (MST) #' #' This function is a wrapper function for plotting MST of two interested clusters. #' #' @param sce.query,sce.ref Query and reference data objects. #' @param query.cluster,ref.cluster Query and reference cluster names to plot. #' @param nsamp Number of randomly selected cells to...
1f76cf62e043628ab2ccf272b56ffd4ad50c302e32998991f016e60338e18aa1
R
1,040
43
# Functions: Probit regression with stimulus, intensity, and respective # learning model (interaction) # Transition Probability fullModelTP <- function(df) { glm(response ~ stimulus + intensity_ord * TP, family = binomial(probit), data = df) } # Item Frequency fullModelIF <- function(df) { glm(respons...
29aea771517638d99423bd3b5a43fa6336c77448f5c667ca5c284ec345692d8d
R
1,041
36
# Function for quantifying the conditional probabilities # Input: # - s: Binary sequence # - intensity: Stimulus intensities (optional, needs to be a factor) # Output: Function returns a dataframe containing the conditional probabilites library(tidyverse) # Function to shift down vector n rows and replace with...
24eaaff4a32d724b1548b0c0d0fdb4869b040f954d7b4a4fd55904ad8cab0696
R
1,043
54
#/home/toolkit/tools/R4.2.0/bin/R library(Seurat) library(Signac) source('https://gitee.com/jumphone/BEER/raw/master/BEER.R') library(data.table) library(stringr) pbmc=readRDS('./eQTL/scAtlas_pbmc.rds') SNP_TSS=read.table('./eQTL/SNP_TSS_500k.bed.loop.txt',sep='\t',row.names=NULL,header=FALSE) SNP_TSS_TAG=SNP_TSS...
ebc288efdbf026230bdd22aaa513ffbebd008ca78d4cea30da4ec939374ccb12
R
1,086
38
# /home/toolkit/tools/R4.2.0/bin/R library(Signac) library(GenomicRanges) library(Seurat) source('https://gitee.com/jumphone/BEER/raw/master/BEER.R') #args <- commandArgs(TRUE) #opath=args[1] pbmc.isloop=readRDS('./scATAC_pbmc.rds') CLST=readRDS(file='./scATAC_clst.rds') pbmc.isloop[['EXP']]=pbmc.isloop[['RNA']] De...
a9626fc80ba7ffd4e9b9661b3fe0627396dd57167ccae223607d9dca57ddc4de
R
1,092
27
library('biomaRt') library('DESeq2') library(readxl) library(openxlsx) setwd('/Volumes/aronow/Kang/induced_neuron/ChangHui_RNAseq_fastq/isoform_RSEM/rsem_transcripts/differential_v2_DEG/') # prepare gene / transcript metadata for conversion ensembl = useEnsembl(biomart = 'ensembl', dataset = 'hsapiens_gene_ensembl', ...
1c7550f24cff40ff56bbc7ccab1f2eb339e6889720b4a4e32912db4ceca0a676
R
1,101
29
##' Utility function to test whether there are any curves missing from specimens #' #' @export #' @param lm.tibble a tibble of landmark data #' @return just used inside of \code{import_chkpt_data} really check_curves <- function(lm.tibble,ncurves,filenames){ uniques <- lm.tibble %>% group_by(spec.id) %>% filter(cla...
63cb43ad20d754a16791d96846205c613a984431a6bfe4aafd786587328d6c90
R
1,108
34
library(ggplot2) library(dplyr) library(plyr) library(waffle) library(ggthemes) library(RColorBrewer) setwd(dirname(rstudioapi::getSourceEditorContext()$path)) mitoVGP <- read.csv("NOVOPlasty_results.tsv", header = TRUE, sep = "\t", na.strings="") mitoVGP$status <- revalue(mitoVGP$status, c("Out of memory!"="Memory ...
daf0aa0ef73791f1185c18cb3d87a025092d9169e8b89858a276661df47fc2e6
R
1,115
33
# Run the following script before this analysis: Code_for_Microinjection_Dataset.Rmd # Computing contribution of each condition (DMSO/EPZ)to proportion of cells in each cluster clust <- sce_hvg.seurat$seurat_clusters clust_pts <- data.frame(names=names(clust),cluster=clust) clust_pts$condition <- substr(clust_pts...
6d96f1112e31715020b000c0ef2fee4d2c04d1ee05a0cf9e902ae07b7cf02fbe
R
1,118
33
# Run the following script before this analysis: Code_for_Electroporation_Dataset.Rmd # Computing contribution of each condition (DMSO/EPZ)to proportion of cells in each cluster clust <- sce_hvg.seurat$seurat_clusters clust_pts <- data.frame(names=names(clust),cluster=clust) clust_pts$condition <- substr(clust_pt...
1cb4fa6a9d7702106e1c2d715a4365d404c9559361d98dc861360891e4918d31
R
1,135
25
#' #' Example data object #' #' This is an example of input data object for \code{\link[FRmatch]{FRmatch}}. #' The data object is of the \link[SingleCellExperiment]{SingleCellExperiment} class. #' #' @format #' Please follow the naming convention and data formats of this example when constructing your own data object. ...
697699ad9a752edf4ff89d81cc098ffabc4643be0e79617cdb7eba951786b81c
R
1,148
62
# Function: Log-Likelihood analysis for the three learning models # Functions for TP, IF, AF, and Stimulus-Only # Important notes: # (1) Because for all the other analyses, data is transformed # using qlogis(). For this analysis, we transform it back, using plogis() # (2) for loglike_Stim: Data is transformed ...
b1c6521365b51be3cf553083bbdacfbf69e1f4a3ccf97da8337c6c4419770913
R
1,152
31
#!/usr/bin/env Rscript library(readr) library(DESeq2) args <- commandArgs(trailingOnly = TRUE) df_counts <- read_csv(args[1]) sampleTable <- data.frame(condition = factor(sapply(strsplit(colnames(df_counts)[-c(1)], "_"), head, 1))) row.names(sampleTable) <- colnames(df_counts)[-c(1)] dds <- DESeqDataSetFromMatrix(as.d...
d455449f5f3e18a5d4fcc704cf23617cc22f62c4c221aaff7ff7c62de99d7473
R
1,153
20
library(Seurat) library(ggplot2) # combined = readRDS('/data/aronow/Kang/single_cell_projects/10X-Pak/integration/patient_derived_engineered/v2_filtered/combined_all_organoids_filtered.rds') # DimPlot(combined, group.by = 'integrated_snn_res.2', raster = F, label = T) + theme(legend.position = 'none') # QC of donors ...
f2e84499c5d5008c98c55174dea8feeb8896029d126baeeffa6f33a09db61cea
R
1,162
30
# This function collates the CSV files for each individual vision ROI for each # subject (PRL, URL, LPZ) into a single csv file. This also adds mean thickness # for each subject and calculates normalized thickness for each vertex as well # Load libraries library(janitor) library(tidyverse) # read in the individual vi...
635f31fdc79d915c3968d1e2f7d3e1ed365e10c54f8bafdbb13e2d6769809732
R
1,164
35
# Loaded once before ui.R and server.R (locally and under Shinylive). suppressPackageStartupMessages({ library(shiny) library(shinythemes) library(shinycssloaders) library(shinyWidgets) library(shinyjs) library(shinyalert) library(shinybusy) library(ggplot2) library(gridExtra) library(RColorBrewer) ...
ed51209abbe605e1e77154fc33423fe555362f580ad0472c75c52b7052b576c0
R
1,168
39
--- title: "SplicingEnrichmentPlot" author: "Marika Oksanen" date: "4/5/2022" output: html_document --- Import data, filter and order by enrichment ```{r} GOBP <- read.delim("enrichment_results_wg_BPA.txt") GOBP <- GOBP[(GOBP$FDR < 0.05),] GOBP <- GOBP[order(GOBP$enrichmentRatio, decreasing = TRUE),] GOBP$description <...
b6912251618c8895385c93f42f5f401014aa5a87d4fe4c12e970505ecb906e23
R
1,172
33
# This function collates the CSV files for each individual vision ROI for each # subject (PRL, URL, LPZ) into a single csv file. This also adds mean thickness # for each subject and calculates normalized thickness for each vertex as well # Load libraries library(janitor) library(tidyverse) # read in the individual vi...
2502efe5edb464b53690b1e4f5dd31d5efd002246959873464e217c6366712f6
R
1,175
22
# set your working directory studydir <- paste0("Desktop/Reference genomes/Reference gene files/") # import gtf Human_gene <- rtracklayer::import('Desktop/Reference genomes/Reference gene files/human_genes.gtf') Human_gene_df=as.data.frame(Human_gene) marmoset_gene <- rtracklayer::import('Desktop/Reference genomes/Re...
ae6c4f395f201642f573d7fd287d27c437f93b663712914ddc4f9f41de33cae5
R
1,200
24
###The following script was used to test if the proportion of the cells in each cell states/clusters was different between the control and Atoh1S193A animals #Import package library(speckle) library(limma) #Run test propeller(clusters = obj$cell.type, sample = obj$ID, group = obj$genotypes) #Plot the compositio...
3d86a9fee2481a6d29486834eb9f3e283c9d12be63116487433fe1dbe43b5a3b
R
1,207
33
# Save human data as Seurat library(dplyr) library(Seurat) library(SeuratDisk) source("./src/preprocessing_utils.R") # function recode_genes & save dirs datadir <- "./data/raw/bakken/" nrows = -1 metadata <- read.csv(paste0(datadir, "metadata.csv"), header = TRUE, sep=',', nrows = nrows) counts ...
6b7fdee24f3a279537aaff36856cecd7c156a49596952bcd44f6289f16b3a949
R
1,207
45
#!/usr/bin/env Rscript # # Copyright © 2017 Charles E. Vejnar # # Use of this source code is governed by an MIT-style license that can be # found in the LICENSE file or at https://opensource.org/licenses/MIT. # library('DESeq2') args = commandArgs(trailingOnly = TRUE) path_count = args[1] path_condition = args[2] pa...
a763bcf752db5f4db9ac5d5d1125e9005db01048bbd430fb6a6797b54995b66a
R
1,221
69
#/home/toolkit/tools/R4.2.0/bin/R library(Seurat) library(Signac) source('https://gitee.com/jumphone/BEER/raw/master/BEER.R') library(data.table) library(stringr) pbmc=readRDS('./eQTL/scAtlas_pbmc.rds') SNP_TSS=read.table('./eQTL/SNP_TSS_500k.bed.loop.txt',sep='\t',row.names=NULL,header=FALSE) SNP_TSS_TAG=SNP_TSS...
d8065e4c0976c4d64ee7b21c9f652fcc2124f167321ab669148656775d4962eb
R
1,230
72
#/home/toolkit/tools/R4.2.0/bin/R library(Seurat) library(Signac) source('https://gitee.com/jumphone/BEER/raw/master/BEER.R') LIST=read.table('LIST.txt',sep='\t') MAT=c() i=1 while(i<=nrow(LIST)){ this_name=LIST[i,1] this_file=paste0('/home/disk/database/data/scATAC_ATLAS/raw/FRAG/',this_name,'.format/m...
74471cfb6147e3a95e9fd344d0f6bd0f2ed2c39da62936e18c70d55a02a66b22
R
1,243
23
# This plots the MEAN SuperLearner coefficients values for each algorithm used in the SL.library # across the total runs (i.e., M for the TRAINING step, ~50-100 for the VALIDATION step) barplot(colMeans(m_validation)) barplot(colMeans(m_training)) # This plots the MEDIAN SuperLearner coefficient values for each algorit...
b0147c0d2c71a25031f427fd484b418ea6f7ee519041fca8d2b2b306c5223ba3
R
1,250
72
# /home/toolkit/tools/R4.2.0/bin/R p p p p p library(Signac) library(GenomicRanges) library(Seurat) source('https://gitee.com/jumphone/BEER/raw/master/BEER.R') .getRNA<-function(pred.ref){ #pred.ref=readRDS('./ics_out/COM_pred.ref_r0.rds') LOOP2GENE=read.table("./RNA/LoopAndTSS.bed",header=F,sep='\t',row.names=NU...
d15d5ee176de3503bbd213ade0b03aa385b4b16d2aaccd543f5a59598822f3bc
R
1,277
36
### conduct age regression model for all davi regions ### ### print out signifiant regions ### library("dplyr") library("readr") library("tidyr") library("lsr") library("broom") library("reshape2") # read in Davi ROI data # # data is a csv file with cols - Name, Age, Sex, Scanner, TIV & davi region acron...
2ba560e62a917331343539bcf2f4684d7b5085a5ed2a786029c2982dee8c6983
R
1,318
34
# Add Factor Significance to respective dataframe addSignificance_TP <- function(x){ x <- x |> mutate(Significance = ifelse(estimate_TP < low_quantile_TP | estimate_TP > high_quantile_TP, "significant", "non-significant"), Significa...
efce129fc0d226cd749276cd5d5a8024b3a7016b54d87e511421a105cbb05155
R
1,318
42
#!/usr/bin/env Rscript args = commandArgs(trailingOnly=TRUE) label=as.array(args[1]) workspace_directory=as.array(args[2]) filename_specs <- file.path(workspace_directory,paste0(label,"_info.RData")) #filename_specs <- file.path(workspace_directory,paste0("_validation_info.RData")) print(filename_specs) load(filename...
38cc612eeff8e28ce0819ac4ac53b2f6a45fb1448739616cf6d3c48cb71cd109
R
1,322
45
library("devtools") install_github("Danko-Lab/BayesPrism/BayesPrism") suppressWarnings(library(BayesPrism)) setwd("/content") dataset_zip = 'more_than_50_dummy' unzip(paste(dataset_zip, 'zip', sep='.')) main_dir = paste("/content/", dataset_zip, sep="") setwd(main_dir) folders <- as.vector(list.dirs()) folders <- gr...
55896cf8f0c61a5dd568d9296eaa92210f6abe8373d6e429271d29c6ba30e6df
R
1,335
42
# Save raw bird data as Seurat library(dplyr) library(Seurat) library(SeuratDisk) source("./src/preprocessing_utils.R") # function recode_genes datadir <- "./data/raw/tosches/" species_list <- c("turtle", "lizard") for (species in species_list){ # Load data load(paste0(datadir, paste0(species, ".neurons.Robj")...
23f5acd12c5dcb97680bf092582b4f85aab849ebe4907a9ff474aed4c07dc3fc
R
1,338
40
# /home/toolkit/tools/R4.2.0/bin/R library(Signac) library(GenomicRanges) library(Seurat) source('https://gitee.com/jumphone/BEER/raw/master/BEER.R') #args <- commandArgs(TRUE) #opath=args[1] pbmc.isloop=readRDS('/home/disk/database/data/scHIC/Blood/analysis/scATAC_pbmc.rds') #pbmc.isloop$type[which(pbmc.isloop$seura...
cfff3ee2028af3dca7aabca953d4370817b9d155f863543f7093df04d8a0b502
R
1,352
32
library('biomaRt') library('DESeq2') library(readxl) library(openxlsx) setwd('/Volumes/aronow/Kang/induced_neuron/ChangHui_RNAseq_fastq/isoform_RSEM/rsem_transcripts/differential_v2/') # prepare gene / transcript metadata for conversion ensembl = useEnsembl(biomart = 'ensembl', dataset = 'hsapiens_gene_ensembl', mirr...
7e32f52244900bf2dd71ca3b638962344a4b85aa4f1fc25c8fe02fd96bd1807b
R
1,402
36
# Install missing libraries required_packages <- c("ggplot2", "msa", "ggmsa") missing_packages <- required_packages[!(list.of.packages %in% installed.packages()[,"Package"])] if(length(missing_packages) > 0) { install.packages(missing_packages) } # Load them library(msa) # Alignment library(ggmsa) # Alignment viewer ...
d1802fa9c6a688f8c6a1761256cc67fa6bab4d7b0b0073cd78877a7c111369f8
R
1,402
15
########Outlier function: (I need to work out how to save function files then just call them whenever I want) outlierSummary<-function(variable, digits = 2){zvariable<-(variable-mean(variable, na.rm = TRUE))/sd(variable, na.rm = TRUE) outlier95<-abs(zvariable) >= 1.96 ...
5d78d0561cc36aef4bfab89998762661570c628c2002c8556b490154020141db
R
1,403
38
# Reference data access for the PACNet web app. # # Native R (runApp / runGitHub): files are read from ../data relative to the # app directory (option pacnet.data_dir overrides). # webR (Shinylive, in the browser): files are downloaded from the data/ # directory next to the exported site, once per session, then read. ...
cf7ff642028e3d02bb96a664a8f96b509948ecc28265fbbe1ef43249a8512523
R
1,416
40
#' @title #' CBDA Initialization function for Compressive Big Data Analytics #' #' @description #' This CBDA function installs and attaches all the packages needed to run the CBDA. #' A user-defined list of packages can be passed as argument. Itis recommended to first execute #' the function without any arguments. #...
c473cd2822b252986f6df9d67bcca2f9cebff8d3fc8c8e86cb6fc297a71f6eaf
R
1,430
58
# /home/toolkit/tools/R4.2.0/bin/R library(Signac) library(GenomicRanges) library(Seurat) source('https://gitee.com/jumphone/BEER/raw/master/BEER.R') #args <- commandArgs(TRUE) #opath=args[1] pbmc.isloop=readRDS('./scATAC_pbmc.rds') #pbmc.isloop$type[which(pbmc.isloop$seurat_clusters %in% c(9))]='Unclear' CLST=readRD...
10a14f5e5674522e82ddaf14d41ca520ce7f9d893888af6fe03e735688bb8c70
R
1,441
51
#/home/toolkit/tools/R4.2.0/bin/Rscript #/home/toolkit/tools/R4.2.0/bin/R source('https://gitee.com/jumphone/VISA/raw/master/VISA.R') mat=read.table('signal_mat.txt', sep='\t', row.names=1, header=TRUE,check.names=FALSE) a=t(mat)[,1] b=t(mat)[,2] type=readRDS('signal_type.rds') setwd('/home/disk/database/data/ICS...
f9d273c8dd03d49f4dd01e71a36b25eb38dc6e2fee7a68fe3c0a42412469fcb6
R
1,449
56
--- output: github_document --- <!-- README.md is generated from README.Rmd. Please edit that file --> ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" ) ``` # SURGE <!-- badges: start --> <!-- badges: end --> The SURGE pac...
1b4f9f566e3e04530621a8179b412feda91c1c4e650ff25c51ad4c39368e30cb
R
1,456
40
#' @title #' CBDA Initialization function for Compressive Big Data Analytics #' #' @description #' This CBDA function installs and attaches all the packages needed to run the CBDA. #' A user-defined list of packages can be passed as argument. Itis recommended to first execute #' the function without any argume...
aebb16bff4d3eb05f9b7c969fb35ed6518c21aebac04afcd87187a9ec67c0420
R
1,462
48
# /home/toolkit/tools/R4.2.0/bin/R library(Signac) library(GenomicRanges) library(Seurat) #args <- commandArgs(TRUE) #opath=args[1] .single=function(TAG){ d1=read.table(paste0('./coolCount_',TAG,'/Astro.coolCount.txt'),sep='\t',header=FALSE,row.names=NULL) d2=read.table(paste0('./coolCount_',TAG,'/Neuron.Ex.coolCou...
177f766468e9005a5d39aab3100981aa104de3f7cb7074f6351f79109c973dbc
R
1,476
64
--- title: "Contact us" # author: # - name: Xiaotao Shen PhD (https://www.shenxt.info/) # - affiliation: School of Medicine, Stanford University date: "Created on 2021-02-28 and updated on `r Sys.Date()`" output: html_document: df_print: paged toc: false pdf_document: toc: false pkgdown: as_is: false ...
c91d186cf344e8728dbb0c6899dd44284e0a71e6f7b865edc988873633bf81b6
R
1,478
40
# Save raw bird data as Seurat library(dplyr) library(Seurat) library(SeuratDisk) source("./src/preprocessing_utils.R") # function recode_genes & save dirs datadir <- "./data/raw/tasic/" # The files to load filename <- "mouse_VISp_2018-06-14_exon-matrix.csv" filename.meta <- "mouse_VISp_2018-06-14_samples-columns.csv"...
510258e5fd88abf9758abdcd7e5704a6b8cd3f064ae096868eaa6bc12a8a5880
R
1,485
20
# Small UI helpers shared by ui.R and server.R (renderUI inputs). # Input label followed by an info icon that shows `tip` on hover or focus. label_tip <- function(label, tip) { tags$span( label, bslib::tooltip( tags$span(shiny::icon("circle-info"), class = "text-muted ms-1", tabindex = "0"), tip,...
5bf345e25427c3554f4403ed2e7552056dd18eb5566466057f9ea095449d1be1
R
1,491
51
test_that("pmApi2df handles empty data", { P <- list(data = list()) result <- pmApi2df(P) expect_true(is.data.frame(result)) expect_equal(nrow(result), 0) }) test_that("pmApi2df output has expected columns in bibliometrix format", { skip_on_cran() skip_if_offline() skip_if_not( nzchar(Sys.getenv("PUB...
86a8632dd280d4f28741f5e56fb17a3a3cdac11d934bb156868e95833f400340
R
1,493
96
library(Signac) library(GenomicRanges) library(Seurat) source('https://gitee.com/jumphone/BEER/raw/master/BEER.R') #args <- commandArgs(TRUE) #opath=args[1] pbmc=readRDS('./scATAC_pbmc.rds') #pbmc.isloop$type[which(pbmc.isloop$seurat_clusters %in% c(9))]='Unclear' #pbmc$type=readRDS('/home/disk/database/data/scHIC/Bl...
94cd20abcb50139252b9d05ec6f2d4f295d4a153f442d18fd6ca371ac67de543
R
1,494
36
context("Test .compute_unnormalized_scores") ## .compute_unnormalized_scores is correct test_that("(Math) .compute_unnormalized_scores computes the correct scores", { trials <- 20 bool_vec <- sapply(1:trials, function(x){ set.seed(x) n <- 150; K <- 2 common_space <- scale(MASS::mvrnorm(n = n, mu = ...
f2292895d2789a4f994fac012d0727184557ea4cbb6b31e2fbcc8467a703a068
R
1,497
42
require(remotes) system("apt install libgsl-dev", intern=TRUE) install.packages("topicmodels") remotes::install_github('JEFworks-Lab/STdeconvolve') library(STdeconvolve) my_working_dir = '/content' setwd("/content") dataset_zip = 'dense' unzip(paste(dataset_zip, 'zip', sep='.')) main_dir = paste("/content/", dataset_...
49ac643f7718c16009a72ebcc71666f08bd811112e5ef07f7b75111c61fb312b
R
1,512
35
library(Seurat) library(ggplot2) # donor donor = readRDS('donor_reintegrated.rds') # make 3d umap original_umap = donor@reductions$UMAP@cell.embeddings donor = RunUMAP(donor, reduction = 'pca', dims = 1:30, n.components = 3, reduction.name = 'UMAP_3d') df_meta = donor@meta.data df_umap = donor@reductions$UMAP_3d@cel...
0d60c11d3d1c7fe1601a2125cfeac65ecd5434203a32c56c3cae0e0738b4d3b2
R
1,520
44
args<-commandArgs(TRUE) out_name=paste("mash.", args[[1]], ".png", sep="") png(out_name, res=300, width=9.6, height=9.6, units="in", pointsize=8, type="cairo", bg="white") par(mar=c(3.2,3.2,0,0)) par(mgp=c(2.2,1,0)) # get names key=read.table("key") labels=key[,1] # make dendrogram x = read.table("combined.tbl") y=x...
38d86a99a4f45f0583a03e168a81bf89b26bda2141497133b5f419580ef740ce
R
1,523
43
# Load and Clean Data library(readxl) fp<-file.path dp<-"data/original" dreadds<-read.csv(fp(dp,"cfos_dreadds_behavior.csv"), header=TRUE, na.strings=c("NA","N.A.","<NA>")) clearmap<-read.csv(fp(dp,"cfos_imaging_and_clearmap_params_20201125.csv"), header=TRUE) counts122<-as.data.frame(read_excel(fp(dp,"cfos_total_and...
42d88db5243f8d045d6bd539f3e5375490619cce81c596864fc5f0a1b58372b5
R
1,524
70
--- title: "SiT - Figures" author: '[Kevin Lebrigand](mailto:lebrigand@ipmc.cnrs.fr)§, Joseph Bergenstråhle §, Kim Thrane §, Annelie Mollbrink, Pascal Barbry, Rainer Waldmann and Joakim Lundeberg' date: 'Compiled: `r format(Sys.Date(), "%B %d, %Y")`' abstract: 'The spatial landscape of gene expression isoforms in tissu...
501c9a410e8345913ce7f9c6241ec076117decede73f8057a874cc175b40bbda
R
1,530
23
getBackgroundReads = function(snap_obj, clusters, snap_file, peak_file, bin_size, genome_file,sample_prefix, output_folder, path_to_bgreads){ genome=read.table(genome_file, stringsAsFactors = FALSE) chr_size=genome[,2] names(chr_size)=as.character(genome[,1]) tiles=tileGenome(seqlengths=chr_size, tilewidth=bin_...
6bed5f7a00c7fa38ba46bf606770a510d24640d81f09fb34f1d27588b65c6e59
R
1,531
75
# /home/toolkit/tools/R4.2.0/bin/R library(Signac) library(GenomicRanges) library(Seurat) source('https://gitee.com/jumphone/BEER/raw/master/BEER.R') pbmc=readRDS('./scATAC_pbmc_final.rds') #pbmc.isloop$type[which(pbmc.isloop$seurat_clusters %in% c(9))]='Unclear' pbmc$type=readRDS('./scATAC_type.rds') library(data...
5be2fed844b954f3bf540bcd85646663762bddaae7978a1b103b0e03cd82ae86
R
1,535
59
#' Forestplot Theme #' #' A custom theme used in \code{\link{forestplot}} that builts upon #' \link[ggplot2]{theme_minimal}. #' #' @inheritParams ggplot2::theme_minimal #' @import ggplot2 #' @importFrom grid unit.c #' @export #' @author Maria Kalimeri #' @seealso \code{\link{forestplot}}, \code{\link{geom_effect}}, \co...
f5ecc071678fc6901847f499100b1284ea9889d06e3ecf2834e26688b226b3a7
R
1,545
57
# /home/toolkit/tools/R4.2.0/bin/R library(Signac) library(GenomicRanges) library(Seurat) source('https://gitee.com/jumphone/BEER/raw/master/BEER.R') #args <- commandArgs(TRUE) #opath=args[1] pbmc.isloop=readRDS('/home/disk/database/data/scHIC/GSE130711_analysis/scATAC_pbmc.rds') pbmc.isloop$type[which(pbmc.isloop$se...
96d973a3d9cb0d379d65cd61fb65ebde2b4638f01cc95757490d044ada7a8a79
R
1,554
46
# This function collates csv files containing cortical thickness values of each # vertex in V1 for each participant into a single csv file. This also adds mean # thickness for each subject and calculates normalized thickness for each vertex # as well # Load libraries library(janitor) library(freesurferformats) library...
cd4a70bf9d679a00661c8f7ec44f87f03b263f6b2f4f30dd8e99320f0978aeb5
R
1,559
51
library(rstatix) # for visualization library(ggpubr) library(ggplot2) dat <- read.table('../Output/Logratio_fraction_in_behavior_controls.txt', header = TRUE, sep = ",") # preprocess data dat$group <- as.factor(dat$group) dat$mouse <- as.factor(dat$mouse) dat$behavior <- as.factor(dat$behavior) # visualize the data...
5249c178f2c97ef13e1319a9b23e8674b8c1263c52da9d94b91ec79a8464156f
R
1,560
34
# Save raw bird data as Seurat library(dplyr) library(Seurat) library(SeuratDisk) rm(list=ls()) source("./src/preprocessing_utils.R") # function recode_genes & save dirs datadir <- "./data/raw/colquitt/" # Load the data: single csv with meta data and counts counts_and_metadata <- read.table(paste0(datadir, "HVC_RA_RNA...
99dd75d0ac909c4b9c5cfadb4dfd2820513490e78886b833fde62191b1ceff40
R
1,576
57
--- title: "Compare effect sizes of different c-Fos contrasts" author: "Will Townes" output: html_document --- ```{r} library(tidyverse); theme_set(theme_bw()) fp<-file.path mkdir_p<-function(x){ if(!dir.exists(x)){dir.create(x,recursive=TRUE)} } rp<-fp("results/bwas") mkdir_p(rp) source("utils.R") ``` data loadi...
895dc85a5f1678e73dbc040ae2211d3b9b4a0742b308de94d456e42bc5cf31bc
R
1,581
96
library(Signac) library(GenomicRanges) library(Seurat) source('https://gitee.com/jumphone/BEER/raw/master/BEER.R') #args <- commandArgs(TRUE) #opath=args[1] pbmc=readRDS('/home/disk/database/data/scHIC/Blood/analysis/scATAC_pbmc.rds') #pbmc.isloop$type[which(pbmc.isloop$seurat_clusters %in% c(9))]='Unclear' pbmc$type...
f9d3e42b9dcf5f9286d1b2240aa4d12fe4286b6de19db986c7b0d2cd6cfb0f21
R
1,594
36
test_that("cnlib has no parallel or snow code paths", { src <- readLines(app_file("cnlib.R")) expect_false(any(grepl("detectCores|snow::", src))) }) test_that("quick-pairs scoring gives the same pairs whether or not it is sliced", { set.seed(1) genes <- paste0("g", 1:30) expDat <- matrix(rexp(30 * 40), nrow ...
61e96eeac85c7325202042c72572769729f7b36d1f7c64ae84e0cf8659d0a0d8
R
1,606
38
library(tximport) library(DESeq2) library(stringr) library(openxlsx) setwd('/data/aronow/Kang/induced_neuron/ChangHui_RNAseq_fastq/isoform_RSEM/rsem_transcripts/differential_v2') source_folder = '/data/aronow/Kang/induced_neuron/ChangHui_RNAseq_fastq/isoform_RSEM/rsem_transcripts/transcripts/' # load data df_samples ...
4b7ed79a56881e4916b1dda6a97bb8ecba378211fa14b81937a7089e475e6ac7
R
1,623
70
# Observer Model (Item Frequency) - 2022 library(tidyverse) # Add function to shift down vector n rows and replace with NA shiftdown <- function(x, n){ c(rep(NA, n), head(x, -n)) } # Main function CountEventBernoulli <- function(s, omega = Inf){ # Store input sequence in dataframe df <- enframe(s, name = "t...
c3d8c299781089f988a7fa97171f8223504a514605d341b386ff6ba58bd00595
R
1,623
40
#' @title #' CBDA Clean up function for Compressive Big Data Analytics #' #' @description #' This CBDA cleans the current directory where all the intermediate workspaces have been created. #' @param label This is the label appended to RData workspaces generated within the CBDA calls #' @param workspace_directory Dir...
36a3ca29dc84a4249e1f25fc949b66d8cde8cdfadfc4a5ca1f994d57ae35ed41
R
1,641
45
# Multiple plot function # # ggplot objects can be passed in ..., or to plotlist (as a list of ggplot objects) # - cols: Number of columns in layout # - layout: A matrix specifying the layout. If present, 'cols' is ignored. # # If the layout is something like matrix(c(1,2,3,3), nrow=2, byrow=TRUE), # then plot 1 will...
34bd7d8df9111c6c0b0493529e6807190d65957c343e326a4161513df234ea06
R
1,663
40
#' @title #' CBDA Clean up function for Compressive Big Data Analytics #' #' @description #' This CBDA cleans the current directory where all the intermediate workspaces have been created. #' @param label This is the label appended to RData workspaces generated within the CBDA calls #' @param workspace_direc...
0b51be77b3ec9a1736aa2bb7b0e90250691ec4b5f61d7fd159995203ddf5bd69
R
1,674
74
# /home/toolkit/tools/R4.2.0/bin/R library(Signac) library(Seurat) library(GenomeInfoDb) #library(EnsDb.Hsapiens.v86) #hg38 library(EnsDb.Mmusculus.v79) library(ggplot2) library(patchwork) set.seed(1234) pbmc=readRDS('scATAC_pbmc.rds') image=Read10X_Image('/home/disk/database/data/ICS_scHIC/fxx_spatial/download/G...
b306daadf74c685936862551682f3d7b46da3be4c0b6b0ef282bcc66142c08f4
R
1,681
59
# /home/toolkit/tools/R4.2.0/bin/R library(Signac) library(GenomicRanges) library(Seurat) source('https://gitee.com/jumphone/BEER/raw/master/BEER.R') #args <- commandArgs(TRUE) #opath=args[1] pbmc.isloop=readRDS('/home/disk/database/data/scHIC/Blood/analysis/scATAC_pbmc.rds') #pbmc.isloop$type[which(pbmc.isloop$seura...
9f36c26f559c5c521f58f9ad8652a670d463cf125de87d2835aefa407a1ea11b
R
1,696
41
library(Seurat) library(ggplot2) source('../functions/_global.R') source('../functions/_visualize.R') # load data organoid = readRDS('../../../v2_filtered/combined_all_organoids_filtered_v3.rds') organoid = organoid[, organoid$cellclass_draft_v2 %in% cellclass_ordered_v2] organoid$cellclass_draft_v2 = factor(organoid...
1931c4e21f96f2dd200e322c87f899f9001f3ef320dce81c862dac74a74c3e22
R
1,697
40
panel <- c("heart", "hspc", "intestine_colon", "liver", "lung", "neuron", "skeletal_muscle") other <- c("esc", "endothelial_cell", "fibroblast", "kidney", "b_cell", "t_cell", "monocyte_macrophage") data_dir <- file.path(repo_root, "data") rd <- function(name) readRDS(file.path(data_dir, name)) test_that("all expected ...
a43cc33ff82d31ed56db25fe9d3c9d03e26ec34dd244592197ceaeee325e054c
R
1,707
68
--- title: "SiT - Supplementary Figure 09" author: '[Kevin Lebrigand](mailto:lebrigand@ipmc.cnrs.fr)§, Joseph Bergenstråhle §, Kim Thrane §, Annelie Mollbrink, Pascal Barbry, Rainer Waldmann and Joakim Lundeberg' date: 'Compiled: `r format(Sys.Date(), "%B %d, %Y")`' abstract: 'The spatial landscape of gene expression i...
e858d1a2bf35fee38593b11b3067ca0cfc6f9c679761a8a3b35010a95c8b1f5c
R
1,709
43
context("Test consensus PCA") ## consensus_pca is correct test_that("consensus_pca works", { # load("tests/assets/test_data4.RData") load("../assets/test_data4.RData") mat_1 <- test_data$mat_1 mat_2 <- test_data$mat_2 res <- consensus_pca(mat_1 = mat_1, mat_2 = mat_2, dims_1 = 1:2,...
c1f4ed27d0a1758c24114f70c736b6d7daba12074aad46b3903252922f7f9293
R
1,710
60
test_that("list2char flattens nested lists correctly", { x <- list(a = list(b = "hello", c = "world"), d = "foo") result <- pubmedR:::list2char(x) expect_type(result, "character") expect_true(length(result) == 3) expect_equal(unname(result[1]), "hello") }) test_that("get_api_key returns explicit key first", ...
c0850b5392b24e3df5fb04f133649a93adc055fb2e73c8950031f9a4c3293665
R
1,713
79
--- title: "MetNormalizer" author: - name: Xiaotao Shen (https://www.shenxt.info/) - affiliation: School of Medicine, Stanford University url: http://shenxt.info/ date: "`r Sys.Date()`" output: html_document: df_print: paged toc: no pdf_document: toc: no vignette: "%\\VignetteIndexEntry{Vignette Title...
f7e8adee3b855c9df45d328907f39c2d2de13f91bf295b3f8e94f44b09db65ea
R
1,718
71
--- title: "SiT - Figures" author: '[Kevin Lebrigand](mailto:lebrigand@ipmc.cnrs.fr)§, Joseph Bergenstråhle §, Kim Thrane §, Annelie Mollbrink, Pascal Barbry, Rainer Waldmann and Joakim Lundeberg' date: 'Compiled: `r format(Sys.Date(), "%B %d, %Y")`' abstract: 'The spatial landscape of gene expression isoforms in tissu...
b2951c7e02046ce5e1816f32f1aaf586eb41d378b77b7b63a797ba856dbd553f
R
1,722
38
#' @title #' CBDA Spectrum plot function for Compressive Big Data Analytics #' #' @description #' This CBDA function generates histograms of the feature counts/densities as returned #' by the Accuracy and MSE metrics after the Learning/Training step. #' #' @param top Top ranked predictive models from the Learning/Tra...