sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
832229dd2255d83f28f2fe832ae9d85965afb2fac2fc194bc915273b9e2459c9
R
1,294
34
### DATA rpkms <- read.csv("genes_rpkm.csv") rownames(rpkms) <- rpkms[,1] rpkms <- rpkms[,2:ncol(rpkms)] reads <- read.csv("genes_counts.csv") rownames(reads) <- reads[,1] reads <- reads[,2:ncol(reads)] erccs <- read.csv("ercc_counts.csv") rownames(erccs) <- erccs[,1] erccs <- erccs[,2:ncol(erccs)] reads <- rbind(reads...
44bf8a710a7e441650a74b994a16d5083ac7a05e55a9adb5aee2989e693af3e8
R
1,310
23
# Set directory to source file loaction setwd(paste0(figureDirectory, "Figure2-Autocorrelation" ) ) library(ggplot2) library(cowplot) load(file = "allAcfPermutatedPlot.RData") plotAutocorrelation <- ggplot(data = allAcfPermutatedPlot, mapping=aes(x=lag)) + geom_hline(yintercept = 0, col = "black") + geom_ribbo...
fb3f70732c12773d0c65100cc7559cd81c29d6a25abb9f8845a1cf1785c14ff3
R
1,314
29
rm(list = ls()) options(stringsAsFactors = F) setwd("~/Documents/Virginia Tech/Project_4_VCU_postmortem_SCZ/differential analysis/ChIP-seq/promoters/diff_peaks") def = read.csv('Differential_SCZ_Control_glia.csv') def = def[order(def$X),] def_data = def[,2:5] setwd("~/Documents/Virginia Tech/Project_4_VCU_postmortem_S...
0528ef8e30cc4e6489175fb6b88d00b919f3fc313f200bbef4b79e5924fccf85
R
1,319
17
K27ac_EB_enhancer<-read.csv("E:/R files/K27ac_EB_enhancer.csv",row.names = 1) K27ac_EB_enhancer<-as.matrix(K27ac_EB_enhancer) wss_K27ac_EB_enhancer<-sapply(1:15, function(k){kmeans(K27ac_EB_enhancer,k,nstart = 10,iter.max = 100)$tot.withinss}) plot(wss_K27ac_EB_enhancer,type="l") K27ac_EB_enhancer_cluster_k5<-kme...
1a5854ad6d608199250ac921c8739ffea25607593bd9828e72551a68d02f4415
R
1,325
38
# Body Shape Phenotypes ## Load data and select the variables of interest pheno_data <- data[,c("id", "age_rec", "sex", "centre", "Height", "Weight", "BMI", "Waist", "Hip", "WHR")] pheno_data_na <- na.omit(pheno_data) #Remove missing values ## Principal component analysis (PCA) pca1 <- select(pheno_data_na, Height, ...
c39740a1b2d4bff471826d96b6ce5e375e62f4b386f07448556c4fb0a03cd8a6
R
1,325
24
# Configuration for the Package DESCRIPTION <- list( package.name = "gruffi" , version = "1.5.4" , title = "Gruffi identifies and removes stressed cells from brain organoid single-cell datasets." , "Author" = c( person(given = "Julia", family = "Naas", email = "julia.naas@meduniwien.ac.at", role = c("aut",...
6e9574a79761999c4e75fe1e0edd21c488e07c685e573f519a0251ec4e70732a
R
1,330
25
# Main outcome variable summaries # Load data load('alldata_subj2.Rdata') load('bbdata2.Rdata') bbsum <- aggregate(cbind(leneve.ms, tueeve.ms, maxeve)~subj, data=bbdata, FUN=median) alldata <- merge(alldata, bbsum, by="subj") ###################################################################################### # Su...
243e7208a0ef2dc7e4e99140ca24fc0fe27277f434ec1c10f5bd413aae30290e
R
1,331
48
#SR_TAU_CELL .libPaths("/data/user/jfisher7/.conda/envs/SR_TAU_CELL/lib/R/library") #make sure the environment is clean rm(list=ls()) args <- commandArgs(trailingOnly = TRUE) num1<- args[1] num2<- args[2] library(MASS) library(parallel) library(signatureSearch) library(tidyverse) library(HDF5Array) library(Summari...
30776e3163c4dd22cdd327c5674419c07f3378945a2221e6a4d96c56140f805a
R
1,337
30
dev.off() rm(list=ls()) library(ggplot2) library(tidyr) library(gridExtra) library(stringr) library(dplyr) options(scipen=999) #do this for both IT and SA Data_brown <- read.table("WG_5kb_TajimaD_brown_IT.Tajima.D", header = T) Data_green <- read.table("WG_5kb_TajimaD_green_IT.Tajima.D", header = T) Data_brown$POS <- ...
084d8c18c92e20c7ec647b2891318cba21786a790d3ac0114e3cea009f2c6f77
R
1,346
47
### DATA d1 <- read.table("small_final.txt", header = T) rownames(d1) <- d1[,1] d1 <- d1[,2:ncol(d1)] d2 <- read.table("large_final.txt", header = T) d2 <- d2[!duplicated(d2[,1]), ] rownames(d2) <- d2[,1] d2 <- d2[,2:ncol(d2)] # merge two tables d1 <- d1[rownames(d1) %in% rownames(d2), ] d2 <- d2[rownames(d2) %in% rown...
cdd3f18a0f6a6096b206ed53f535a6861fa73107b647a504952f78e304c6769a
R
1,350
36
library(dplyr) library(ggpubr) library(rstatix) library(ggplot2) modules <- c("response.to.type.I.interferon", "response.to.interferon.beta", "coagulation", "OXPHOS", "Glycolysis", "MHC.ClassII", "response.to.interferon.gamma", "translational.initiation") generate_plot <- function(module_na...
287eb0dca77b90f832b9e00db3c148de58131235920dfa21a86d61d7ea0b2dde
R
1,354
30
.libPaths("/home/u23/haozhang1/miniconda2/envs/seurat/lib/R/library") # from https://github.com/satijalab/seurat/issues/5257 # the error in MapQuery() is caused by an update in uwot # need to install the previous version of uwot and restart the RStudio session to solve this error. # devtools::install_version("uwot", v...
76b9a399808051af91c7c13e6eb3d45c7d4033aa52d841abc8df0d3de5d78947
R
1,357
53
library(clusterProfiler) library(enrichplot) library(dplyr) library(org.Hs.eg.db) library(ggplot2) library(tibble) library(viridis) library(forcats) library(stringr) dpi <- 300 perform_enrichment <- function(cluster_id) { degs_ <- markers %>% filter(gene %in% markers_gene, cluster == cluster_id) gene_ <- d...
2ae4eab04cbc9adc35b3299aba6d2794dbb491584dd7ea59ee837a7d33befe4d
R
1,365
26
library(ggplot2) library(readr) setwd('R:/WeijieZheng/Social_defeat_csv') data <- read_csv('sds_es_corr.csv', show_col_types = FALSE) ggplot()+ geom_point(data = data, aes(x = Region, y = group, size=abs(corr), fill=pvalue), color="#999999", shape=21)+ geom_point(data = data[which(data$neg_pos == "Pos"), ],aes(x =...
1a08e2ca8ffad9e34370344be54ba04594839007b19b2722d356a66ede98aaa4
R
1,372
29
dev.off() rm(list=ls()) library(ggplot2) library(RColorBrewer) library(tidyr) library(gridExtra) library(dplyr) library(qqman) options(scipen=999) Plink_adjusted <- read.table("plink.assoc.linear.adjusted", header=T) #do this for both IT and SA Plink_nonadjusted <- read.table("plink.assoc.linear", header=T) #do this ...
f1986d88c9b22677af36caadb83009cc8c9915629c5e8d6394258bdd33eb70db
R
1,372
58
--- output: html_document params: file: value: x set_title: value: x title: '`r params$set_title`' date: '`r strftime(Sys.time(), format = "%B %d, %Y")`' --- ```{r, include=FALSE} library(knitr) opts_chunk$set(fig.height = 6, fig.width = 8, fig.align = 'center', echo = FALSE) library(scater) li...
87a5b9f1baf8b2cc04d77b39c4637c681138ff97c9e55c093a88fe160e0e1c44
R
1,376
30
# Figure 3B rm(list = ls()) require("writexl") require("readxl") library("dplyr",quietly=T) library("ggplot2",quietly = T) library("ape") library("aplot") library("pheatmap") setwd("Source_Data/Figure_3/Figure_3B/") annotation_col<-read.csv("Figrue_3B.annotation_col.csv",row.names="X") ERVK_related.NorCounts<-read.cs...
7f017a6acd253d7c4fb4a4fbe303f35f598b0c357b0ab7de4804fb3acd2a788f
R
1,394
27
################# # extraction of MEIS1/2-DLX5 overlapping peak sequences for input in SpaMo # using MEIS1/2 peak coordinates, summit position +/- 250 bp genome.mm10 <- getBSgenome("BSgenome.Mmusculus.UCSC.mm10") library("BSgenome.Mmusculus.UCSC.mm10") library(seqinr) merged_peaks.df5 <- read_rds("./Table_S5_ChIP-se...
1c7fdbfe851aa80acb2091e0989845841837d930be9797d29b41746964f48324
R
1,397
31
### DATA d <- read.table("NBT_hiseq_linear_tpm_values.txt") ### ANNOTATIONS cell_type1 <- colnames(d) cell_type1[grepl("Hi_2338", cell_type1)] <- "2338" cell_type1[grepl("Hi_2339", cell_type1)] <- "2339" cell_type1[grepl("Hi_K562", cell_type1)] <- "K562" cell_type1[grepl("Hi_BJ", cell_type1)] <- "BJ" cell_type1[grepl(...
98b0c5ceb4addb841d9440bfffb4597d9a035d70141d8aceb417df3ef50fd47a
R
1,404
52
#!/usr/env/bin Rscript ## See https://bioconductor.org/packages/release/bioc/vignettes/nullranges/inst/doc/matchRanges.html library(GenomicRanges) library(nullranges) library(tidyrverse) library(dplyr) match_cell <- function(input_table, sample_size) { table <- read.table(input_table, sep="\t", header=FALSE) coln...
cd7249d18b09dd42fb94f5eb6f3a37c77c223652e74481dd334399b2c0dc9ea8
R
1,419
32
#install.packages("ggplot2") library(ggplot2) ######################################################################################### setwd("/Users/plg/Desktop/HaoChing") #set directory to the place you put the X=read.csv("6C-0728-1.csv", header = T, sep=",") #read the file you want to analyze Projectname="6C-0728-1...
5e123a5e0645fe544ab7cc0338e296391c3cd4df1b3f92df2c44b3c1261bccb9
R
1,420
40
#!/usr/bin/env Rscript ######################################################## # # Reusable evaluation containing typical columns # used in experiments using reading latency as a # dependent variable with memory and syntactic # predictors. # ######################################################## ##################...
7d1ec01291972ed7ab59cdb643ded0c626ae25beb55e667158ada1dc10664ba1
R
1,421
49
#!/usr/bin/env Rscript # See https://stephanecastel.wordpress.com/2017/02/15/how-to-generate-ase-data-with-phaser/ args <- commandArgs() ase_table <- args[6] output <- args[7] # load haplotypic counts ase_counts = read.delim(ase_table) # select only genes with sufficient coverage cov = subset(ase_counts, ase_count...
018a0a911a0703f02484033afb2a6311bb78c1eb433b33eef9e251ee820123ac
R
1,429
34
library(ChIPseeker) #BiocManager::install("TxDb.Hsapiens.UCSC.hg38.knownGene") library(TxDb.Mmusculus.UCSC.mm10.knownGene) library(TxDb.Hsapiens.UCSC.hg38.knownGene) library(clusterProfiler) library(stringr) library(reshape2) library(ggplot2) library(ggpubr) rm(list = ls()) options(stringsAsFactors = F) txdb <- TxDb...
47e1804867ab1955a75d3802322cbc3feeeaf7bc143826ca2599fd9938c3b2f3
R
1,434
46
# # Correlation between Accuracy in the Clock Navigation experiment and IPC library(ggplot2) library(gridExtra) library(ggpubr) library(rstatix) library(ggprism) library(car) # SC ----- # Load the Df SC_Clock_IPC<-read.csv('/Volumes/ROBBOT/Projects/GridMagination/Tables/03_Correlations/SC_AccuracyCorrelations.cs...
1641636e68924aa90bc3d7036c11785b357a5a62d59ae23c59ee024ceb570557
R
1,442
52
# Hierarchical clustering # # Hierarchical clustering to explore patterns of electrophysiological variables # # Author: Rafael Naime Ruggiero 2022 # Load required libraries library(MASS) library(tidyverse) library(RColorBrewer) library(gplots) # Set working directory setwd("C:/Users/Rafael Ruggiero/Docu...
16c901b231f449bc8ee2a0fe9e27412c2bab2d3e8c2ba845a94df5ee707d24ec
R
1,444
32
#' pGLS plot of a particular grade #' #' Plots the pGLS model of a particular subset of a comparative dataset #' @param Yvar column name of the dependent variable #' @param Xvar column name of the independent variable #' @param data a vector of tip values for species; should be in the same order as tiplabels in the tre...
22498c01eb3ff40f66e6ca3958ca07bb90bd4ab15e6340c427b49a95cb9e836e
R
1,455
51
#!/usr/bin/env Rscript # This script uses Bioconductor tools to download ensembl annotation data, # create a transcript2gene mapping file for use in salmon alevin, # and a output a list of mitochondrial genes for use in QC. # Currently hard coded to Ensembl v100 Homo sapiens, mostly because # AnnotationHub is not as...
c6d82105d8c82ca556747f92aedae53a615882c749a3c4a9954efd2498c8e5d4
R
1,459
49
## Libraries library(here) library(dplyr) library(parallel) library(here) library(tidyverse) library(DT) pname <- "AMC" cname <- "TSC" ## get data samples <- listSamples(projects = pname , condition = c("TSC_control")) %>% mutate(cohort = "Control") %>% bind_rows(listSamples(projects = pname , condition = c("TSC_...
26835a228557d5c603f09928bb38f1c3f9dbc3e0690f2f532cce16d16f55db8f
R
1,462
41
library("ggplot2") rds = list.files("data/rds", pattern = "\\.rds$", full.names = TRUE) names = c("Jelenia Góra", "Katowice", "Kraków Zachodni", "Kutno", "Nowy Targ", "Świnoujście", "Tomaszów Lubelski", "Toruń") names2 = c("Jelenia_Gora", "Katowice", "Krakow", "Kutno", "Nowy_Targ", "Swinoujscie",...
098f30d3d46573aa557f9d04bccabceb9ea80f9a3b72133cde88dd3ff40b6b37
R
1,470
45
##################################################### ######## Outlier Removal (+/-1.5*IQR) ############ ##################################################### #This script should be run in the directory contianing #the raw files (starting with "AllCond_Animal...") #deposited in the companion file repositry. ...
1c42c980c38bde74a197dc2a648c98accf11ba0319c182803028ae8750c2daf5
R
1,473
24
library(umap) Control_K27me3_all_peaks<-read.csv("E:/R files/Control_K27me3_all_peaks.csv",row.names = 1) Control_K27me3_all_peaks<-as.matrix(Control_K27me3_all_peaks) Control_K27me3_all_peaks<-t(Control_K27me3_all_peaks) Control_K27me3_all_peaks_umap<-umap(Control_K27me3_all_peaks) #UMAP dimension reduction to 50...
7be4b1998d1d072b4826457f35a80e13e62445ace6ed7ba9971cf6f3dff24efb
R
1,473
56
library(Spaniel) library(scran) library(scater) library(batchelor) library(dplyr) library(Seurat) library(SCFunctionsV3) library(cowplot) library(RColorBrewer) library(SCFunctionsV3) library(harmony) allData <- "/data/rachel/Linda_Lako/Spatial/spaceranger_outs_2021_102" tissue <- "AD3" projDir <- paste0("/data/rache...
57af623a1a7121cc7bcae7bd016827898fee8ecf910f54377c3bbcb5507b73fd
R
1,481
48
SparseCCA <- function(x,y,v,penaltyx, penaltyz,niter,trace = FALSE, upos, uneg, vpos, vneg){ vold <- rnorm(length(v)) u <- rnorm(ncol(x)) for(i in 1:niter){ if(sum(is.na(u))>0 || sum(is.na(v))>0){ v <- rep(0, length(v)) vold <- v } if(sum(abs(vold-v))>1e-6){ ...
d947db9f825e5b2a8191a5cc9a99ba843d414f4e18b1e51364be7584e011adda
R
1,489
44
## Libraries library(here) library(dplyr) library(parallel) ## Load files load(here("Data/04_QC/Preprocessing.rda")) sampleInfo <- sampleInfo %>% filter(PA_Diagnosis %in% c("Control", "FCD 2b") & Area_of_Resection %in% c("Frontal", "Occipital", "Parietal", "Temporal")) %>% mutate(log10_seizure_freq = lo...
b76671b0549a3f90ec60f0df867da68478b6395a7474601b8b99b0cca00e3692
R
1,499
41
#' Modify a VCF file to get a row for each variant for each sample and a GT column #' #' This function modify a loaded VCF (load_vcf) file. #' #' @param VCF_DATA the loaded VCF file #' @return modified dataframe model_vcf <- function(VCF_DATA){ VCF_COLNAMES <- colnames(VCF_DATA) ### extract sample names from VCF_DA...
ff4e80c8a00542a9de4534a9eed9fb9603b3683579461e0389125a8904912676
R
1,506
42
############################################################################################################ ########## R script for: ########## ########## Statistical indices of masculinity-femininity: A theoretical and practical framework. ########## ########## Marco Del Giudice ########## ########## Script for Fi...
3285d83b1f6f15b26e36c76ab5ea72299c47f27a3c3839d92bb38be3d0eceec9
R
1,518
55
library(harmony) library(Seurat) library(cowplot) library(SCFunctionsV3) library(dplyr) library(tidyr) library(stringr) library(tidyverse) library(DoubletFinder) library(pheatmap) library(ggplot2) ## read data sObj_Mapped <- readRDS("rObjects/AD3_individual_reference_map.rds") ## cell cycle genes s.genes <- cc.ge...
1c75058bf23b82ec1ee9956e0057c1019869107ba680583131929a65b97aedeb
R
1,524
56
library(Spaniel) library(scran) library(scater) library(batchelor) library(dplyr) library(Seurat) library(SCFunctionsV3) library(cowplot) library(RColorBrewer) library(SCFunctionsV3) sce_output <- "" batch_corrected_seurat_output <- "" sampleInfo <- data.frame(id = samples, tissue = "AD3",...
181e8915e6fa0b2097fafac57104c4046bc12e84559799df69c9951fcddcb75e
R
1,548
24
# Independently recompute weighted empirical distributions from native inputs. options(warn=1) a <- commandArgs(trailingOnly=TRUE) root <- if(length(a)) normalizePath(a[1]) else normalizePath('.') d <- read.csv(file.path(root,'qa/distribution_native_inputs.csv'),check.names=FALSE) s <- read.csv(file.path(root,'results/...
891e1faf77abaaba7ad246b636aeeaf5ed4404e61203000ca8a9434342ea1ea5
R
1,554
47
## Libraries library(here) library(dplyr) library(parallel) ## Load files load(here("Data/04_QC/Preprocessing.rda")) sampleInfo <- sampleInfo %>% filter(PA_Diagnosis %in% c("Control", "HS") & Area_of_Resection %in% c("Hippocampus", "Temporal")) %>% filter(Library_Prep_batch != "A") %>% mutate(log10_se...
eecdbf40ee4637b608d8d48ce4cc32bae0df56655fdbe93ebbf5492f91f076b3
R
1,576
35
library(Seurat) library(ggplot2) sporo=readRDS("Downloads/sporo_dataset.RDS") sporo@meta.data$batches = ifelse(grepl("2_", rownames(sporo@meta.data)), "batch2", ifelse(grepl("3_", rownames(sporo@meta.data)), "batch3", ifelse(grepl("4_", rownames(sporo@meta.data)), "batch4", "batch1"))) saveRDS(sporo, "sporo_dataset_fin...
240d0fafb00a7ac9a56d89ad164612ee7b854e50308395f4fc09db87e178514c
R
1,577
31
# R-code to recreate the Bayesian analyses performed in JASP for our manuscript "Working memory signals in early visual cortex do not depend on visual imagery" by Weber, Christophel, Görgen, Soch, Haynes. # Data is stored in "data-export.csv" # Bayesian t-test for behavioral precision btw. weak and strong imagers. # ...
d85fb0bc6c088d5f16aab4f168cae4014fc84b31282d61682947d9cd4707c355
R
1,587
58
library(BSgenome.Hsapiens.UCSC.hg38) library(tidyverse) library(Signac) library(Seurat) library(JASPAR2020) library(GenomeInfoDb) library(EnsDb.Hsapiens.v86) library(TFBSTools) library(future) plan() plan("multicore", workers = 8) #increase the maximum memory usage options(future.globals.maxSize = 30 * 1024 ^ 3) # for ...
a579e9a318ba5c0c3d8c3e6f52dbd7731d5b62e75be922866ce300736cc46cec
R
1,605
55
--- title: "Edge labels" author: "Audrey Luo" output: html_document --- # make df's for atlas-specific Edge names ```{r} # function for creating df of edge names: remove self-connecting edges # @param nrows_var A numeric var of rows in parcel_labels # @param atlas_edges An empty vector to be populated by edge nam...
9fd0ebe1a28ad7d00e148d7bee8f0262638361fa2c55955176eb26094c1fdba1
R
1,607
44
library(ggplot2) library(fgsea) plotEnrichment2<-function (pathway, stats, gseaParam=1, ticksSize=0.2,linecol=NULL,colticks="#00000099") { rnk <- rank(-stats) ord <- order(rnk) statsAdj <- stats[ord] statsAdj <- sign(statsAdj) * (abs(statsAdj)^gseaParam) statsAdj <- statsAdj/max(abs(statsAdj)) pat...
cf09c7d2a97a2166c595e731abbaf34429bd12509608ce1332b0b2c353ff9303
R
1,607
40
### DATA x <- read.table("GSE83139_tbx-v-f-norm-ntv-cpms.csv", header=T, stringsAsFactor=FALSE) fDat <- x[,1:7] x<-x[,-1*c(1:7)] rownames(x) <- fDat$transcript rownames(x)[!is.na(fDat$gene)] <- fDat$gene[!is.na(fDat$gene)] rownames(fDat) <- rownames(x) ### ANNOTATIONS ann1 <- read.delim("GSE83139-GPL11154_series_matri...
75796769c14326ee517a96cf904c6d35e2ba465246bae4d3e74c7f7dddc4fd3c
R
1,618
58
setwd('/work/AnneSophiaHartebrodt#6698/ms-project/') require(rhdf5filters) require(rhdf5) require(Rhdf5lib) renv::activate('/work/AnneSophiaHartebrodt#6698/ms-project/r-single-cell') renv::repair() set.seed(11) require(rlang) require(Seurat) library(anndata) require(data.table) require(SingleCellExperiment) require(sc...
8c5ef78bbd621d83eb591e1ef1c8b9ee83175a1c6ea26ef5a5acd4adc1de001a
R
1,623
51
# Load necessary libraries library(Seurat) library(dplyr) library(ggpubr) library(rstatix) library(ggplot2) # Load dataset df <- readRDS('Module_meta_4.rds') df$Outcome <- factor(df$Outcome, levels = c("Unknown", "HC", "S", "FT")) # Define modules to analyze modules <- c("T.cell.differentiation",...
87be6875b19d1c1e6dff5456c1f43734991a9f3234cbd141a868bbeb350ad82c
R
1,642
46
### DATA d <- read.table("data.txt", header = TRUE, stringsAsFactors = FALSE) ### ANNOTATIONS genes <- data.frame(genes = d[,1]) # gene proper gene names from Ensembl Biomart real_genes <- read.table("mart_export.txt", header=T) real_genes$genes <- toupper(real_genes$gene_name) res <- merge(real_genes, genes) d <- d[d...
dbce64f465b1f083582839da096a8eb182f9f8deca6a883b61b6fe8bc8d21c83
R
1,676
38
library(ggplot2) library(dplyr) df <- read.csv("Supp_Table2.csv") df$Clusters <- factor(df$Clusters,levels= c("C0", "C1", "C2", "C3", "C4", "C5", "C6", "C7","C8", "C9", "C10", "C11", "C12")) dpi = 300 png(file = "Fig4D_Severity_cluster_density.png", width = 6, height = ...
e86697100475f31dbe789d5efcb0f2a69b5879d46620f98488c62512ed4850a9
R
1,683
46
# required external packages for SIMLR large scale library("Rcpp") library("Matrix") library("pracma") library("RcppAnnoy") library("RSpectra") # load the igraph package to compute the NMI library("igraph") # load the palettes for the plots library("grDevices") # load the SIMLR R package source("./R/SIMLR_Large_Scal...
b6384189e3221d3cd8754540ba4b110b66c4805b22c76ac57c12fbb511d02a5d
R
1,689
61
library("ranger") library("yardstick") set.seed(1) df = readRDS("data/dataset.rds") n = round(0.7 * nrow(df)) trainIndex = sample(nrow(df), size = n) train = df[trainIndex, ] test = df[-trainIndex, ] rm(df, trainIndex) num_class = length(unique(train$class)) ## tuning parameters num.trees = c(100, 500, 1000) mtry = c...
2737b93fa269fa2707726086ca8b8ab358e81d38d98f162357ce004c3fda9897
R
1,692
67
# investigation of the association between Foodintake and different treatments # Test ancova_post_hoc(file = "../../HKFI-FoodIntake/code/ABCdata.tsv", name = "Figure1C") ancova_post_hoc(file = "../../HKFI-FoodIntake/code/ABdata.tsv", name = "Figure1B") # investigation of the associ...
86fdfae57ca8295727a6c8330f74fa6f49cb6fb020829f17e9b15fb497805acc
R
1,699
39
library(tidyverse) library(readxl) ###########data processing############### # load data and set some as factors filepath <- "pathTomergedPairedData.csv" data <- read.csv(file = filepath) data <- data %>% mutate(Condition = recode(Condition,"pCaMKII" = "Ex-Ex", "PV" = "Ex-PV")) cols <- c("Stain_post","Stain_pre","We...
761a9ec85b2187c8e3ec457693a349345c2f62ed96fc5b5008c3b2bdf0f2055d
R
1,700
47
library(ComplexHeatmap) library(msigdbr) library(fgsea) library(tidyverse) # Load data res_diet <- readRDS("data/008/002_res_tbl.rds") res_kd <- readRDS("data/002_res_tbl.rds") res <- res_kd |> inner_join(res_diet, by = "ensembl", suffix = c("_kd", "_diet")) res |> filter(padj_kd < 0.05, padj_diet...
c469336f6ae3f36cf0f57b95842493e10f68d208515051575ddd19ffe5c35912
R
1,732
38
library(Seurat) library(ggplot2) # Assuming dat0 is your Seurat object dat0 <- readRDS("PlateletsOnly_cluster_Anno.rds") DefaultAssay(dat0) <- "RNA" # Assuming marker_Survival and marker_Fatal are predefined # Ensure Survival_list and Fatal_list are correctly formatted as lists of feature vectors Survival_list <- c("...
c106a9d97a80f56e0eea57364a763378e5ba5ba5b1d101ad84cf74ca7bc829ae
R
1,758
46
#############pre####### rm(list = ls()) options(stringsAsFactors = F) library(venneuler) library(ggplot2) library(ggpubr) library(viridis) library(hrbrthemes) ##########################################MIA_birth_mom####################################### specie <- c(rep("enh_neun+",2),rep("enh_neun-",2), rep...
58aec489fd6af56cb17c37439bb9cefa630564a872d5a214d9b42c895d8467fe
R
1,766
52
library("stars") library("ggplot2") ## vector maps must first be rasterized to run the code below class_tab = read.csv("data/classification_table.csv") files = list.files("data/raster_maps", pattern = ".tif", full.names = TRUE) class_vec = integer() for (f in files) { class = read_stars(f, proxy = FALSE) class[[1...
f601f540e355c61264cd50de7a2736ffbf73982f1c347fb7ec10e33b5fa1aed8
R
1,791
55
#=============== # author: # Li Tang # Central South University # tangli_csu@csu.edu.cn #=============== # Estimate density #=============== library(foreach) library(doParallel) cores=detectCores() cl <- makeCluster(cores[1]-1) #not to overload your computer registerDoParallel(cl) args = commandArgs(trailingOnly=...
5366bbec923b9390b5de7235ca83ee10599aeb9edb719e193c713bb257748366
R
1,799
53
#!/usr/bin/env Rscript options(width=200) ######################### # # Loading Data and Libraries # ######################### args <- commandArgs(trailingOnly=TRUE) cliargs <- args[-(1:2)] options('warn'=1) #report non-convergences, etc library(lme4) # library(languageR) library(optimx) # library(ggplot2) #The bel...
ebb5e4199f7a8af62b2208dd0996559b39a3ed0db2586ac661a76b535a11a432
R
1,801
43
### This code creates fig. S1e-g dev.off() rm(list=ls()) library(ggplot2) library(gridExtra) #load all necessary input data files Data_149ind <- read.csv("WGS_149ind_assignment.csv", sep=",", header=T) evec <- read.table("populations_PCA.eigenvec") eval <- read.table("populations_PCA.eigenval") evec1.pc <- round(ev...
68ece103eed1cfe524a3af72fb45b25d9da0e4dbd917d169f0f708866c52e211
R
1,815
75
CompareMutants <- function(ReadsTable, WhereAreInocula, outputfilename) { ReadsTable <- read.csv(ReadsTable, row.names = 1) RefTable <- ReadsTable[,WhereAreInocula] SampleTable <- ReadsTable[,-WhereAreInocula] RefVector <- rowSums(RefTable) RefVectorProp <- RefVector / sum(RefVector) DivideWithinCo...
43e8d5fa9a95f8b5b43a3ca50355adfb4f6a0879a5c30a46805b43e8f1fc7a8c
R
1,820
57
#' Creates a Q-Q plot #' #' Creates a quantile-quantile plot from p-values from a GWAS study. #' #' @param pvector A numeric vector of p-values. #' @param ... Other arguments passed to \code{plot()} #' #' @return A Q-Q plot. #' #' @keywords visualization qq qqplot #' #' @importFrom stats ppoints #' @import utils #...
6f5ac266954fd928ebf7f8e905ee517b2fac8bb6d05d4c543658ab98968e9971
R
1,824
68
#clear environment rm(list=ls()) ## set working directory wdir = "C:/Users/wurmf/Dropbox/GitHub/2023_Wurm_SurpriseMinimization/" setwd(wdir) library(lmerTest) library(lme4) ########################## # model-free regression # ########################## file2read = 'staybehavior_exp1-beh.csv' #file2read = 'staybeh...
fd295bd30851692e906462efa26e15c4ab30b71cbce973d149d81d03bcf8c1d7
R
1,838
43
# Load necessary libraries library(Seurat) library(ggplot2) library(cowplot) # For theme_cowplot library(reshape2) # For melt function # Load the Seurat object identity <- readRDS('PlateletsOnly_cluster_Anno.rds') # Preparing the data for plotting # Transposing and selecting features for simplicity features <- c('MY...
286620072f3929903742e72beb9fa3b2951ddb507000741ba5d353da84a522a0
R
1,856
94
--- title: "Annotated Eye and Retina" output: html_notebook --- ## Integration script integration_from_eye_and_retina_remove_red_blood_cells_increaseMT.Rmd ## Filtering applied : Any cells which expressed haemoglobin genes were removed from the analysis. The mitochondrial threshold 10% Any samples with more th...
36b303a0dc1fcd70ddf00d74b29bb2fc448b689f9c4f2e4ebc6ff5edf954a21c
R
1,857
50
library(dplyr) library(VennDiagram) library(readr) library(tidyr) library(ggplot2) library(Cairo) # Function to process DEG files and write filtered results process_DEG_files <- function(file_path) { name <- gsub(".txt", "", basename(file_path)) degs <- read_delim(file_path, delim = "\t", col_types = cols(), .def...
e3d0396a36ea51d7707706040368d46587783205bfa255a7acd9097d4b4db9eb
R
1,857
67
### DATA # human1 h1 <- read.csv("GSM2230757_human1_umifm_counts.csv", header = T) rownames(h1) <- h1[,1] labels_h1 <- as.character(h1$assigned_cluster) h1 <- h1[,4:ncol(h1)] h1 <- t(h1) # human2 h2 <- read.csv("GSM2230758_human2_umifm_counts.csv", header = T) rownames(h2) <- h2[,1] labels_h2 <- as.character(h2$assigne...
aff15f98eb9bc2d80a9cb783654b19f29ba445dd1e12eb5cf819459e37c8967b
R
1,867
36
################# ### Load data ### ################# rm(list=setdiff(ls(),c('params','grp','treatment','injection.site'))) print(grp) print(treatment) basedir <- params$basedir setwd(basedir) savedir <- paste(params$opdir,'diffmodel/retrograde/',paste0(injection.site,collapse='-'),'/',sep='') dir.create(savedir,recur...
42cebd1150f6829833833ce0628a3142e77f2116f29a6c074b1abc256e4471cb
R
1,869
63
#!/usr/bin/env Rscript warnings() library(ggplot2) cliargs = commandArgs(TRUE) # Code for relative path from Suppressingfire on SO initial.options = commandArgs(FALSE) file.arg.name <- "--file=" script.name <- sub(file.arg.name, "", initial.options[grep(file.arg.name, initial.options)]) script.basename <- dirname(sc...
43120a8e107b8bd606b06c5466345b6e3178df4dae0b976a2260420885a7fb6e
R
1,870
70
library("xgboost") library("yardstick") set.seed(1) df = readRDS("data/dataset.rds") n = round(0.7 * nrow(df)) trainIndex = sample(nrow(df), size = n) train = df[trainIndex, ] test = df[-trainIndex, ] rm(df, trainIndex) # class must be numeric, start with 0 and numbering must be continuous train$class = as.numeric(tr...
55fc5a0925fce1b03bae5e6ba80e1d41afaf056abb848aca57f91cb0d785b384
R
1,872
59
#SR_TAU_CELL .libPaths("/data/user/jfisher7/.conda/envs/SR_TAU_CELL/lib/R/library") #make sure the environment is clean rm(list=ls()) args <- commandArgs(trailingOnly = TRUE) num1<- args[1] num2<- args[2] library(MASS) library(parallel) library(signatureSearch) library(tidyverse) library(HDF5Array) library(Summari...
fea2fdf54e425c92110407c9b53f15f9899417c033a7f8c769fd8e72caf74650
R
1,872
40
#' return a GRanges object with gene symbols annotated #' #' This function takes in a GRanges object and returns it with genes annotated #' #' @param VCF_DATA GRanges object #' @param COLUMN (optional) the column name of GENES38 to annotate (default: "symbol") #' @param STRING (optional) get each gene values as comma s...
8ac5b03e1fd7f3b995cda14cfe068cd8bb1dd03286f5fce68c38b2f98d3a4b14
R
1,883
39
# Figure 3A rm(list = ls()) require("writexl") require("readxl") library("dplyr",quietly=T) library("ggplot2",quietly = T) library("ggtree",quietly = T) library("ape") library("aplot") library("ggsci") setwd("Source_Data/Figure_3/Figure_3A/") bed.s.df<-read_excel("Figure_3A.xlsx") Figure_3A.tre<-read.tree("Figure_3A....
441bb6f6794d69de335536a156665f7f717bc17f9e9561e93ad46cc20e0fe092
R
1,891
55
## Manhattan plots for MOSTest project #install.packages("qqman") library(ggplot2) library(data.table) library(tidyverse) path = "/path/" # Load results fMRI = fread(paste0(path,"rsfmri/rsfmri_eig0.most.orig.csv.gz")) sMRI = fread(paste0(path,"T1/T1_eig16.most.orig.csv.gz")) dMRI = fread(paste0(path,"diffusion/diff...
0d9a4cbe4426d2c0785c68ab25d33ba13c61f12b4734f0615eb4b5862873d96d
R
1,892
46
# Figure 2BC rm(list = ls()) require("writexl") require("readxl") library("dplyr",quietly=T) library("ggplot2",quietly = T) library("ggtree",quietly = T) library("ape") library("aplot") library("ggsci") setwd("Source_Data/Figure_2/Figure_2BC/") ERVK_proportion_node<-read_excel("Figure_2BC.xlsx") ### Figure_2B p.Figu...
4be05e76921b851f84e411e8952a0541201bcf82f9f99ae0a99301f5a185864f
R
1,905
57
test_that("edgeExtract() works", { bam.path <- test_path("fixtures", "sample.bam") edges <- edgeExtract(c(a = bam.path, b = bam.path)) expect.edges <- readRDS(test_path("fixtures", "sample.bamEdges.rds")) expect_true( all(names(edges) == c("a", "b")) ) expect_true( all( ...
bc1ffc1f62bb4e348420a323fec0c4e511478e0d8c527b22bebceafcda25043e
R
1,924
41
#' Adapt samples specified in COLOR_SAMPLE #' #' This function iterates through COLOR_SAMPLE and checks it #' It the returns a little DF of 2 columns with each specified sample and corresponding group #' #' @param COLOR_SAMPLE list with groups and names of sample to color in the final plot #' @param SAMPLE samples to p...
211a40dcab559cffbf00267c500994ec1423bd5afde285abf7099410d5a68202
R
1,949
45
library(data.table) require(plyr) library(ggplot2) library(RColorBrewer) rm(list=ls()) setwd("/Users/elleke/SURFdrive/Projects/MOSTest/Results/Discovery/Pleiotropy/Genes/Celltypes/") # Bhaduri et al Bhaduri_Cross_modality = fread("Bhaduri_FetalBrain/MOSTest_Bhaduri_FisherExact.txt") colnames(Bhaduri_Cross_modality)[1...
56791b3bd78f66e2a84ce2dd89b08f721b54c1cbfcb48f1d84d58cbe27024c6d
R
1,953
37
#' autocorrelated_genes() #' #' Filtering gene expression matrix by spatially auto-correlated genes and correction for multiple-testing #' #' @param alternative a character string specifying the alternative hypothesis, chosen from one of "greater", "two-sided" or "less". Default is "greater" #' @param adjustPv Adjusted...
b9d0eb363077b1d8bda1bf161fd272a3ec7e094ab5665d466b27ee797b66f67c
R
1,964
53
require(Seurat) FindVariableGenesSeurat <- function(data, x.low.cutoff = 0.1, x.high.cutoff = 8, y.cutoff = 1, y.high.cutoff = Inf, num.bin = 0, binning.method = "equal_width", sort.results = TRUE, display.pr...
1c95360e7da0ed80d5ec2c5358514c1f25d093d2aea4efdd3611536018c655ee
R
1,975
68
library(dplyr) library(Seurat) print("Add Metadata ...") metadata <- read.csv(paste0("csvFiles/metadata")) # Run 1 runNo <- "run1" sampleInfo <- readRDS(paste0("rObjects/sampleInfo_", runNo, ".rds")) sampleInfo <- sampleInfo %>% left_join(metadata) sObj_Filtered <- readRDS(paste0("rObjects/sObj_Filtered_", runNo,...
611bb2fd409e3d0668d1d60c62be7b19a187d186558704522f9e7f630fc75cef
R
1,977
35
# Code for making dotplot from data.combined library(Seurat) library(tidyr) library(ggplot2) library(patchwork) library(ggpubr) dotPlotMarkers <- read.csv("Markers for Dot plot_Figure 1.csv", header = T, sep = ",", na.strings = "") colnames(dotPlotMarkers)[1] <- gsub('^...','',colnames(dotPlotMarkers)[1]) ...
f73d356857946755f709e5cad2f6868a52eaadfd004b2b65c32725936c08ccfb
R
1,986
85
--- title: "`r thetitle`" output: html_document: df_print: paged --- ```{r} knitr::opts_chunk$set(echo=FALSE, warning=FALSE, message=FALSE) ``` ```{r libaries} library(dplyr) library(Seurat) library("ggplot2") library(monocle3) library(patchwork) library(SeuratWrappers) library(harmony) library(ggplotify) libra...
664461e7ad0c33884ab8524e6609c823fe140f052d4316ba485ec9194fcedbf4
R
1,988
75
suppressPackageStartupMessages({ library(Seurat) library(stringr) library(sctransform) library(future) require(scales) library(RColorBrewer) library("readxl") library(dplyr) library(dendextend) library("graphics") }) ### figure 5 + supplements # import the Dopaminergic nuclei (mDA) dataset. sobj ...
53f52be346eeabbdfb7a6860f914e1196c519c439c54f624ba83fc170d227635
R
1,997
13
HG37_FASTA_FILE <- '/home/enrico/columbia/FASTA/hs37d5.fa' CHR_ORIGINAL_NAMES <- c( "1 dna:chromosome chromosome:GRCh37:1:1:249250621:1", "2 dna:chromosome chromosome:GRCh37:2:1:243199373:1", "3 dna:chromosome chromosome:GRCh37:3:1:198022430:1", "4 dna:chromosome chromosome:GRCh37:4:1:191154276:1", "5 dna:chromosome ...
91959099ffb9ac4444b112b887e87c5dc5d76419b9f01aace257a5f1a1c22d54
R
2,003
69
library(BSgenome.Hsapiens.UCSC.hg38) library(tidyverse) library(Signac) library(Seurat) library(JASPAR2020) library(GenomeInfoDb) library(EnsDb.Hsapiens.v86) library(TFBSTools) pfm <- getMatrixSet( x = JASPAR2020, opts = list(collection = "CORE", tax_group = 'vertebrates', all_versions = FALSE) ) motifs <- sapply...
4337b9fbf3d8b816950100ad4cdff6252500c94127fa9a4bd376b2e92c925ec0
R
2,020
27
--- title: "Home" site: workflowr::wflow_site output: workflowr::wflow_html: toc: false editor_options: chunk_output_type: console --- 1. System requirements - All software dependencies and operating systems (including version numbers) are available in the [methods section][methods] - Archived version of thi...
4d9c16d9b6eff26b2ce4a023d807b252d3dca44b4716f0ff3d1b883c100880df
R
2,065
49
#' get_model_stats() #' #'Get Model Statistics #' #' This function calculates the model statistics for a given effect plot and data frame. #' #' @param effect_plot The effect plot containing the predicted values from different models. #' @param dt The data frame containing the observed values. #' @param models A charac...
306b0e689dc9b80e48e542e7d21dda9e9cc96df2fd464b9a9f00af4378e7c765
R
2,073
52
library("stars") library("ggplot2") maps = list.files("data/raster_maps", pattern = "\\.tif$", full.names = TRUE) rds = list.files("data/rds", pattern = "\\.rds$", full.names = TRUE) df_output = data.frame(x = double(), y = double(), var = factor(), class = double(), class2 = factor()) freq_out...
1a6cf921a65092c07209edf384f7fab7b6ef3b511278683f6373a4db0cce3983
R
2,079
67
run_DAseq_comparison <- function(object, groupA = "", groupB = "", labels.1 = "", labels.2 = "", path = "", outputname =...
3175cc121ec49c10a63bf0c3798fc5825020cc0b43b6371fe7a498a9d69cf1b5
R
2,081
56
## Correlation analysis: all-to-all correlation between variables # # Vinding, M. C., Eriksson, A., Low, C. M. T., Waldthaler, J., Ferreira, D., Ingvar, M., # Svenningsson, P., & Lundqvist, D. (2021). Different features of the cortical sensorimotor # rhythms are uniquely linked to the severity of specific sympt...
46cc34765e40e98dfb9a46c923b3511338c7cb2680be3602ad175dd048f096be
R
2,099
40
#' Create a list of SingleCellExperiment objects using scpcaTools::import_quant_data. #' #' @param info_df data.frame containing information for each sample to create a SingleCellExperiment object for. #' Each row corresponds to an individual sample and columns contain information for that sample: #' data_dir - ...
76c6198bfd99e3db5c63bbd4798f44998658b9784ddcc10fb542c39ecfdb13ca
R
2,107
77
combinereplicates <- function(listoffiles, pvalcutoff, fccutoff, outputfilename) { combinetolist <- function(filename) { Finaltable <- read.csv(filename, row.names = 1) } combinedlist <- lapply(listoffiles, combinetolist) combined <- unlist(combinedlist) numrows <- dim(as.data.frame(combinedlist[1]))[1] dim(combined...
58ee7e28158eb3a0b4ee3d1d689cc1545bd75a6d3f9e4cc340139822f6e87218
R
2,113
93
### _go.R ### suppressPackageStartupMessages({ library(AnnotationDbi) library(org.Hs.eg.db) library(org.Mm.eg.db) library(org.Rn.eg.db) library(clusterProfiler) library(GO.db) }) gene_loader <- function(path){ stopifnot(is.character(path)) return(rownames(read.csv(path, header=T, row....
7eed5f5043c9626a724aef4610cc2b46c680146b76e274c0f47f7bc43c8ea888
R
2,149
48
################ #load libraries# ################ library(Seurat) library(ggplot2) library(utils) library(DESeq2) library(grDevices) library(cowplot) library(dplyr) library(patchwork) ########################### #Basic pipeline for Seurat# ########################### no_CDSUTR_Sporo_FUGI_R_D7465034=readRDS("no_CDSUT...
4b55338abda646baf29b460b580b573f698ceee2bd815cc509dacbcdc8966d7b
R
2,151
58
### DATA # http://genome-tech.ucsd.edu/ZhangLab/index.php/data/epigenomics-and-transcriptomics/sns/ # Lake et al. (2016) Neuronal subtypes and diversity revealed by single-nucleus RNA sequencing of the human brain. Science. 352 (6293): 1586-1590 # Own website #Prefrontal cortex - BA10 #Frontal cortex (eye fields) - BA8...
9895ecd6eb30cdd38189747464572610378e3d7926bb8a61f3bbf52dd08a7afa
R
2,180
51
#' Import Alevin-fry and Spaceranger output for Spatial Transcriptomics library into a SpatialExperiment object. #' #' @param fry_dir Path to alevin-fry outputs directory. #' @param spaceranger_dir Path to folder output by Spaceranger. #' @param sample_name Sample id. #' #' @return SpatialExperiment object with shar...
98841ba77904fedd587822963b987d1f26aba15383d9019446ad45f9b64d13a1
R
2,191
66
args = commandArgs(TRUE) report = read.table(args[1],header=T) indextable = args[2] output = args[3] if(indextable != "None"){ indices = read.table(indextable) } #This code is directly adapted from the picard source code: http://picard-tools.sourcearchive.com/documentation/1.25-1/classnet_1_1sf_1_1picard_1_1sam_1_1D...