sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
67396ada14967b01d69ebc4cd9344b11f59f1e94f2d23fd05500d6c18adec6fb
R
2,823
91
# Build the par_snp txt file based on the manifest file # Written by Lucia Trastulla -- email: lucia_trastulla@psych.mpg.de suppressPackageStartupMessages(library(argparse)) parser <- ArgumentParser(description = "Write PAR file for each SNP in the manifest file" ) parser$add_argument("--manifest_file", type = "char...
3ed70804abc39baffd65492f027119e374746ca37d8e5197fba9db479e9a7774
R
2,848
85
#' @importFrom Rcpp evalCpp #' @importFrom Matrix colSums rowSums t summary #' @importFrom rlang .data %||% #' @importFrom methods new show #' @importFrom utils .DollarNames #' @useDynLib rliger, .registration = TRUE NULL #' @importFrom magrittr %>% #' @export magrittr::`%>%` #' @importFrom magrittr %<>% #' @export m...
e7a8bb15340070cffe87dafd615c2287a11fff9935ec29a558119d3c4e726b30
R
2,862
108
library(GenomicRanges) library(ArchR) library(stringr) library(dplyr) library(BSgenome.Hsapiens.UCSC.hg38) addArchRThreads(threads = 60) addArchRGenome("hg38") ## use hg38 ### -------------------------- ## 1. read in Arrow files ### -------------------------- setwd("./01_Fragments/all_arrow") ArrowFiles <- list....
9bc701f3211d000837185402fb75635e2335afd3e0e96d1cdcd70415d626029f
R
2,878
87
### AUROC Violin plot AUROC <- read.table("AUROC_table.txt", header = T, sep = "\t") dim(AUROC) AUROC colnames(AUROC) <- c("Organism", "Operon-mapper", "Rockhopper", "Operon Finder", "OperonSEQer", "OpDetect") library(ggplot2) AUROC_stack <- stack(AUROC[,2:6]) AUROC_stack[,"ind"] <- as.factor(AUROC_stack[,"ind"])...
d79ad5d2941ecac1673bae5fc787e4690cc91b0d6ed1f5601cc83c0eb4fd15e7
R
2,881
88
--- title: "Relative fragment size plot and ROC for all 11 SCLC cases vs. all healthies" site: workflowr::wflow_site output: workflowr::wflow_html: code_folding: hide toc: true editor_options: chunk_output_type: console --- ```{r caching, echo=FALSE} knitr::opts_chunk$set(autodep = TRUE, echo=FALSE) ``` ...
7fd599fe6aa490554886db2c79d7bb9e6641bca3c80aeb69a871f951cc1f356c
R
2,886
95
### Author : Marie-Michelle Simon ### Date : April 30th, 2023 ### Principal component analysis (PCA) for WT and KO condition comparison in RNA-Seq libraries ### Goal : Generate PCA plot ### Type of samples : myofibers, muscle stem cells (musc) and myoblasts (myob) #setwd("~/Library/Mobile Documents/com~apple~CloudD...
519b7f2fd8b7269e1538805d57712ec5ef69bbe11e67b39c1fa53e6c6cf7044b
R
2,911
85
# Load required packages library(nebula) # For differential expression analysis using Negative Binomial GLMM library(Seurat) # For handling single-cell data # Define input and output directories indir <- "./indir/" out_dir <- "./outdir/" # Read command line arguments argv <- commandArgs(T) name <- argv[1] # Cell t...
1152ddcb8018b8598f76068374b24d07376a50e7a8cc7e74712f6cf98442f355
R
2,982
57
library('tidyverse') source('helper.R') library('matrixStats') ###---------------------------------------------------------------------------------------------------------- ##-- violin plot for distributions of r ###--- Supplementary Fig. 1a ---### info.r <- read.table('../Data/Linear_regression/Info_linear_regression...
66f741d743a7968fbefb358fb319de594e0ae4e2464e453e4ea867adb7feb29d
R
2,983
72
library(Seurat) library(harmony) library(patchwork) library(ggplot2) library(viridis) library(pheatmap) library(reshape2) MTC = readRDS("data/MTC.rds") vizgen.obj = readRDS("data/Sample_0601_filtered_50_log.rds") genes_sjp = c("Nrxn1","Nrxn2","Nrxn3", "Nxph1","Nxph2","Nxph3","Nxph4", "Nlgn1...
f9bcc671218eb1909c2115882f05e060ae2aca3e29bbfe0e28a284d27e25495a
R
3,038
55
EMP_COR_FIT <- function(data,meta = NULL,var_select,formula = y~poly(x,1,raw = T),eq_size=3,se = F,group = F,width = 5, height = 5,palette=c("#E64B35FF","#4DBBD5FF","#00A087FF","#3C5488FF","#F39B7FFF","#8491B4FF", ...
5bcf5401388deef67e6780d143c197c1bc43303a0f7f730f378801ab96a7e203
R
3,055
92
### This script creates an R function to generate raincloud plots, then simulates ### data for plots. If using for your own data, you only need lines 1-80. ### It relies largely on code previously written by David Robinson ### (https://gist.github.com/dgrtwo/eb7750e74997891d7c20) ### and the package ggplot2 by Hadley W...
2138c1dbf18fbe7c980217bb5d0b47178531ac8f657c4b71f7f4b04a114a3a11
R
3,062
60
# Plot quality control for samples # Written by Lucia Trastulla -- email: lucia_trastulla@psych.mpg.de suppressPackageStartupMessages(library(argparse)) suppressPackageStartupMessages(library('ggplot2')) suppressPackageStartupMessages(library('RColorBrewer')) suppressPackageStartupMessages(library('ggrepel')) parser...
655e303c58a53d2696a91622eb40ecfed14b92e90411eb5253d82bcddddc74b0
R
3,072
107
library(Seurat);library(ggplot2); library(dplyr) library(tidyverse) library(SeuratWrappers) library(uwot) adPC <- readRDS("adPC.RDS") DefaultAssay(adPC) <- "RNA" ref <- adPC ref$subcluster = gsub("Purkinje_","", ref$subcluster) Idents(ref) <- ref$subcluster ref <- RenameIdents(ref, "Aldoc_1"="Aldoc","Aldoc_2"="Aldoc...
4adc4de6e2a5b53c66056f1b592666a9e5460ecb7e4c50fc96f0b0de202e57b9
R
3,089
110
--- title: "Report8" author: "Jamie Medina" date: "2/19/2021" output: html_document --- # Final Figure Requested for Reviewer Comment ![Schematic to follow by Dimitrios](./image.png) ```{r background, echo=FALSE, include=FALSE} ################################### # Task: Predict # Created: 012221 # Due date: Monday ...
d07892772bfabe2247f865da4528396c979b5d55a4b1d359eca760c7403f88da
R
3,108
61
--- title: "Data integration with LIGER" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Data integration with LIGER} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) ``` ## Introduction LIGER...
d297198fb7916f20d4018f4730ce2a45ab2b3b2d5eb905ca3c965131e108983d
R
3,110
100
#' @export get_cv_preds<-function(features,model) { features <- features %>% dplyr::mutate(rowIndex = 1:n()) ids <- features %>% select(id, rowIndex,type) preds <- model$pred preds <- preds %>% dplyr::group_by(rowIndex) %>% dplyr::summarize(score = mean(cancer)) preds <- inner_join(ids, preds, by="rowIndex") pre...
664a05ee3f97c1ce6c1f4ef75d2cb7ac08c2272377181270abe406a373964080
R
3,136
64
### Author : Marie-Michelle Simon ### Date : October 3rd, 2024 ### Using as input the list of genes not expressed in musc, myoblast and mf (i.e. non-muscle genes) and annotated to H4K3me3 peaks in musc, the objective is to extract the region + or - 1 KB of TSS ### of those genes ### Goal : generate an input file (con...
697c5c05325e496212b0b041d024e6ceab271ffb0498d8a92a854401b56b7f08
R
3,140
89
#' @importFrom corrplot corrplot cor_plot_detail <-function(data,meta_data = NULL,method = 'spearman',width=10,height=10,cor_output=T,file_name='cor_plot'){ deposit <- list() try(data <- subset(data,select = -c(Group)), silent = T) if (!is.null(meta_data)) { cor_data_combie <- dplyr::inner_join(data,meta_d...
970fc0a84e8dc90533f08f88785d14b6ac92c0222450da94984b5877ff871025
R
3,142
106
--- title: "PCAWGROCs" output: workflowr::wflow_html: toc: false editor_options: chunk_output_type: console --- ROCs for PCAWG T vs N ```{r} library(here) library(data.table) library(tidyverse) library(devtools) library(ggplot2) library(ggpubr) library(cowplot) #load_all("~/Dropbox/useful.stuff.aa") ...
d155fd79bd69047199dd4b48fc471ac0b3fbe7691eacdea3224973de9da9fd96
R
3,215
89
# List of your required packages required_packages <- c( "lme4", # For fitting linear mixed-effects models "pbkrtest", # For Kenward-Roger approximation for mixed models "simpleboot", # For simple bootstrap methods "lmeresampler",# For resampling methods for mixed models "foreach", # For loopin...
277c16894b0a5e9a8e75c50aeb753baafdeae3200fa86b118059fd6f71eee0be
R
3,241
107
#'\code{assignPROGENyScores} #' #'@details This function is used to assign the PROGENy weights to pathway #'members for a selected set of samples. #' #'@param progeny contains the progeny scores as obtained from \code{runPROGENy}. #'@param progenyMembers contains the list of members for each PROGENy pathway. #'@param ...
4d279acaeb957362fdf47b00f06ccbe41d1fdd9e3ca7eebfe70468d3e0c5f864
R
3,253
37
# This function makes an expression figure showing the relative expression and standard deviation of cases and controls. # Datasets is a vector of dataset names. CellTypeLevel indicates the cell type level resolution (e.g. "predicted.celltype.l1"). # CaseName is a string naming what cases are called in the dataset, su...
c338d21209d8c0ed33f479ffc684f875ceb00b342e0adfc4520f8fe016b38657
R
3,253
101
--- title: "Kaplan-Meier curves by dichotomized DELFI score" site: workflowr::wflow_site output: workflowr::wflow_html: toc: true code_folding: hide editor_options: chunk_output_type: console --- Patients with stage IV adenocarcinoma of the lung. ```{r packages, message=FALSE} library(SummarizedExperim...
e18f2536e56e0272ee5dbfb40de43f415e30b1382e5c5627846e4f46b11ede44
R
3,257
90
### TODO: # ## Read in data.table of fragments, return data.table of density frag.density <- function(fragments, x="w", ..., groups=NULL) { d.list <- function(x, ...) { d <- density(x, ...) list(x=d$x, y=d$y) } ## Add grouping arguments (gc etc) to pass into keyby dens <- fragments[,c...
1e2b89fb009c7d562139e3d6b6d65751e155eaee590cfb6a3bf04e87ed7b5940
R
3,272
77
# Source: https://github.com/dynverse/dynplot/blob/master/R/plot_dimred.R #' Project the waypoints #' @inheritParams add_cell_coloring #' @param waypoints The waypoints to use for projecting, as generated by [dynwrap::select_waypoints()] #' @param trajectory_projection_sd The standard deviation of the gaussian kernel ...
06684dd3a71ce844904a528f8312ccbeebd2249003a20ff6c29977879813bdc7
R
3,290
97
#'\code{generateTFList} #' #'@details This function generates a list of data frames containing activity #'values for each TF. These data-frames can then be used as inputs for the #'CARNIVAL analysis (measObj). We can control the amount of TF's we include in #'our data-frames based on their absolute activity val...
3ec4f9e3ea5d15a943cc2fc0f55cd3f774ddec6ab9452e34de1e9aab15909464
R
3,339
74
--- title: "S15" output: workflowr::wflow_html: toc: false editor_options: chunk_output_type: console --- ```{r TN, echo=FALSE, fig.width=6, fig.height=12, dev=c("png", "pdf")} library(here) library(data.table) library(tidyverse) library(devtools) library(ggplot2) library(ggpubr) library(cowplot) library(readx...
285a399a659d99602de9bab715b4d2918c06a26e98e13fc0f260d3971bae8bad
R
3,371
96
rm(list=ls()) # load libraries library(RCurl) library(RJSONIO) library(jsonlite) library(dplyr) library(foreach) library(doParallel) library(R.utils) # load exp matrix, you can use any other initial feature selection other than DEGs deseq2 <- read.csv("expression_deseq2_results.csv", row.names = 1) #### ------------...
bfa996939615dd2e1aa1bcf5a3a04d63b64750051a47d48555bd0984e9d0b4c9
R
3,371
96
rm(list=ls()) # load libraries library(RCurl) library(RJSONIO) library(jsonlite) library(dplyr) library(foreach) library(doParallel) library(R.utils) # load exp matrix, you can use any other initial feature selection other than DEGs deseq2 <- read.csv("expression_deseq2_results.csv", row.names = 1) #### ------------...
21ae713b1649c4871d5672e2fb856e4171cd8d3b6c08649ea4291c921a249419
R
3,377
90
library(tidyverse) library(caret) library(recipes) library(pROC) library(devtools) library(openxlsx) load_all(here("code","rlucas")) ## -> library(rlucas) features <- read_csv(here("data","training-set.csv")) multinucs <- bins5mb %>% group_by(id) %>% summarize(multinucratio = sum(multinucs)/(sum(short+long))) feature...
41c107fdb6fdff404295f14e1091fc210aa5288d203efc4ef31cb06cef82f685
R
3,381
58
# DISCLOSURE: This is a collection of palettes that includes some original # palettes and some palettes originally implemented by others in other packages. blackbright = c("#090214", "#300f51", "#842152", "#b43033", "#e3551e", "#f5a31c", "#e1c53f", "#eef174") black_yellow_red <- c("#393A3C", "#757374", ...
fb925488cafd50a3d21b94114bb66f5a42a021535780a9f3666ad92aca30b3e7
R
3,387
143
#!/usr/bin/env Rscript library(here) library(data.table) library(stringr) library(lubridate) ### INPUT fpaths <- list( RDS = "adnimerge_baseline" |> sprintf(fmt = "data/rds/%s.rds") |> here(), LST = c( "adni_acquisition_failures.lst", "qrater_malf_2022-12-20.csv", "qrater_malf_reg_fails_2022-12-20....
5d0eb592682d482b792b99e6e52f579af2a78f376db111686fc3014afc3484e9
R
3,392
90
####################### # caret path vs neut # ####################### # read and install libraries if necessary #### if (!require("ggplot2")) install.packages("ggplot2") if (!require("data.table")) install.packages("data.table") if (!require("caret")) install.packages("caret") if (!require("doParallel")) install.pac...
908e1143db054fecc184d1b653b4e5f54e280d0ec5d28d2dffbf76cf59ca76da
R
3,407
135
lastC <- function(x) { y<-sub(" +$", "",x) p1<-nchar(y) cc<-substr(y,p1,p1) return(cc) } orderPvalue <- function (treatment, means, alpha, pvalue, console) { n <- length(means) z <- data.frame(treatment, means) letras<-c(letters[1:26],LETTERS[1:26],1:9,c(".","+","-","*","/","#","$"...
506e5d18ebeb62b7003d1f7b39937abe8db5b9d769c6db2c3c1c978d439361c3
R
3,409
86
data_image<-readRDS(".../codes revised/reproducibility/output from the server/real_data/pseudo_data.rds") fxca<-cor.test(data_image$X21003.2.0,data_image$FX,method = "kendall") fx_ca<-ggplot(data_image, aes(x = X21003.2.0, y = FX)) + geom_point(alpha = 0.5, color="lemonchiffon",size=3) + stat_density2d(aes(fil...
6974d72187ec2af3db25e0cb7d1bfc313f5918a26a051955d78053d398663842
R
3,424
115
--- title: "Distribution of CEA scores by diagnosis group: Extended data Figure 8" site: workflowr::wflow_site date: "`r format(Sys.time(), '%d %B, %Y')`" output: html_document: code_folding: hide chunk_output_type: console --- ```{r caching, echo=FALSE} knitr::opts_chunk$set(autodep = TRUE) ``` ```...
52d7ec9f6f6e05c4a213b2b5adafac74c99ee6092d2f16842ff55aec6f6fe967
R
3,431
106
rm(list=ls()) # load libraries library(RCurl) library(RJSONIO) library(jsonlite) library(dplyr) library(foreach) library(doParallel) library(R.utils) library(httr) # load exp matrix, you can use any other initial feature selection other than DEGs deseq2 <- read.csv("expression_deseq2_results.csv", row.names = 1) ###...
d9c1ffa184d75ac2b01db6e2f7530ff47b81909da4a629a06fc309a999be7e65
R
3,434
106
rm(list=ls()) # load libraries library(RCurl) library(RJSONIO) library(jsonlite) library(dplyr) library(foreach) library(doParallel) library(R.utils) library(httr) # load exp matrix, you can use any other initial feature selection other than DEGs deseq2 <- read.csv("expression_deseq2_results.csv", row.names = 1) ###...
8563a7391ce3213888df1f04eaf1f4eb113cec6eb631fc7907d92d54ca616762
R
3,446
97
--- title: "PCAWGROCs" output: workflowr::wflow_html: toc: false editor_options: chunk_output_type: console --- ROCs for PCAWG T vs N ```{r} library(here) library(data.table) library(tidyverse) library(devtools) library(ggplot2) library(ggpubr) library(cowplot) load_all("~/Dropbox/useful.stuff.aa") ...
677d2f52ac4d1fde35cdc35827efda16df55915d25098b534e1b5aa2aabd9e5f
R
3,490
119
# Refresh the R session to clear the environment # This ensures that any previous objects, functions, or loaded packages are removed. freshr::freshr() # Verify the working directory print(getwd()) # Should print the path to your working directory # Load necessary libraries # These libraries provide various functions ...
272cad7ceec76b0247cd7d7d930048ff8ea36973235b84647734fb649b1724a2
R
3,505
42
# This code permutes sex. It requires the following: DatasetName (a string with the name of the Dataset in PresenceofDataTable) # PresenceofDataTable (a table indicating whether the dataset has cells for each cell type), CellTypeName (a string indicating what is the cell type label, such as "predicted.celltype.l1"), # ...
f3ad534ad23e8deadafea0576fda9c3173a440faa5124379456846056b922d5d
R
3,540
96
# Description #### # Longitudinal plots to characterize our data # Set environment #### rm(list= ls())# ctrl + L to clear console setwd("~/Documents/GitHub/Striatocortical-connectivity-FEPtrt/LongitudinalPLOT/") #setwd("/Users/brainsur/Desktop/GitHub_repos/Striatocortical-connectivity-FEPtrt/LongitudinalPLOT") librar...
0859b6ac6b6c9072ed4fc2fca5868bcd010b8009555edbe2b6db0e6ad6c4ebdd
R
3,576
44
# This code permutes cases and controls. It requires the following: DatasetName (a string with the name of the Dataset in PresenceofDataTable) # PresenceofDataTable (a table indicating whether the dataset has cells for each cell type), CellTypeLevel (a string indicating what is the cell type label, such as "predicted.c...
f82f40f6e704c1e4a96e5a58a99a3b53d4a06102f404356788f22d0a80320447
R
3,591
100
#' @rdname peak #' @export setMethod("rawPeak", signature(x = "ligerATACDataset", dataset = "missing"), function(x, dataset = NULL) { x@rawPeak }) #' @rdname peak #' @export setReplaceMethod( "rawPeak", signature(x = "ligerATACDataset", dataset = "missing"), function(x, d...
da2f98c1504ebba913c1fbad06929bc755c1d676b9ba9328ff48529afebbb1b2
R
3,602
67
library(Seurat);library(tidyverse) # merging all samples cdS1 <- readRDS("Multiplexed/integration_P1cKO/data/integrate_celltype.rds") cdS2 <- readRDS("Multiplexed/Integration_P2-deficient/data/P2-deficient_filtered.rds") cdS <- merge(cdS1, cdS2) #feature.common = Reduce(intersect, list(rownames(cdS1),rownames(cdS2)));l...
d5c94f356fd19091dbee1664e88e7c8299ec0cce6f7a076003efb12baddafd88
R
3,631
84
# upsampling function to have same numbers of scn,cac,lof,gof func = function (x, y) { # which of the four class x scn combos is highest? -> upsample all data to that! xup <- if (is.data.frame(x)) x else as.data.frame(x) xup$Class <- y frqtab <- data.frame(table(xup[,c("Class", "scn")])) # frquency table frq...
0b5b2f92f85762844c67c7723697252410e6f0572f3daf99e45b946de5ce6a54
R
3,659
94
--- title: "About" output: workflowr::wflow_html: toc: false editor_options: chunk_output_type: console --- ```{r} library(tidyverse) library(here) library(readxl) library(data.table) novel<-fread(here("data","NoveltyTables","Subfamily.csv")) a<-fread(here("data","Supp_Tables","s6_All_features.csv")) a<-a %>% ...
49ffff6036399953b5a0a48490b9c34698111d90d8a1ac8419e4f2051a8deaea
R
3,665
63
library('tidyverse') source('helper.R') count_cutoff <- 50 # Nanopore data from Lee et al. (PMID: 38306272) ont <- read_delim('../Data/Mouse_oocytes/MM_oocyte_tail_lengths_Nanopore_Lee_2024_PMID_38306272.txt', delim = '\t') %>% rename_with(~ c('stage', 'gene_id', 'gene_name', 'count', 'tl_gmean', 'tl_mean', 'tl_med...
4ca423523ccb280bc943de9dcfe90a796b7d03bcf8d18235e3d08cff63496f88
R
3,666
111
# Scripts to quantify iNM and eNM from NM brightfield image analyses using 'TrueAI' as part of VS200 software library(readxl) library(ggplot2) library(dplyr) library(plyr) library(ggpubr) library(MASS) theme_set(theme_minimal()) ############### ### Inputs ### ############### analysis_dir <- "/Users/zacc/USyd/NM_anal...
37aed7b3023e2daed77e659884014bdfd0c03e25acef3cc4f48f42b7bf182ff4
R
3,709
81
library(Seurat) library(dplyr) library(Azimuth) library(SeuratData) library(presto) library(car) ##### Step 1: Obtain cell types by mapping to Azimuth reference # Download Azimuth human motor cortex reference from here: https://zenodo.org/records/4546932 # Load Azimuth human motor cortex CortexRef = readRDS("ref.Rd...
f88df51f97de2962a965409d41bb9a1b45b3d420483017f7c44aa21c92da8bd8
R
3,715
148
#!/usr/bin/env Rscript library(here) library(data.table) ### INPUT fpaths <- list( RDS = c("adni-bl_volumes_hcvc", "adnimerge_baseline") |> sprintf(fmt = "data/rds/%s.rds") |> here(), CSV = c( "UCSFFSX_11_02_15_20Nov2023", "UCSFFSX51_11_08_19_20Nov2023", "ADNI_FS_hc", "ADNI_FS_hc_vc" ) |> spr...
bfb8091378c8d1fac22b7ca3d6f1fa48f8186124f1c957e5e9578e978b29eda3
R
3,720
96
library(BayesFactor) # metaBF: combining t-values of pilot and full sample into a meta-analytical Bayes Factor # t = (t-value pilot, t-value full sample) # Unrounded t-values are found in the corresponding JASP and HTML files (pilot or full) # n1 = (n_participants HS pilot, n_participants HS full) # n2 = (n_...
cbb8cbf1024969d092f94f7b75950305ebe001c21ea4cb0bec393e0fd209e5f5
R
3,767
104
library('signs') library('Cairo') library('viridis') library('RColorBrewer') custom_breaks <- function(bmin, bmax, digits = 0, length.out = 8, zero = TRUE) { bmin = floor(bmin * (10 ^ digits)) / (10 ^ digits) bmax = ceiling(bmax * (10 ^ digits)) / (10 ^ digits) if (bmin > 0 | bmax < 0) zero = FALSE d = round((bmax...
46c24c6d0eb90def4cb122316cfd114122e2b88c2b7030c86b17222544db3e8f
R
3,774
93
library('ggplot2') library('Cairo') library('RColorBrewer') library('signs', quietly = T) custom_breaks <- function(bmin, bmax, digits = 0, length.out = 8, zero = TRUE) { bmin = floor(bmin * (10 ^ digits)) / (10 ^ digits) bmax = ceiling(bmax * (10 ^ digits)) / (10 ^ digits) if (bmin > 0 | bmax < 0) zero = FALSE d ...
684d722582330987d64f7aa220890bc6aa365f370e8722fddfa851734e866d26
R
3,818
94
EMP_COR_RDA <- function(data, meta, seed =123,width = 15, height = 15, ellipse = NULL,zoom = c(1,1,1), arrow_col=c('#F0E442','#CC79A7'),palette=c("#E64B35FF","#4DBBD5FF","#00A087FF","#3C5488FF","#F39B7FFF","#8491B4FF","#B2182B","#E69F00","#56B4E9","#009E73","#F0E442","#0072B2","#D55E00","#CC79A7","#CC6666")){ deposit...
168b6f669054e3f4bd14353d88033c01cc819b8475c7263fd3f7baf7f8a9c808
R
3,825
87
# Load necessary libraries library(nebula) library(Seurat) # Set the input directory and output directory indir <- "./05_Nebula_DAR/Subtype/" out_dir <- "./Subtype_output/" # Read arguments from the command line, assuming the first argument is the cell type name argv <- commandArgs(T) name <- argv[1] # Example: "Exc...
d45551131cb8d916eca2308e4f55cd4b5e9b157fc19b024d632753b70a905be8
R
3,840
78
# ID conserved regions of trimmed alignment library(Biostrings) library(vegan) library(ggplot2) align_tfilt <- readAAStringSet("/path/to/folder/filtalign.fasta") # from the clean_align.R script process_column <- function(i, align) { aa <- as.character(subseq(align, start = i, end = i)) tbl <- as.data.frame(table(...
8b4fc05adf1c92f076520a41ab1378996e45615fac7702b70178350316b5d5d2
R
3,848
119
--- title: "Sensitivity of DELFI, LDCT, and combined approaches in LUCAS" site: workflowr::wflow_site output: workflowr::wflow_html: code_folding: hide toc: true editor_options: chunk_output_type: console --- ```{r caching, echo=FALSE} knitr::opts_chunk$set(autodep = TRUE, echo=FALSE) ``` ```{r packages,...
60eb58f4e78ede1480211de8b07bf8282a359101afd2825ccbe6206c05a4efa2
R
3,896
120
--- title: "GC model" site: workflowr::wflow_site date: "`r format(Sys.time(), '%d %B, %Y')`" output: workflowr::wflow_html: code_folding: hide toc: true toc_depth: 3 toc_float: true editor_options: chunk_output_type: console --- ```{r caching, echo=FALSE} knitr::opts_chunk$set(autodep = TRUE, warn...
56ef4fffce0135df82b434ca0a470632fc7a54baf07bee9fde5d03992c58f827
R
3,903
102
library('tidyverse') source('helper.R') ###---------------------------------------------------------------------------------------------------------- ##-- tb <- read.csv('../Data/INN_train_test/INN_XL_L_2000_CDS_hyperparameter_serch.csv') # Pearson R versus n_Conv1D_MaxPool_block ###--- Supplementary Fig. 2a ---### ...
4ff711bc895bf54a01d0435c59793c452fc1f256159fa88a3a15420654c7ee55
R
3,946
104
library(dplyr) library(ggplot2) set.seed(10) # Fig 9A: Binomial test for the whole-brain model: n_test<-5760 n_sample<-100 onesample_chance<-25 allsample_chance<-32 observed_acc<-42 binomial_data <- rbinom(n_test, n_sample, onesample_chance/100) binomial_data <- as.data.frame(binomial_data) names(binomial_data) <- ...
5ec8960cc44442a62940da53edc699452ad49690800c6c6190f8393b0265780d
R
3,981
149
--- title: "PCAWGROCs" output: workflowr::wflow_html: toc: false editor_options: chunk_output_type: console --- ROCs for PCAWG T vs N ```{r} library(here) library(data.table) library(tidyverse) library(devtools) library(ggplot2) library(ggpubr) library(cowplot) load_all("~/Dropbox/useful.stuff.aa") ...
9951fe8314d1207edcbef678b956cb4585e415db9197247eacaa73db13538513
R
3,995
108
library(tidyverse) library(caret) library(recipes) library(pROC) library(devtools) library(here) ## load_all(here("code","rlucas")) ## -> library(rlucas) ## ##features <- read_csv("../data/training-set.csv") features <- read_csv(here("data", "training-set.csv"), show_col_types=FALSE) multinucs <- bins5mb %>% group_by...
2a50a16d65d4593420009dd2c69fbdd33cd15d9ad443aed00d34ba9799559d88
R
4,020
121
psf.flow <- function(g, node.ordering, sink.nodes, split = TRUE, sum = FALSE) { node.order <- node.ordering$node.order node.rank <- node.ordering$node.rank # sink.nodes <- NULL nods = names(node.order) symb.exprs = vector("list") eval.exprs = vector("list") #expressions E = data.fram...
b513f88df2ae5d44889b9983b558240755e41194b6f82f89750b7d482bc213b0
R
4,020
147
--- title: "Visualizng result: Dreadd" output: html_document: toc: true toc_float: true --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = FALSE, message = FALSE, warning = FALSE, comment = "") # Verify the working directory print(getwd()) # Should print the path to your working directory freshr:...
bdb39a582053d9fc32b9e74eb925a3566021b49a57d34da2059c67911ad63417
R
4,067
130
library(glmnet) library(readxl) source("align_hist.R") library(zoo) library(ggplot2) # Define functions # This function is used to calculate the moving average of a vector in a # circular way circular_ma <- function(k, window) { k <- as.matrix(k) n <- nrow(k) out <- matrix(nrow = n, ncol = ncol(k)) # Init...
7eea8f0d7016a581b05841998ba0e126e62d0dca6b5a07978d81e37f4260f0aa
R
4,079
102
# ----------------------------- # this script creates a SAF of intronic regions for featureCounts to assign mapped reads to. # ----------------------------- library(GenomicFeatures) library(GenomicRanges) # Load txdb and get gene/exon ranges txdb <- makeTxDbFromGFF("PATH TO GTF/gencode.v40.chr_patch_hapl_scaff.a...
21dc0f03ed5e89733fd560270f1761f53807817eab8f1a35d95785ff13312579
R
4,081
78
#### Please download data file from Zenodo (https://zenodo.org/record/7396399/files/hsaSPIA.RData?download=1) and put it in R working directory load(system.file("extdata", "melanoma_exp.RData", package="psf")) load(system.file("extdata", "edited_pathways_new.RData", package="psf")) ### loading required libraries libra...
ddc6a7c005cc124678974a3a9a0afc7fd5f29f89d7e43b7ca5f110b1c58b1514
R
4,110
131
# Refresh the R session to clear the environment # This ensures that any previous objects, functions, or loaded packages are removed. freshr::freshr() # Set the working directory to the desired folder # This is the folder where your project files are located. # Verify the working directory getwd() # Should print the ...
7ec2973eff494c02d634d5921bc8276d8879b8bf1ca15148c296154c11f848e2
R
4,125
92
data_all <- readRDS(".../codes revised/reproducibility/output from the server/real_data/covariate_balance.rds") #revise as needed data_used_plot_ctltrt1_filter<-data_all$data_used_plot_ctltrt1_filter data_used_plot_ctltrt2_filter<-data_all$data_used_plot_ctltrt2_filter data_used_plot_trt1trt2_filter<-data_all$data_u...
a5fbd158de9040e74b31923f6ca423ca5a137c63db9761a0ddd8d8366a71b70c
R
4,158
107
library(Seurat);library(tidyverse) #Subset PC clusters and use scRNA data to transfer annotation cdS <- readRDS("data/integrated_all.rds") Idents(cdS) <- "cellTypeAllM" obj.list = SplitObject(cdS, split.by = "sample") # print CTRL sections for (n in levels(Idents(cdS))){ temp = obj.list[["X43430"]] cell_id <- Whi...
b38d88cfd87f9181c4f13b615a4381b444e38f51f8c2925b9c34cd37b2e15e18
R
4,167
127
--- title: "for Figure 4C-D" output: html_notebook R Script for Quantitative Analysis of Ultrasonic Vocalizations (USVs) in Mouse Pups Author: James Li Purpose: This script performs data processing, statistical analysis, and visualization of USV data collected from mouse pups separated from their mother and littermates...
a6f2004238d5dfa3e998a25ec0b3f3837212f18ca7479cc35701fe5768010df5
R
4,194
172
#!/usr/bin/env Rscript library(here) library(data.table) library(lubridate) ### INPUT fpaths <- list( CSV = here("data/derivatives/adni_icc_scale.csv"), RDS = c( "adni-bl_volumes_hcvc", "adni-bl_volumes_freesurfer", "adnimerge_baseline" ) |> sprintf(fmt = "data/rds/%s.rds") |> here(), SRC = c( "qc_se...
d7dc870ce28a3359b551d45217a90a02ff761bd7e5b14a0807bcc797823f9cd1
R
4,298
136
library(GenomicRanges) library(ArchR) library(stringr) library(dplyr) library(BSgenome.Hsapiens.UCSC.hg38) addArchRThreads(threads = 48) addArchRGenome("hg38") ## use hg38 ### -------------------------- ## 1. Loading an ArchRProject ### -------------------------- outd<-"./03_ArchR" workdir<-paste0(outd,"/02_filterD...
6ce64a6ea859769fec380c6a975c96ac9d06bad36a67c6650183f46c94c99e4d
R
4,317
141
# Generated by using Rcpp::compileAttributes() -> do not edit by hand # Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 RunModularityClusteringCpp <- function(SNN, modularityFunction, resolution, algorithm, nRandomStarts, nIterations, randomSeed, printOutput, edgefilename) { .Call(`_rliger_RunModularityClust...
01e889adbf7fcb8f8012ef509508f65b6d746d14abb09255b2c8a2a11dc94ee2
R
4,351
138
# -------------------------------------------------------- # Calibration + Histogram (Clean Version) # X-axis limits: 0 to 1 # Right Y-axis: Labels and title removed # -------------------------------------------------------- suppressPackageStartupMessages({ library(ggplot2) library(caret) library(Hmisc) ...
d301fb1e3eee6bc4aa360adca421b97ed3fa6e2a58d373fbf4956655bda42bd8
R
4,369
114
#'* SCRIPT: Mic/NM individual metabolites plots (Fig S1)* # Libraries: library(ggplot2) library(ggprism) library(rstatix) library(ggpubr) library(Hmisc) library(ungeviz) library(dplyr) library(scales) # Functions: obtain_metabolite_info <- function(raw_data, proc_data, KEGGMOLID, metabolite){ # Merge original data...
be3239340aad8fd70af7e9394811675d38eab17767eba88feb942440895d54bb
R
4,408
58
source('./helper.R') library('tidyverse') ###------------------------------------------------------------------------------------------------------------------------------------------------------ # scatter plot for tail change associated with position-less 3-mers when one UUUUA is present ###--- Supplementary Fig. 3d ...
27c8a49850fa9783915a3480614ad6098bd7cdc0982e748f6545a75e34fe7464
R
4,442
111
#' liger object of PBMC subsample data with Control and Stimulated datasets #' @format \linkS4class{liger} object with two datasets named by "ctrl" and #' "stim". #' @source https://www.nature.com/articles/nbt.4042 #' @references Hyun Min Kang and et. al., Nature Biotechnology, 2018 "pbmc" #' liger object of PBMC subs...
2244635a3f0e4016a374b779106e7e11b706ca14792940ffe95444a630b4ac5c
R
4,462
101
data_all <- readRDS(".../codes revised/reproducibility/output from the server/real_data/assumption_check.rds") #revise as needed positivity_check_lasso<-data_all$positivity_check_lasso positivity_check_rf<-data_all$positivity_check_rf positivity_check_gb<-data_all$positivity_check_gb #Reshape data for ggplot gps_lo...
240e70b90ea5284a4a6340e7794e59cdb5f4fd9df265f9f20e4365009dc9f0c3
R
4,477
127
# Description #### # Longitudinal plots to characterize our data # Set environment #### rm(list= ls())# ctrl + L to clear console #setwd("~/Documents/GitHub/Striatocortical-connectivity-FEPtrt/LongitudinalPLOT/") setwd("/Users/brainsur/Desktop/GitHub_repos/Striatocortical-connectivity-FEPtrt/LongitudinalPLOT") librar...
6b1e8218e1b8727efad5a87cc0342f8c0d51eb873344e636eb49641c9ba7f728
R
4,544
112
# integrate embryonic and adult PC scRNA-seq data library(Seurat);library(tidyverse) adPC <- readRDS("/Users/jamesli/Documents/Nagham/SynologyDrive/data_analysis/data/adPC.RDS") PCin <- readRDS("/Users/jamesli/Documents/Nagham/SynologyDrive/data_analysis/data/PCin_new.rds") DefaultAssay(adPC) <- "RNA" ref <- adPC r...
1130a14bde55f8cae3f298ec97f966ba6f5635507c652f05fd7ca69ba82a08a2
R
4,550
101
library(tidyverse) library(GenomicRanges) library(rtracklayer) library(rhdf5) library(parallel) library(pbmcapply) library(Biostrings) source('helper.R') # get the bed file utr_bed <- GRanges(import('../Data/Annotation/HS_3UTR_annotation_PMID_38460509_Table_S3.bed', format = "BED")) utr_bed$pa_id <- str_split_i(utr_be...
c5b6ae099393d4166a81fc1a16510a9f006ac57ded5bb4dd6fc46a1d0b6c0549
R
4,653
154
rm(list = ls()) library(psych) library(tidyverse) library(forcats) df <- read.csv("/Users/angeles/Documents/Research_data/Striatocortical_FEPtrs/cleansample_covars_R2_Med.csv") #Total obs per group table(df$group) #Clozapina #### table(df$Clozapina) table(df$Clozapina,df$group) # Convert to YES or NO df$Clozapina...
48ad4fd610b51f5e0f4eeadc1c175a31204a478d45b2d29742746b026af4f408
R
4,664
112
# Description #### # Longitudinal plots to characterize our data # Set environment #### rm(list= ls())# ctrl + L to clear console setwd("~/Documents/GitHub/Striatocortical-connectivity-FEPtrt/LongitudinalPLOT/") #setwd("/Users/brainsur/Desktop/striatconnTRT") library(ggplot2) library(geomtextpath) library(ggsci) libra...
70ac9f6f4c5003fd5d24d40070bb86043756308081208c055221e78ce1307d0e
R
4,676
76
--- title: "" author: "`r rworkflows::use_badges()`" date: "<h4>README updated: <i>`r format( Sys.Date(), '%b-%d-%Y')`</i></h4>" output: github_document --- <!-- To modify Package/Title/Description/Authors fields, edit the DESCRIPTION file --> ```{r, echo=FALSE, include=FALSE} pkg <- read.dcf("DESCRIPTION", fiel...
63b42e2058cd20a1303ffd093b60d93ca0b9843bf296bf1010083f194fe3fd46
R
4,699
135
# ============================================================ # Unified model performance summary (LATEST logic) # - One final object: results_final # - Youden_J computed directly from each confusion matrix # - AUC/CI computed once per ROC, then reused # - Print and CSV export use the same object # =============...
d2ec2048b5fadb615918662d5dd12bb1e2b09db19c18dc528b5aee2b9989ebb4
R
4,754
111
library(Seurat);library(tidyverse) # reload data # cdS <- readRDS("data/integrated_all.rds") cdS = readRDS("/Volumes/SSD_JamesLi/Experiments1/Multiplexed/Integrated_all/data/integrated_all.rds") # == repeat following the multiome data meta <- cdS@meta.data # remove the posterior-most sections and cell clusters of i...
f194f48b83c8d364eeb302ec3adb4b2a690422b2441966f27a10842624eccea0
R
4,776
128
#' Counts number of reads overlapping bins and performs GC-correction #' #' Uses LOESS to return GC-adjusted read-depth for desired bins #' #' @param reads a \code{GRanges} object, obtained from \function{filterReads} #' @param bins a \code{GRanges} object, obtained from \function{makeBins} #' #' @return a \code{GRange...
43a0827081a4b636e4f70f4522a3790e18af9eb8e6277c1949a9a8fdb21371a3
R
4,799
158
--- title: "Fragment lengths" site: workflowr::wflow_site output: workflowr::wflow_html: code_folding: hide toc: true editor_options: chunk_output_type: console --- ```{r caching, echo=FALSE} knitr::opts_chunk$set(autodep = TRUE, echo=FALSE) ``` ```{r packages, message=FALSE} library(RColorBrewer) libra...
f2333fae1ab4634eddd0de5b38c9e23ef8b24f6044dc1b53ca9cdf19335ca4c1
R
4,806
133
# Scripts to determine the modalities of NM Area distribution. library(readxl) library(ggplot2) library(dplyr) library(plyr) library(ggpubr) theme_set(theme_minimal()) ############### ### Inputs ### ############### analysis_dir <- "/Users/zacc/USyd/NM_analysis/" NM_data_dir = "/Users/zacc/USyd/NM_analysis/NM_data_ne...
eaa0f34b80eb78fb129403adc27dc7ddff4a451ebe18b343dbf3dbfff2b39916
R
4,834
118
# plot LRR and BAF for a single line, add the info on CN # code similar to the python automatic code produced by bcftools # Written by Lucia Trastulla -- email: lucia_trastulla@psych.mpg.de suppressPackageStartupMessages(library(argparse)) suppressPackageStartupMessages(library('ggplot2')) suppressPackageStartupMessa...
66f7641adaf48fb9219d90b5b5e30298b787900f1c26864861ba1101f6dbf5b8
R
4,857
305
--- title: "SessionInfo" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ```{r packages} #2 library(ggplot2) library(magrittr) library(tidyverse) library(fs) library(grid) library(data.table) library(cowplot) library(devtools) library(here) library(tidyverse) library(open...
617fd8e678b1837423cca0bf1de0a639bd3c0a9ccad888ffb05b854cd1012ff5
R
4,864
128
library(Seurat);library(COSG);library(clusterProfiler);library(org.Mm.eg.db) library(tidyverse) # PCin <- readRDS("/Users/jamesli/Manuscripts/PC_Manuscript/data/PCin_new.rds") PCin <- readRDS("/Users/jamesli/Manuscripts/PC_Manuscript/data_analysis/data/PCin_new.rds") Idents(PCin)=PCin$PC0.8 mGenes = readRDS("~/Deskto...
37eed03c9b4d7bc4f539760a3f95ff40bbe64b158abf86d03d378751d07dd620
R
4,878
105
class_tpm <- function(cds, class_vector){ cds.class.mean <- class_means(cds, class_vector) col.sum = Matrix::colSums(cds.class.mean) return(t((t(cds.class.mean)/col.sum) * 1e+06)) } find_DE_cluster_batch_regressed_out <- function (cds, DE_conditions, ...
639f6b0f80572856843b2afeffcc251e3b815ee5e168a4c45978ba37c6a72dd7
R
4,955
138
--- title: "Relative fragment size plot and ROC for SCLC vs. other comparison" site: workflowr::wflow_site output: workflowr::wflow_html: code_folding: hide toc: true editor_options: chunk_output_type: console --- ```{r caching, echo=FALSE} knitr::opts_chunk$set(autodep = TRUE, echo=FALSE) ``` ```{r loa...
f16689dce02d651e02787662b6d2e1afd388c790624c60fcafef1b6ac0bcfcb4
R
4,955
173
--- title: "Visualizing result" output: html_document: toc: true toc_float: true --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = FALSE, message = FALSE, warning = FALSE, comment = "") freshr::freshr() # Verify the working directory getwd() # Should print the path to your working directory lib...
0ae429a0e70b9e205b3021791d2ee1ff5385f4e88b9caff436d15603f8aea8a0
R
5,023
165
## C. Vriend - Amsterdam UMC - Aug '24 ## Post-hoc Bayesian regression analyses of global graph measures using brms package # clear variables rm(list = ls()) #library(tidyverse) library(dplyr) library(readr) library(moderndive) library(reshape2) library(brms) library(readxl) library(tidyr) library(openxlsx) library(g...
ec176f06ac7c0ac66d2f5784e23fd3cd85264b3f77a14b8926d0a8d59924ea87
R
5,171
130
data("pbmc", package = "rliger") withNewH5Copy <- function(fun) { ctrlpath.orig <- system.file("extdata/ctrl.h5", package = "rliger") stimpath.orig <- system.file("extdata/stim.h5", package = "rliger") if (!file.exists(ctrlpath.orig)) stop("Cannot find original h5 file at: ", ctrlpath.orig) ctr...
759422c00b4dcfdefe194b512805bc24a874532685c109d90baa5d6e3ff7b030
R
5,230
97
#!/usr/bin/Rscript #=####################################################################O # R Script specific to include conditions, factors and levels # Experiment: E1 (Malayalam) # # Author: R.Muralikrishnan # 2024-06-11: V 1.0 #=####################################################################m # Requir...