sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
060085bbf41b2423450317903f0baa0962e10c67d128d3d27a0fff8ad90692c0
R
3,417
79
# Result objects without a recorded tested table (SPEC-RICHR-004 REQ-005, # AC-004): objects serialized by richR before the tested slot existed # (fixtures/legacy_*_fca5276.rds, made by fixtures/make-legacy-fixtures.R with # the fca5276 build), objects built by as(), and objects whose slot and # metadata are gone. Catc...
3c199e782e4191353ca7c322483b1a74dbe7754d2526cd2d9e3b669532294b47
R
3,435
82
#!/usr/bin/env Rscript ################################################ ################################################ ## REQUIREMENTS ## ################################################ ################################################ ## DIFFERENTIAL GENE EXPRESSION ANALYSIS ## - ...
115348eb9119b7e37fec585ed86173ae5a97cce81c3c9909302cec95955a2639
R
3,442
89
# This script was written by Dr. Michael Hallquist and is copied from https://github.com/UNCDEPENdLab/fmri_processing_scripts/blob/master/fsl_regfilt.R #!/usr/bin/env Rscript args = commandArgs(trailingOnly=TRUE) if (length(args) < 3 || length(args) > 5) { stop("Expects at least three arguments: input_file, melodic...
6dba1527005a4def2bf6c26f933d37295e604dc32d51e734cf86108679f270ad
R
3,443
89
################################################################################ # DNA methylation analysis with RnBeads # For project Stewart_DLB # ------------------------------------------------------------------------------ # Vanilla analysis of the Stewart DLBvsHealth EPIC 850K dataset # -------------------------...
d8b00b66bdcca1d25d659af81316d2bc86af1a9e5ed7d412f43c57342cff183e
R
3,448
84
--- title: "05_interpretation_genes" author: "Will Townes" output: html_document --- ```{r} # library(tidyverse) library(biomaRt) # library(rPanglaoDB) source("./scrna/utils/interpret_genes.R") fp<-file.path pth<-"scrna/visium_brain_sagittal" ``` loadings from NSFH ```{r} W<-read.csv(fp(pth,"results/vz_brn_nsfh20_spd...
e92078200203d90a17887539f5ec8052bce1e2e1fa7e13e85bc364e868e1c028
R
3,450
140
#' Comp3Moy #' #' #' @name Comp3Moy #' #' @param Condition the different conditions named in the same column #'library #' @param Measure the values measured for every sample #' @param n is the number or replicates per condition #' #' #' @description Compare 2 or more datasets using the right test according t...
ed7be381e7d0bfc0f44bc9af158fef85151931503bc18c5ef11ce1b1299826b3
R
3,467
99
library('Seurat') source('scRef.R') exp_raw_data= read.table('MGH54_mat.txt',sep='\t',header=T,row.names=1) #exp_raw_data= read.table('GSE70630_OG_processed_data_v2_MGH53.txt',sep='\t',header=T,row.names=1) #exp_raw_data= read.table('GSE70630_OG_processed_data_v2_MGH60.txt',sep='\t',header=T,row.names=1) #exp_raw_dat...
7518b79982af094ee34f944b74c40e736964350dce9cc0764a43c22561a96c7f
R
3,470
72
# SPEC-RICHR-012: exact leading-edge identifiers and comparison group identity. review_identity_groups <- function() { fc <- stats::setNames(seq(2.3, -2.3, length.out = 24), sprintf("g%02d", 1:24)) result <- data.frame(pathway = c("P1", "P2"), pval = c(.01, .03), padj = c(.02, .09), NES = c(1...
2fce4e5cfeb013fda65ca6dd703c3ef541e0f6aadb30a703b86a0914f69ca207
R
3,489
99
#' make_project #' #' #' @name make_project #' #' @param path path where to create project #' @param IHC true if it's an IHC and I want tiff, czi and QP folders #' @param path_to_QuPath the path where the QuPath (console).exe is located, should look like this on windows "C:/Users/user_name/AppData/Local/QuPath-0...
c3cdf0c2666077013e5f95de3e3b80f5fedf691c9d96422cc7786c118e729984
R
3,505
122
if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install("TSCAN", version = "3.8") library(TSCAN) load('OligTumor.RData') library('Seurat') source('scRef.R') library(TSCAN) library('Seurat') #exp_raw_data=read.table('MGH36_mat.txt',header=T,row.names=1) #exp_...
f067d8e4e16bb1389a77d438641ba913fb412addad65bab34f42a8bbb765c63a
R
3,531
99
# group_by() on richResult, GSEAResult and Annot objects. # # The methods passed `add = add` to dplyr::group_by(), an argument dplyr # (>= 1.0.0) made defunct, so every call failed with "The `add` argument of # `group_by()` was deprecated in dplyr 1.0.0 and is now defunct." These tests # catch that failure and an `add ...
8a290428f525f2ff955fd6602210d7f95fe280dafeb959d1d641467c12ea387a
R
3,532
87
# Live KEGG pathway labels (builtin = FALSE) must survive an unreachable or # incomplete KEGG listing: fall back to the bundled labels and say so. # Catches: a crash when KEGG is unreachable, a silent fallback, and a spurious # warning on a healthy listing. keggList is mocked; nothing reaches the network. collect_warn...
a9fb7e2f2b826588dde51bc634736399c66c8c90cb15022eae23b7c419be5bd8
R
3,559
88
# Regenerates the small deterministic fixtures used by the characterization # tests (test-characterization-*.R). No random numbers, no network. # # Run from tests/testthat/fixtures/: Rscript make-fixtures.R # The committed CSV files are the source of truth for the tests; this script # documents how they were derived s...
bfa9ccdc86891af07466b8c041d6a2bf94fc214dc130505f2466167c04b54673
R
3,561
111
### ### Explore the different GDC & TCGA data types available through the ### Xena public data hubs. ### ### This script assumes that the working directory is the main MEXPRESS ### folder. ### library(data.table) cancerType = 'acc' plotCol = '#ffa96a' # Gene expression RNA-seq data x = fread(paste0('data/', cancerTy...
5877eee4cf7eb0cf929051f2b4050e2406f01671bb09ce9bf5a7779bcd31afb7
R
3,577
91
# compareGSEA() significance cutoffs. # # compareGSEA() must keep a group's pathways only when the caller's cutoffs # hold: with a non-NULL `padj` both the raw and the adjusted cutoff apply; with # `padj = NULL` only the raw cutoff applies. Values equal to a cutoff are kept. # The cutoffs must never be resolved to the ...
ea9c1c009a87f63d34b84789fee88d6cad7eb91b1a97ffa1a409e76f1aae4019
R
3,625
94
# load libraries ---- library(readxl) library(ggplot2) # clear workspace ---- rm(list = ls()) source('/Users/vkumar/Documents/smith10/2D_plots/geom_flat_violin.R') source('/Users/vkumar/Documents/smith10/2D_plots/summarySE.R') # Set path ---- setwd("/Users/vkumar/Documents/smith10/2D_plots") setwd(dirname(rstudioa...
b2f3824e3745c5cf82858f3a0fa1b37f5d427062bdb752e3896268cfc4837cee
R
3,630
135
exp_data=read.table('GSE104276_all_pfc_2394_UMI_count_NOERCC.xls',header=T,row.names=1,sep='\t') TYPE=read.table('NPCneuglia.txt',header=T,sep='\t') exp_raw_data=c() COLNAME=colnames(exp_data) i=1 for(cell in TYPE[,1]){ exp_raw_data=cbind(exp_raw_data,exp_data[,which(COLNAME==as.character(cell))]) #print(cell) pri...
eb4ccc943ee76bc1a568853854dd01870390c2bb4a5fc8c0973db75071e721f9
R
3,681
86
# Assigns cells that are not assigned automatically by assignSubdivisions manualAssignments<-function(animal,section,dat){ if (animal=="640696" & section=="Intermediate RH"){ indices <- c(5,150,245,270,308,319,414,594,792) if (any(dat[indices,"Subdivision_Assignment"]!="Unknown")){ print("Warning: One ...
9d3fab19fccd4874f42291a41b77851046600d7fabef242e9766a6db58a68ff9
R
3,687
107
#! /usr/bin/Rscript #' Required packages library(reshape2) library(ggplot2) ### Add efficiency values to data set ### #' Create matrix to be melted #' #' value: vector containing Ct values #' geneID: vector containing gene names #' conc: vector containing log(concentration) values #' if there is a NA value in this v...
efc474ad93f00dbf44e9505dd038eed0264a8313b2eabaf4e39354de3d3dc893
R
3,698
93
#' Validate gene input for enrichment analysis #' #' Checks that gene input is non-empty, removes NAs and duplicates, #' and reports mapping statistics. #' #' @param x gene vector or data.frame with gene rownames #' @param annotation annotation data.frame (two-column: GeneID, Term) #' @param func_name name of the calli...
ea5073bf56666d2a959300035268386a3166669309036f37f66db8335ce4be0f
R
3,708
93
### ### Process the epigenomics TCGA data. These include: ### - RNA-seq gene expression ### - DNA methylation ### - copy number ### - miRNA expression ### ### The sample names used in the different data sets need to be normalised: ### The DNA methylation data uses this sample name format: ### TCGA-D1-A0ZV-01, while...
106754a0aac87b76130e26970d4e9eec105cfe3c6bb64f48c5c5f3df8cd4bb9d
R
3,721
105
# This is the R script for generating sampling density map # Designed for command line use, given the required packages are installed # # Example usage: # Rscript Get_density_map.R ./GeoDB ./example/input.csv ./example/output.csv titlename # # ./GeoDB the folder containing the query database generated in previous step...
5170976e90b97966044c9241dcc58ebe8a15cc2144dac596fc4939f4b3b8b1a2
R
3,735
91
#! /usr/bin/Rscript ### Data normalization (Pfaffl's method) ### ######################################## Reference ######################################## # "A new mathematical model for relative quantification in real-time RT_PCR" # Michael W. Pfaffl # Nucleic Acid Research, 2001, Vol 29, N°9 00 # h...
54afa5a8c476331e10887c9cce3435f94700b47b20444439fd87002bfa21775f
R
3,746
108
# SPEC-RICHR-015: reject lossy integer metadata through the public folder API. .mi_folder <- function(x = .rp_fq()$q1) { p <- tempfile("manifest-integers-") writeRich(x, p) p } .mi_edit <- function(p, edit) { f <- file.path(p, "manifest.json") m <- jsonlite::fromJSON(f, simplifyVector = FALSE) writeLines(js...
a8a160fcb58119640fd37a5ac6580b15f416ff73bccd65f726611b221171a545
R
3,747
84
# AC-009 (SPEC-RICHR-006 REQ-006, REQ-008): every plot of set P (each method), # richClusterDot and richUpset draw on the current build exactly what the M6.1 # base (fca5276) drew, on inputs whose rows all pass the default selection. # The reference fixtures/plot_reference_m6base.rds was recorded by # fixtures/make-plo...
1949956195f64d77001aeac291f3758565a68aee6b69b685ead3084d1238c548
R
3,757
70
mirror <- function(DF, CHR, START, END, SENTINEL = "sentinel", GENE_START = NA, GENE_END = NA, T1THRESH1 = NA, T1THRESH2 = NA, T2THRESH1 = NA, T2THRESH2 = NA, TITLE = NA, COLOURS = c("blue", "red3", "orange", "yellow", "lemonchiffon2", "gray60"...
e804c74944382ca17d2e06ab9c942c705a0cbda342d4c1db50908cc89205a740
R
3,771
93
wd <- getwd() library(Seurat) library(dplyr) library(ggplot2) library(sessioninfo) session_info(to_file = "session.log") s.1.obj <- Read10X("Y:/CDBLabs-Bioinformatics/Some_Place_Where_Big_Files_Can_Sit/Giger_2022_CellRangerFiles/Blood/5619-RG-14/filtered_feature_bc_matrix") %>% CreateSeuratObject(project="PBMC_Naive_F...
2da9a15fdf86468417793f00a34d7e7695c530c0fe86e12282f2589d2296c3eb
R
3,775
96
library(LSD) getvals <- function(dir, pattern, filter, refValt=F){ files = list.files(path=dir, pattern=paste0('^',pattern), full.names=T, recursive=T) files = files[grep(filter, files)] say(files) table <- as.data.frame(do.call("rbind", lapply(files, FUN=function(file){ vals=readme(file,skip=95,...
227f8c45b5e7e7f068c304b0a078e4d81ae4f9bc42ba3884acfdf7b27fdaa1bb
R
3,780
119
--- title: "Estimating RNA Velocity using Seurat and scVelo" date: 'Compiled: `r format(Sys.Date(), "%B %d, %Y")`' output: html_document: df_print: kable theme: united github_document: html_preview: true toc: false --- This vignette demonstrates analysing RNA Velocity quantifications stored in a S...
69f6494d8fc48ac4993753941e277613d6c7626b131181c7191c04fafdc5a328
R
3,783
125
## version using an array object ## these are wasteful since there are many zeros ## surprisingly, testing shows this is more efficient than sparse arrays EXPVALUE = function(trees, x.test, S, call=FALSE)## default to R vs. C++ code { if(call) { #...
cf14b64ff6953d5734ac44642f53f6ecdfa1e98605582b8735620ba6e2394133
R
3,796
98
#code for Figure6 figure supplement5 of the Jasek et al 2021 desmosomal connectome paper #Gaspar Jekely source("code/Packages_and_Connection.R") #read the tibble with desmosome ids, xyz coordinates and partners 1 and 2 desmo_with_partners <- read_csv("data/desmo_with_partners.csv") #read skids of connectome neurons ...
434344debf351be5183ad5db6262f8df813df1bf4d7905157fd0514877623a10
R
3,804
113
--- title: "Running PaCMAP on a Seurat Object" date: 'Compiled: `r format(Sys.Date(), "%B %d, %Y")`' output: github_document: html_preview: false toc: false html_document: toc: false df_print: paged --- This vignette demonstrates how to run PaCMAP, a dimensionality reduction method that can be us...
bb569a38b0886cc6c2633ef6acd38ed6e1592e33b123159a091c24242a85f063
R
3,828
85
## data-raw/kegg-refresh-helpers.R -- shared steps of data-raw/kegg.R, ## data-raw/module.R and data-raw/path.R. Sourced by those scripts; not run on ## its own. ## ## The KEGG version is derived by the installed richR's own .kegg_release() ## (the rule richR records for live KEGG labels: the release KEGG states, ## ve...
9ef2e9464bb943d18961a58483a83ec9e0cfb744baf60d886ea0e9995101a5d8
R
3,830
105
load('loglin_data.rda') ################## ### Log-Linear ### ################## freqdat = data.frame(tabdat <- xtabs(~ Match + Type + Condition, data=loglin_data)) ftable(tabdat) # Condition ST CT # Match Type # 0 subordination 6 6 #...
fbd59a152e59d6667a84ffea4c4fc0629a74ca663cf762052a8714ea5b4289a9
R
3,836
109
#load packages { library(igraph) library(visNetwork) library(ggplot2) library(ggraph) library(rgexf) library(RColorBrewer) } #read adjacency matrix desmo_conn <- read.csv("data/adjacency_matrix_desmosomal_connectome_CATMAID.csv", sep=",") desmo_conn <- as.matrix(desmo_conn) #with the make_graph function of igraph ...
1d4b56484c075403ccce0f252297ba5660daf9e5a12e7ff6b500a677093aeeeb
R
3,851
114
knitr::opts_chunk$set(echo = TRUE) library(dplyr) library(tidyr) library(stringr) library(ggplot2) library(rstatix) library(ggpubr) library(officer) #library(ggprism) #load fpr data for cross-sectional data vol_cx <- read.csv("Data/fp_vol.csv") vol_cx$Metric <- "Volume" corthick_cx <- read.csv("Data/fp_...
f5feb2f183faf831c66c0a1bf0ddbad954e40da2616a59d7cbfe544bd4fddc41
R
3,860
106
#' Predict sex of cells in scRNA-seq data #' #' This function will predict the sex for each cell in scRNA-seq data. The #' classifier is based on logistic regression models that have been trained #' on mouse and human single cell RNA-seq data. #' #' For bulk RNA-seq, checking the sex of the samples for mouse and huma...
2bd91e13e80835e9b75caf3e0b1cf9f5726485a2e6f6227e626190cbd14e7962
R
3,869
103
#' @include internal.R #' NULL #' Run fastMNN #' #' @param object.list A list of Seurat objects #' @param assay Assay to use, defaults to the default assay of the first object #' @param features Either a list of features to use when calculating batch #' correction, or a number (2000 by default) of variable features to...
b566796cebd07fd16dfaff73c55eebd499e89ef488bea0be9879e7a410755363
R
3,888
90
# Reactome annotation identity (REQ-006 .. REQ-008), offline: the reactome.db # maps are replaced by small in-memory maps through the .reactome_map accessor, # so these tests need neither reactome.db nor the network. Upstream-portable: # they assert only the annotation frame and ORA gene-set keys, never result # labels...
d1fe9d5b2d2144d8d8693e830dbc754f56a29580ba80c7311d7168756bcc0768
R
3,897
141
--- title: "Integration of datasets using Conos" date: 'Compiled: `r format(Sys.Date(), "%B %d, %Y")`' output: github_document: html_preview: true toc: true toc_depth: 3 fig_width: 16 html_document: df_print: kable theme: united fig_height: 5 fig_width: 16 out_height: 4 --- Thi...
476411a4378ffda9400eeede3f9ce77f10c7c1af87f9418a9e56e9b4bd95f11f
R
3,939
96
#' Get probe paths #' #' This function uses a dataset data frame and returns probe paths. #' Returns a probe.paths class. #' @param dataset a data frame generated by getcell.ids() or inspect.registration(). #' @id vector indicating segmented points which belongs to single probe path. #' @surface.point real-valued, sta...
52e7aabf330102298404d96b09e5537f966dd17353e616583925d7546cdc79b7
R
3,944
106
##' Class "richResult" ##' This class represents the result of enrichment analysis. ##' ##' ##' @name richResult-class ##' @aliases richResult-class plot,richResult-method ##' ##' @docType class ##' @slot result enrichment analysis results ##' @slot detail genes included in significant terms and original information ##...
3dc0838102b71f91efacbe504c9630a32807435675dc2d289ed444066867ce23
R
3,946
140
### QC_Seq_Depth Analysis rm(list = ls()) source("src/load_packages.R") source("src/load_phyloseq_obj.R") source("src/miscellaneous_funcs.R") source("src/metadata_prep_funcs.R") source("src/alpha_diversity.R") source("src/beta_diversity.R") base::load("files/Phyloseq_objects_Woltka.RData") base::load("files/Phyloseq_o...
85c8502c459dc7de83b07707cd8dcf48755fd46b430bb429feb23a552bbf24c5
R
3,953
131
#' Producing an estimation plot #' #' @name dabest_plot #' #' @param dabest_effectsize_obj A dabest_effectsize_obj created by loading in a #' dabest_obj along with other specified parameters with the [effect_size()] function. #' @param float_contrast Default TRUE. If TRUE, a Gardner-Altman plot will be produced. #' If ...
520ab0d008eef7c8298feaf321eb0af9b34cc307b2c8e510f298b8a6fca2645b
R
3,960
68
# sample (sample_n) for later use by object type n_sub_fraction <- 0.7 #tau_datsets train_mglia_T <- sample_frac(filter(disease_cell_overlap, FlowSOM_ids == 'microglia' & tau_obj_POS == 0), n_sub_fraction) train_mglia_T <- rbind(train_mglia_T, sample_frac(filter(disease_cell_overlap, FlowSOM_ids == 'microglia' & tau_o...
a6ec7f7495664bd21bf496b1c6f7b05b642fc036a9fc24fe96aa648c269e475f
R
3,981
77
#' Flat-field correction #' #' An image sensor of a camera is composed of a two dimensional array of light sensitive detectors or pixels. The sesnor array is #'mechanically quite stable with the pixels retaining a rigidly fixed geometric relationship. Each pixel within the array, however, #'has its own unique light sen...
06be24e79ba07a617058993a1b27732ad32a76193232913b508ec4f4245e4f92
R
4,019
67
# setup ------------------------------------------------------------------- rm (list = ls()) library(data.table) library(tidyverse) setwd("~/Desktop/Neurobiologia/projects/ongoing/verbal.irony/discrepancy/experiment.1/task/data/") #setwd("discrepancy/experiment.1/task/data/") # general --------------------------------...
e8f10a2a9737826c0a5ecf22596f9fa2d0f5a3b9027ffba068be25ebfaf176cb
R
4,046
174
##################################### # Simulated benchmark load('TSNE.RData') ori_label=read.table('Zeisel_exp_sc_mat_cluster_original.txt',header=T,sep='\t') pbmc@meta.data$ori=ori_label[,2] library(Seurat) library(SingleCellExperiment) library(scmap) head(ann) tmp=as.matrix(as.factor(pbmc@meta.data$ori)) #tmp[,1]...
ae27d1cc6538a0477cc60c20d52de7caacdd7a375fc86dccd3e11634d79e4c0e
R
4,056
120
load('pbmc.RData') source('scRef.R') library(Seurat) ######human pbmc#### COL=c() i=1 while(i <=length(pbmc@ident)){ this_col=which(colnames(pbmc@raw.data)==names(pbmc@ident)[i]) COL=c(COL,this_col) i=i+1 } sc_tag=cbind(names(pbmc@ident),as.character(pbmc@ident)) exp_raw_mat=as.matrix(pbmc@raw.d...
bc2f9f4888ff54324b5951227e859127960052ba4b781218a938a9c2ef2d8a34
R
4,079
146
--- title: "Make_combat_figures" author: "Sophie" date: "07/01/2022" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ```{r} library(dplyr) library(tidyr) library(stringr) library(ggplot2) library(rstatix) library(ggpubr) library(officer) #library(ggprism...
f24041b24155be63691f8da0aa19b46bee01e3081d5ac177ec7dbd2f00587d35
R
4,085
98
if (F){ " This script implements count ~ group plotting integration. It requires Stage I integration outputs dots.csv, samples.csv. Two possible output files: merged.pdf and batch.qc.pdf " } suppressPackageStartupMessages(library(tidyverse)) suppressPackageStartupMessages(library(ggrepel)) source("w...
e9287e7d5875b7dedb4bba868567efa544901825602dedcb138b5348c8162e3e
R
4,120
149
--- title: "Calculating Trajectories with Monocle 3 and Seurat" output: html_document: df_print: kable theme: united github_document: html_preview: no toc: no date: 'Compiled: `r format(Sys.Date(), "%B %d, %Y")`' --- This vigettte demonstrates how to run trajectory inference and pseudotime calcul...
584cee00e3385a06e3b37ade9d99bce84934f67d5f8efe0edd8533a580c9ee52
R
4,137
87
# Regression controls for SPEC-RICHR-013; no shared fixture state. .review_access_result <- function() { methods::new("richResult", result = data.frame( Annot = c("A", "B", "C", "D"), Term = c("B", "unique label", "shared label", "shared label"), Pvalue = c(0.001, 0.02, 0.03, 0.04), Padj =...
d5b7e52f69e8b4aeda21af46ff33ef019e461146a31653aeaa9c250c466674a6
R
4,145
101
library(ggplot2) library(glmnet) library(LSD) a=read.csv("experimentResults.csv") round(a,3) results = data.frame(tests = c("B vs BG","B vs Bb","Bb vs BbG"), pvals = c(t.test(a$B, a$BG, paired=T,alternative='less')$p.value, t.test(a$B, a$Bb, paired=T,alternative='less')$p.value, t.test(a$Bb, a$BbG, paired=T,alternati...
0b25c0403a0ab468ca21566f1db6f0b62e1b10d4b24bf9500d9cbcc7908ad595
R
4,193
99
#! usr/bin/Rscript #' Required package library(reshape2) library(data.table) ### Apply statistical test to the qPCR data set ### #' #' The data that has been used so far is long-format data: #' all genes are stored in one column and their corresponding values in another column. #' To perform a statiscal test across t...
06beaa418b482b111e682fa6b638673abcb730d5b7711262b33e13a2bc28acd4
R
4,194
101
library(glmnet) database = args[1] #name of database {choose a code below} load("alldataGeneticBiochemical.RData") if(database == "B") a=a[,1:10] if(database == "Bb") a=a[,c(1:10,grep("^BIOCHEMICAL",colnames(a)))] if(database == "BG") a=a[,c(1:10,grep("^GENETIC",colnames(a)))] if(database == "BGb") a=a[,c(1:10,grep(...
c8cba68641d438a4b3b34aa1fbb8a2a887042bedaaa8c402f281c65f4cc315da
R
4,202
81
# SPEC-RICHR-014: all fixture rows have overlapping genes except the explicit control. .review014_inputs <- function() { a <- .m61_fp3() b <- a; b@result$Pvalue <- c(0.02, 0.03, 0.04) b@result$Padj <- c(0.025, 0.035, 0.045) b@result$Significant <- c(12, 13, 14) # Repeated identifiers within a source must also...
5bfdae04103b10f77d458530c4edf50dd7e88df580a8bf46d8629759f951f65e
R
4,291
106
setwd("~/Desktop/INTACT6/bivalency/") library(ggplot2) library(reshape) ####### ### riboTag D1 gencode vM23 cuffdiff D1_bivalency <- read.table("D1_RPKM_bivalency_gencode_vM23.txt", header = TRUE) D1_bivalency$bivalency_status <- factor(D1_bivalency$bivalency_status, levels = c("none", "H3K4me3", "H3K27me3", "Bival...
d9241cf94a834e4b1c880bce1bde3863829c1923dcba45338b22394210d978af
R
4,397
92
microglia_umap_data <- filter(disease_cell_overlap, FlowSOM_ids == "microglia") microglia_umap_data <- left_join(microglia_umap_data, master_gated_anat2[,c("spatial_id","anat_id")]) microglia_umap_data <- filter(microglia_umap_data, anat_id %in% c("DG","CA4","CA3","CA2","CA1")) n_sub_fraction <- 554 #total Ctrl microg...
8d1074146945076fad10afcf44bc8311a86505c8064dd8a892e07481c61727c9
R
4,414
121
#' Extra conversions to Seurat objects #' #' @inheritParams Seurat::as.Seurat #' #' @rdname as.Seurat.extras #' @name as.Seurat #' #' @seealso \code{\link[Seurat]{as.Seurat}} #' #' @aliases as.Seurat #' NULL #' @param method Name of matching method graph was built using #' @param reduction Name of graph embedding, if ...
9ddbc0e537942fd7024fd7badc4dafab340fffdd5027285bea6aff3e31549d4f
R
4,417
115
#Generates DSAVE data for the clusters, decides which are large enough, and #saves the DSAVE data, and generates bootstrap data for the selected clusters library(tidyverse) memory.limit(size = 100000) fig__dir = "D:/SingleCellModeling/MetAtlas/Figures/" library(Matrix.utils) #for transpose of sparse matrix sparseMa...
4d3af2c3070d53a49aae84a7918028e9d4df626bbea4a89db949dc6fe6c39853
R
4,495
96
wd <- getwd() library(Seurat) library(dplyr) library(ggplot2) samples <- paste0("4361-RG-",1:4) s.1.obj <- Read10X("Y:/CDBLabs-Bioinformatics/Some_Place_Where_Big_Files_Can_Sit/Giger_2022_CellRangerFiles/Distal_Injury/4361-RG-1/filtered_feature_bc_matrix") %>% CreateSeuratObject(project=samples[1]) s.2.obj <- Read10X(...
82c7367aa41991dc79fd4207b9bbee6dc6bcb3e16933a04b37a82af78369493d
R
4,502
108
#' Batch enrichment analysis across multiple gene lists #' #' Runs enrichment analysis on a named list of gene vectors and returns #' combined results ready for \code{richCompareDot()} visualization. #' #' @param gene_lists Named list of character vectors (gene IDs per group) #' @param annot Annot object or annotation ...
ebcc9c55203d90fbf29a76a4c8fd7671ce59d0cdb3e909f9c67023798b5196c4
R
4,505
161
--- 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%" ) ``` # sigminer.prediction <!-- badges: start --> [![Lifecycle: experim...
45e3b7a3b4b2f4e4bd1932e5b2abb35a6e4497365c44bf1eb4782b9979e2817b
R
4,508
93
--- title: "Highlighting the Power of Gene Set Enrichment Analysis using Simulation" author: "Jean Fan" date: "December 23, 2015" output: rmarkdown::html_document vignette: > %\VignetteIndexEntry{Highlighting the Power of Gene Set Enrichment Analysis using Simulation} %\VignetteEngine{knitr::rmarkdown} %\Vignette...
555ffaabd5f6ff5ccf5c3ca220bcc147d3bda63024bcb42ae78910e0ac9d5fc5
R
4,512
127
library(missMDA) library(RColorBrewer) library(plyr) library(preprocessCore) library(ggplot2) c=readme("all_HLs_human.txt.gz",gzip=T) c$Bazzini_ActD_HeLa_1 = -1*c$Bazzini_ActD_HeLa_1 c$Bazzini_ActD_RPE_1 = -1*c$Bazzini_ActD_RPE_1 c$Akimitsu2_BrU4sU_HeLa_1 = -1*c$Akimitsu2_BrU4sU_HeLa_1 c$Marks_ActD_HeLa_1 = -1*c$Mark...
a2358c37f669e72a6a269036efc7607f4506d1cff2716288a50bed325cb48486
R
4,513
106
## BART: Bayesian Additive Regression Trees ## Copyright (C) 2020 Robert McCulloch and Rodney Sparapani ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or #...
d2939542c9aca45976c04c718ca2e3f073e78a8818195ce32d646f54b55c2b4e
R
4,515
139
# ---------------------------------------------------------------------------- # build_mouse_tree.R # Author: Antoine Beauchamp # Created: January 31st, 2022 # # Build a gene expression tree # # Description # ----------- # This script maps the values from a voxel-wise expression matrix to the # Allen Mouse Brain Atlas ...
27a585c036e638ddd0e70dae5221b9a501ad8c2454628e79bb35f103e6b6bb20
R
4,541
102
encoding_identity_pair <- function(text = "té") { utf8 <- enc2utf8(text) latin1 <- iconv(utf8, from = "UTF-8", to = "latin1") Encoding(latin1) <- "latin1" c(utf8, latin1) } test_that("native groups and counts use text identity across encodings", { pair <- encoding_identity_pair() expect_identical(length(un...
6e7c0a5f5990b14f3c8cedac20b1a5efef4387b75ff5e2ea58464614f7a2ddef
R
4,557
92
--- title: "Benchmarking Visualization" author: "Will Townes" output: html_document --- ```{r} library(tidyverse) theme_set(theme_bw()) fp<-file.path pth<-"scrna/xyzeq_liver" plt_pth<-fp(pth,"results/plots") if(!dir.exists(plt_pth)){ dir.create(plt_pth,recursive=TRUE) } ``` ```{r} d0<-read.csv(fp(pth,"results/ben...
9091d8fcebd58b6728732d759fdbc76575d80994ceadc7ba715d02a6d7be7bac
R
4,570
124
library(glmnet) database = args[1] #name of database & subset of features to evaluate #half lives, kmer freqs, & codon freqs features a=readme("seqFeatWithKmerFreqs.txt.gz",gzip=T) if(database == "B") a=a[,1:10] if(database == "BC") a=a[,c(1:10,grep("Codon",colnames(a)))] if(database == "B5") a=a[,c(1:10,grep("5UTR"...
eb478363b12bf565039e883ef3af39b64c9e0689eb6e4376533521b806e39b62
R
4,581
107
library(glmnet) database = args[1] #name of database {choose a code below} load("alldata.RData") if(database == "B") a=a[,1:10] if(database == "BE") a=a[,c(1:10,grep("^ENCORI",colnames(a)))] if(database == "BP") a=a[,c(1:10,grep("^PARCLIP",colnames(a)))] if(database == "BR") a=a[,c(1:10,grep("^RIP|^TE",colnames(a)))...
2c9e87bdd4b196f6136efacf85a4ed5a3b93116cb41c246107844b5f510bee87
R
4,669
125
library(glmnet) database = args[1] #name of database & subset of features to evaluate #half lives, kmer freqs, & codon freqs features a=readme("seqFeatWithKmerFreqs.txt.gz",gzip=T) if(database == "B") a=a[,1:10] if(database == "BC") a=a[,c(1:10,grep("Codon",colnames(a)))] if(database == "B5") a=a[,c(1:10,grep("5UTR"...
14da1e2ad56b6de5411e6db8c41ea3f521ee40bbb3844c5f0e54d83f5110bbb9
R
4,683
97
--- output: github_document --- <!-- README.md is generated from README.Rmd. Please edit that file --> ```{r, echo = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-" ) ``` # dabestr <img src="man/figures/logo.png" align="right" height="139" /></a> <!-- badges: st...
f949fd7ceeb4ead729a99f2cd3562396f34738f0bde128b28903d739cae6a494
R
4,687
131
#' @include internal.R #' NULL #' Run fastMNN in Seurat 5 #' #' @param object A merged seurat object #' @param groups A one-column data frame with grouping information #' @param layers Layers to use #' @param assay Assay to use, defaults to the default assay of the first object #' @param features Either a list of feat...
4a79961530e958b1db5bfb88f7bbde92fdd043a7dc04987636d148cf5200cd44
R
4,697
155
--- title: "Homologous gene enrichment" author: "Antoine Beauchamp" date: '2022-07-25' output: html_document: theme: paper highlight: pygments toc: true df_print: paged --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` # Packages ```{r} suppressPackageStartupMessages(library(t...
6023aa36c2688623b0889435f7a3c665311c9cf9adc32acaaf092c3b9e67c79e
R
4,712
133
#' Performs F-tests for transformed cell type proportions #' #' This function is called by \code{propeller} and performs F-tests between #' multiple experimental groups or conditions (> 2) on transformed cell type #' proportions. #' #' In order to run this function, the user needs to run the #' \code{getTransformedPro...
5ece19954c8cf4caafafda8e0389b74806700d282da356e6bd516adb08a23a3e
R
4,727
118
libs <- c('ggplot2','RColorBrewer','reshape2','devtools','readr', 'pheatmap','flowCore','plyr','scales','coin','grid', 'gridExtra','tidyr','randomcoloR','viridis','tidyverse') for (L in libs){ if(!require(L, character.only = T)) { install.packages(L, dep = T, quiet = T) if (!require(...
da9fba596642e301ed9a87f857f6d4050c5c11998956731227fec6c262b1292b
R
4,755
178
a=read.table('Kendall.txt',header=T,sep='\t') a[,2]=as.character(a[,2]) a[which(a[,2]=='Oligodendrocyte.Precursor.Cell'),2]='Oligodendrocyte' a[which(a[,2]=='Myelinating.Oligodendrocytes'),2]='Oligodendrocyte' a[which(a[,2]=='Newly.Formed.Oligodendrocyte'),2]='Oligodendrocyte' K=a a=read.table('Multinomial.txt',head...
01ba19c0cb45b3a45b84330a67973260480604cc26b4f8f015e323021353e02a
R
4,774
120
package_data_reference <- function(name) { reference <- new.env(parent = emptyenv()) utils::data(list = name, package = "richR", envir = reference) reference } with_global_data_state <- function(values = list(), absent = character(), code) { names_to_restore <- unique(c(names(values), absent)) previous <- la...
7ee7d38bb5a2aa2d1e9dcf4dc82e38ccea7f5462cf89511e9bd421f4a1ed53d6
R
4,788
112
library(ggplot2) library(glmnet) library(LSD) a=read.csv("experimentResults.csv") round(a,3) results = data.frame(tests = c("B vs BP","B vs BM","B vs BR","B vs Be","B vs BE", "BE vs BER","BE vs BEM","BE vs BEe","BEe vs BEeM"), pvals = c(t.test(a$B, a$BP, paired=T,alternative='less')$p.value, t.test(a$B, a$BM, paired=...
03c47373ebb105e6d6b6bf43efbfe7a2d45aeb2181be4f2cbdffd5edfdca4cf0
R
4,800
101
# Reactome identity against the real reactome.db provider (Suggests; local, no # network). Guards the in-memory maps of test-reactome-identity.R against # drifting from the shape of the real maps. reactome.db is loaded, never attached. # Fork-only: also holds the result-label checks (ORA Term, GSEA Term) that the # ups...
4d136acde1cfa39da942926c080002a250c416c04d24e9c6c3462d9a757e3f0c
R
4,804
160
# ---------------------------------------------------------------------------- # process_labelled_matrix.R # Antoine Beauchamp # Created: August 25th, 2021 # # Process a labelled gene expression matrix # # Description # ----------- # This script implements processing for a labelled gene expression matrix # by scaling t...
4bd8f4afdf0601810eca48ac28f8654d14dfb0800474808fbc66ac2840a5331b
R
4,838
136
load('TSNE.RData') library('Seurat') source('scRef.R') ori_label=read.table('Zeisel_exp_sc_mat_cluster_original.txt',header=T,sep='\t') pbmc@meta.data$ori=ori_label[,2] #TSNEPlot(pbmc, group.by="ori") table(pbmc@meta.data$ori) ####### Data preparation ############## ref_vec=pbmc@dr$tsne@cell.embeddings USE=which(pbm...
525c245612229acab71a30d5b7cae43f3cd0d8b699928e11f10a74567bc9eb1c
R
4,838
119
# Characterization baseline (REQ-003): GSEA NES / ES / pval / padj / leadingEdge # for a fixture ranked list under a fixed seed, as produced by richR 0.1.5. # The fgsea version is part of every exact-numeric snapshot (key # `fgsea_version`) so a diff caused by an fgsea upgrade can be told apart from # one caused by ric...
410b006b4a97940a3b49e84912227a3c1458004245ef15cf998af1487f24272a
R
4,846
146
## BART: Bayesian Additive Regression Trees ## Copyright (C) 2017-2021 Robert McCulloch and Rodney Sparapani ## bartModelMatrix.R ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either vers...
a145ebed02002580be9dc787115b2a73b2843010345e58250b77f0e1635138a7
R
4,848
164
library(biomaRt) library(tidyr) library(ggplot2) ensembl = useMart(host='ensembl.org', biomart='ENSEMBL_MART_ENSEMBL', dataset='mmusculus_gene_ensembl') annotations = getBM(attributes=c('ensembl_gene_id', 'external_gene_name','refseq_mrna', "chromosome_name"), mart = ensembl) head(annotations,10) validchr = c(1:100,'X...
0a792d2a08a6ce9a898db8a400f2be1305c8886de7dc754eb0cf29d60cec4343
R
4,859
121
## BART: Bayesian Additive Regression Trees ## Copyright (C) 2017-2020 Robert McCulloch and Rodney Sparapani ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License,...
25ee5e29ba14a2604d4755bbfb4fe0b97fe1f81b21e5fc63eae4b7a16a29e99f
R
4,866
177
#' @importFrom BiocManager install #' @importFrom remotes install_github #' @importFrom Seurat IsGlobal Reductions #' NULL #' @docType package #' @name SeuratWrappers-package #' @rdname SeuratWrappers-package #' "_PACKAGE" # Set a default value if an object is null # # @param lhs An object to set if it's null # @para...
8d7e434ea47fb930a7c560b2b73e450012cc3b513a1f9dbd6fa6a51a615bde0b
R
4,872
130
# Description: script to run coloc analyses using eQTLGen #---Import data and libraries----------------------------------------- library(BSgenome) library(coloc) library(colochelpR) library(data.table) library(here) library(MafDb.1Kgenomes.phase3.hs37d5) library(tidyverse) RBD_tidy_w_varbeta <- fread("/home/rrey...
dc21d92cd3f66c4100c95929e3cbfdd83c2375a0ac724653dc4588af2993b07e
R
4,876
169
## PERMANOVA script rm(list = ls()) source("src/load_packages.R") source("src/miscellaneous_funcs.R") source("src/load_phyloseq_obj.R") source("src/metadata_prep_funcs.R") load("files/Phyloseq_objects_Woltka/Species_PhyloseqObj.RData") #------------------------------------------------------------------------------- ...
f97cd396445f87363cca0f6db3ca04c5a771b20dbdff7fe6f8d4a9baf38d3444
R
4,891
105
batch_test_annotation <- function() { data.frame( GeneID = LETTERS[1:6], Annot = rep(c("T1", "T2", "T3"), each = 2), Term = rep(c("Term one", "Term two", "Term three"), each = 2) ) } test_that("batchEnrich combines exact returned rows and reports every group outcome", { annot <- batch_test_annotation...
1ba058b4879ba16ee7b43b1ea289c956c6cbefe558e6eca42ddaeab40793cea9
R
4,932
193
#' Contains custom <ggproto> geom_objects for plotting. #' #' List of geom_*: #' - `geom_halfviolin` #' - `geom_bootci`, #' - `geom_proportionbar` #' - `geom_sankeyflow`. #' #' @importFrom ggplot2 .pt #' @noRd # Halfviolin Geom draw_group_halfviolin <- function(data, panel_scales, coord) { coords <- coord$transform(d...
ea4b32e7779a5bc11d1c921a4bbaed1b19c94938afd9a9667613379cd6fc3813
R
4,941
110
## data-raw/path.R -- rebuild data/path.rda (object `path`). ## ## Last run for richR 0.2.0 (SPEC-RICHR-003 M3.6). Running this script replaces ## data/path.rda with a fresh KEGG snapshot, so run it only when an annotation ## refresh is intended. The result depends on live KEGG on the day it runs and ## is not byte-rep...
7d8e7d66e6fe870312bfb158b9daaeb547ac8394e0266205b8d24def04fa2d85
R
5,006
199
#' Intersect gene homologs #' #' @param data #' @param homologs #' #' @return intersectGeneHomologs <- function(data, homologs){ require(data.tree) require(assertive) #Check that data is a named list assert_is_list(data) assert_has_names(data) #Check that names are Mouse and Human if(!(any(c("M...
486f7f59239913c27c4f7c8da24706d827580b5392af9838b4ba64569ff4936c
R
5,016
143
#' Performs t-tests of transformed cell type proportions #' #' This function is called by \code{propeller} and performs t-tests between two #' experimental groups or conditions on the transformed cell type proportions. #' #' In order to run this function, the user needs to run the #' \code{getTransformedProps} function...
9eb0b0e74b9e2773cf1b4a3791deefdfb2ce44d8657ec859ad1954bb8e2526c9
R
5,016
133
describe("Testing create_df_for_tufte function", { describe("Given effsize_type is median_diff", { test_that("it should return calculations for tufte lines based on median", { np_dataset <- generate_non_proportional_dataset() result <- create_df_for_tufte( raw_data = np_dataset, enquo_...
7d039ac0d455943a3e372d2b1a9bf6b2a717e97f4845880893dc3366a775f9d9
R
5,047
175
describe("Testing validate_load_params function", { # pre-loading all dataset types np_dataset <- generate_non_proportional_dataset() p_dataset <- generate_proportional_dataset() # for paired data test np_dataset_trunc <- np_dataset[-2, ] test_that("it should detect invalid x value", { expect_error(...
02849c5588df6685478dc5e370c599105e63afcda75128a156b7b430e8e7ee55
R
5,104
135
library(R.matlab) library(tidyverse) library(ggplot2) library(ggpubr) fig____path = "Z:/projects/Single-cell modeling/figures/" setwd("C:/Work/MatlabCode/projects/SingleCellModeling/SingleCellModeling") ################################################### #New tINIT #################################################...
88af45fadb64469c7c24737d31c4ea10c49ea5bf98f98e99fa9144bfd5102756
R
5,110
131
--- title: "Integrating Seurat objects using LIGER" date: 'Compiled: `r format(Sys.Date(), "%B %d, %Y")`' output: github_document: html_preview: true toc: true toc_depth: 3 fig_width: 16 html_document: df_print: kable theme: united fig_height: 5 fig_width: 16 out_height: 4 --- ...