sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
0bccc4c9e0f4f5437ca84cbf32bc11d5cc7f3582e311e4696d045af3c79aa9cb
R
5,247
125
#!/usr/bin/env Rscript # Removing reads from secondary ORs based on known similar ORs from multimappers and gapped reads ### knownpairs = scan("empirical_OR_pairs_filtered",what = character()) ##################################################################### library(ggplot2) library(dplyr) args = commandArgs(traili...
fe6955780c48ff58ba10bdb66c73644cdbfcf425396a2a6acc873bc572f382b6
R
5,254
137
#20240822 #ZE and TBS - CV calculation for metabolites # This script processes metabolite data to remove outliers and calculate the coefficient of variation (CV) # for different combinations of experimental variables (metabolites, sequences, fields, and locations). # The CV is a measure of relative variability, cal...
b4acf5c0a09fd627acb7f48ce504e479a1b087e9553717ddeefaa210107c472b
R
5,285
112
--- title: "UINMF integration of Dual-omics data" author: "April Kriebel and Joshua Welch" date: "04/25/2023" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE, warning = FALSE, message = FALSE) ``` Here we integrate the scATAC and scRNA reads from the dual-omics dataset SNARE-s...
64cdce6b1cc998c734c29f902fdeaeb1114915348df9bcc8c2057881b078ecc5
R
5,361
123
library('tidyverse') library('ggplot2') library('Cairo') library('RColorBrewer') library('viridis') library('signs', quietly = T) library('ggpointdensity', quietly = T) custom.breaks <- function(bmin, bmax, digits = 0, length.out = 8, zero = TRUE) { bmin = floor(bmin * (10 ^ digits)) / (10 ^ digits) bmax = ceiling(b...
923cbf7eee29eacd8cea90439df096e021a73dc50d79912cfc0fdbae5ac2b14e
R
5,366
207
projDir <-"" setwd(projDir) source("functions.R") package.list <- c("psych","reshape2","rstatix","lmerTest","lme4","afex","car","dplyr","ggplot2","Hmisc", "purrr", "broom","tidyr","corrplot","ggpubr","Matrix","tibble","ggeffects","effects","stringr","readxl","readr","purrr", "patter...
ee78f18865244a5e5a98536f21c65c2e89845859cf1b4dd6c1a93a2e0c1b639e
R
5,441
141
# Construct the txt annotation file for each comparison # Written by Lucia Trastulla -- email: lucia_trastulla@psych.mpg.de # note: output 1 column file, first element refers to pre reprogrammed, all the other elements to post reprogrammed suppressPackageStartupMessages(library(argparse)) parser <- ArgumentParser(de...
74ddd5374e83a25559b869248ffcda76adf3b1481b1890f6c3e4ff8575d4b08a
R
5,447
125
# trim alignment, realign, filter for conserved regions library(tidyverse) library(Biostrings) setwd("") count_start_gaps <- function(alignment){ split_align <- strsplit(as.character(alignment), "[A-Z]+[-]+")[[1]] split_align_1 <- split_align[nzchar(split_align)] length_first_gaps <- ifelse(length(split_align_1)...
7065c3db7cf227bac0f74a050ed42ad2f07da6f8c8fec57845917264211bf707
R
5,449
143
# execute as: # Rscript annotate_m6anet_output.R high_confidence_modification_sites_from_m6anet.csv gencode.gtf output_prefix suppressPackageStartupMessages({ library(tidyverse) library(data.table) library(reshape2) library(purrr) library(GenomicRanges) library(GenomicFeatures) }) options(dplyr.summarise.i...
24bb30ec0ab326861cecff84985d96fba4f8eea91384f8bb4519d5b6828897e9
R
5,453
117
###this is for plotting Venn and Euler diagrams for gene_ids enriched in multiple comparisons #load libraries library(ggvenn) library(tidyverse) library(readr) library(stringr) #Human #upload output tables from Deseq2 #this script is currently set up to be performed on the human comparisons #replace h for m t...
6e10bd20380eff3af2933b406faa0fe5df010114fe7c81a0c5d7f474c8e6cf71
R
5,465
130
library(tidyverse) library(devtools) library(data.table) library(GenomicRanges) library(here) load_all(here("code","rlucas")) bins <- unique(GRanges(bins5mb %>% select(chr, start, end, arm, bin))) #--------------------------------------------------------# get_arm_ranges <- function(assembly){ mySession <- rtrackla...
501369aa756e8fbb089f3ca9eb126b007406cb4e501721ec638c1597b193ccc4
R
5,485
142
library(Seurat);library(tidyverse) #Subset PC clusters and use scRNA data to transfer annotation cdS <- readRDS("data/integrated_all.rds") PC <- readRDS("data/PCi.rds") DefaultAssay(PC) <- "RNA" Idents(PC) <- "PC0.8" PCsp <- subset(cdS,idents = c(paste("PC",1:11,sep = ""))) p <- DimPlot(PCsp, pt.size = 1, label = T)+N...
199ea5d0c08e96dc458606c2754337babc68b939460ed327fe530d571eb66886
R
5,488
112
#22/1/2024 #Zeinab Eftekhari and Dr. Thomas Shaw # This R script creates scatterplots to visualize metabolite concentrations across different MRI sequences # (sLASER and STEAM) and field strengths (3T and 7T). It reads data from a CSV file, filters it, and generates # four plots that compare concentrations betw...
7dc1a4dcfe037a493e2b154a18e6a02473383d4c8d0225de63a63e30acbee7f5
R
5,499
162
### Author : Marie-Michelle Simon ### Date : April 30th, 2023 ### Goal 1 : Generate a scatter plot showing the Pearson Correlation between the replicates (n=3) for condition WT, for H3K27me3 data on musc ### Goal 2 : Generate a scatter plot showing the Pearson Correlation between the replicates (n=3) for REST Cut and ...
7940b72e6a1b65b91309c4f68a0a8bde6292631fbec1f6c37b0fc07ec15d2164
R
5,528
172
EMP_COR_SANKEY<- function(data_list,pvalue=0.05,rvalue=0,cor_method='spearman',sankey_ouput = F,file = 'Sankey.html' ,positive_col = 'darkred',negtive_col = 'steelblue',palette=c("#009E73","#F0E442","#E64B35FF","#CC79A7","#4DBBD5FF","#00A087FF","#3C5488FF","#F39B7FFF","#8491B4FF", ...
eb59a1428ca31fe99dd1549662d66af8b87e44e97177295fa9698d500e23655e
R
5,558
143
####################### # 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...
6431fde688b6604ebef225117cf973a7d4fa936f9a690b03696006857cd6afd8
R
5,714
164
# Matrix eQTL by Andrey A. Shabalin # http://www.bios.unc.edu/research/genomic_software/Matrix_eQTL/ # # Be sure to use an up to date version of R and Matrix eQTL. # source("Matrix_eQTL_R/Matrix_eQTL_engine.r"); library(MatrixEQTL) library(tidyverse) library(qvalue) args = commandArgs(trailingOnly=TRUE) snpPrefix <- ...
2a70d4b85c62745e6fac14b31ee4b04d0f8c7c98eb39c04199d02c39dc06237f
R
5,721
108
#' @title get_sigcell_simple #' #' @description a function to determine statistically trait-enriched #' cell by permutation test. #' #' @param knn_sparse_mat a sparse matrix used for network propagation, #' which indicates the adjacent matrix (m x m, where m is the cell number) #' of cell-to-cell network (M-kNN graph)...
3692d3292f37f5c8c2d8b75e052f26260d8fcea2c057343779bece65dd4cbe18
R
5,727
168
projDir <- "~/npj" setwd(projDir) source("../../script/functions_basic_stats.R") package.list <- c("psych","reshape2","lmerTest","lme4","afex","car","QuantPsyc","dplyr","ggplot2","Hmisc", "broom","tidyr","corrplot","ggpubr","Matrix","tibble","ggeffects","effects","stringr","ggpattern", "effsize","rsta...
8846e1d4f2d3fdfae6edbc0fbca2a6b29914095fc83e27a788ed92e3ec5d0274
R
5,739
112
#library(devtools, lib.loc="/net/bmc-lab6/data/lab/kellis/users/ssz/software/Miniconda3/envs/devtools/lib/R/library") Run_SCAVENGE <- function(SE_Data, trait_file){ # trait_file: <chr> <snp_loc> <snp_loc> <snp_id> <posterior probability> <filename> require(SCAVENGE) require(chromVAR) require(gchromVAR) ...
316dcd51b9f76b793c4dcf2589002855e419854a57422d68988e5cc71fccde3c
R
5,756
153
# ======================================================================================= # Purpose: Cell clusering and domain segmentation based on imputed spatial transcriptome # Author: James Li # Date: Jan 05, 2025 # library(Seurat) library(BASS) library(tidyverse) obj = readRDS("data/merge_4x.rds") obj.list = ...
752e7677f009d9c75558c8d128b1e2257380338173c39b614d990cab47ce046a
R
5,778
131
--- title: "S21a" output: workflowr::wflow_html: toc: false editor_options: chunk_output_type: console --- ```{r} library(here) library(data.table) library(tidyverse) library(devtools) library(ggplot2) library(ggpubr) library(cowplot) library(caret) library(recipes) library(pROC) library(gbm) #These are the ...
edfecc7151b062a937a32e2f8fc95943a41b0abd44a09cc6b92bb8fb5034a78f
R
5,845
123
library(tidyverse) library(parallel) library(RcppAlgos) source('helper.R') # get prediction results for all variants input_folder <- '/lab/solexa_bartel/coffee/Sequencing/Gnomad/PolyA/Gnomad_v4_variants_TL_prediction_CV_MINN_XL_HS_MM_L_2000_CDS/' pred_files <- list.files(path = input_folder, full.names = TRUE, pattern...
2dd38918abca65520d2679728a027631fdf23acb8b646beb4af9dfc9a210fbcb
R
5,875
157
--- title: "PSF toolkit: Getting Started" author: "Siras Hakobyan" date: "`r Sys.Date()`" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{PSF toolkit: Getting Started} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r setup, include = FALSE} knitr::opts_chunk$set(collapse =...
37b2b0cb277dc8f541f2afc77d5cc47878a1f658acd2cfa8c49a862cc100d12b
R
5,895
248
--- title: "Mice CSF-cN Intrinsic Properties along the rostro-caudal axis" author: "Nicolas Wanaverbecq - Elysa Crozat - Edith Blasco" date: "`r Sys.Date()`" output: pdf_document: toc: yes toc_depth: 5 params: null --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ## OPEN REQUIRED PA...
90d5d038c314bc868f9bbc18e28159dfaf960ddec2959e571d72d423f6588093
R
5,963
133
#' Downsample datasets #' @description This function mainly aims at downsampling datasets to a size #' suitable for plotting or expensive in-memmory calculation. #' #' Users can balance the sample size of categories of interests with #' \code{balance}. Multi-variable specification to \code{balance} is supported, #' so ...
2bf9639228dca17ad8c5dfef9c90e79d9cf73be34f9ee43f22b83d8614726696
R
5,965
102
install.packages("openxlsx") library(openxlsx) library(tidyverse) library(readxl) library(dplyr) library(knitr) library(naniar) library(plyr) library(tibble) library(writexl) #read in unstained NM control data df_2 <- readxl::read_excel("//shared.sydney.edu.au/research-data/PRJ-NeurodegenNewApp/Anastatia/Y...
8f7367efbde79b65b64d7ae7a771119b980fc22614a3b8739c639dae80897c62
R
5,974
200
library(lme4) library(pbkrtest) library(simpleboot) library(lmeresampler) library(foreach) library(doParallel) #define MLM w/ three-way interaction -------------------------------------------- # x = rv_list lmer_three_way = function(x, data = df_lite) { mod = lmer(paste(x, "~ p15_cno * sex * f.layer + (1 | subject_...
922a784f1af0ccc0f0d4d8fb44c77371922ea12e22fc0b2c9c10be15f43a7ab0
R
5,993
202
# ---------------------------- # Enhanced GRN Visualization with Split MoR_sum and Clean Layout # ---------------------------- # ---- Load Required Packages ---- if (!require("igraph")) install.packages("igraph", dependencies = TRUE) if (!require("visNetwork")) install.packages("visNetwork", dependencies = TRUE) if (!...
40fa5f79f3e8ac29dd49f5a3d667d6a88ed0b7274061e96b88f2ded6aa839745
R
6,034
127
prepare_Carnival <- function(mapk_data, filtered_expression_matrix, USER_EM2, results_dir, inputs_dir, disease_filename, j, ...
5851f717decd68c522fc3cf2fcb34597928f3fdb71959e712fe0e0390eaaaf06
R
6,065
124
--- title: "Install LIGER with R" author: "Yichen Wang" date: "2024-03-20" output: html_document: toc: 3 toc_float: true --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE, eval = FALSE) ``` Before setting up the "rliger" package, users should have [R](https://www.r-project.org/) version 3.6...
5d51317b8414edbb666698226c899ec51fca16ea61f4c92c867613564e513ed6
R
6,106
184
#' Liger cell/feature metadata #' @rdname liger-metadata #' @description #' The rationale for defining these classes is to have a data frame extension #' class holding the data, so that printed view looks tidy. \code{tibble} is #' selected as the base class for metadata. However, \code{tibble} does not #' allow \code{r...
a1d2397421f4853c6b4f63b3cc6d22b029606c2bb83c1d86084033c7b9442bfd
R
6,146
153
--- title: "Patients age 50-80 with 20+ pack years" author: "Jamie Medina" date: "2/9/2021" output: html_document --- ```{r background, echo=FALSE, include=FALSE} ################################### # Task: Predict # Created: 012221 # Due date: Monday 25, 2021 or Tuesday 26, 2021 ####################################...
1a991c1a9ee49ea5d6d826a516d6f5843cb4d568dd8343a5f62b0c683d103c7b
R
6,164
153
library('signs') library('Cairo') 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 - bmin) / (length....
dcc2910bf8a4458713890fcaba003b046c06f13521a70fb84686d3b50d78bb93
R
6,178
137
--- title: "Cross-Species Analysis with UINMF" author: "April Kriebel and Joshua Welch" date: "12/6/2021" output: html_document --- ```{r setup, echo=FALSE} knitr::opts_chunk$set(warning = FALSE, message = FALSE) ``` In this vignette, we demonstrate how to integrate dataset from different species. ## Step 1: Load ...
2c202fef113b15cd325d888ea90184758591cf3a3a299afbc9194d1331961005
R
6,179
181
# Load required libraries library(devtools) library(data.table) library(GenomicRanges) library(HMMt) library(stringr) # HMM function to run Hidden Markov Model on genomic regions HMM <- function(normalized, na_solution, file) { # Validate the 'na_solution' input if (!na_solution %in% c("NA", "keep", "-")) { ...
75feaf972eff7cff58f2d26fb3d24f4a5538d69e3f75c745b7babf7109a083d1
R
6,202
148
#20240822 #ZE and TBS - wide-to-long format transformation for metabolite data # This script processes a series of wide format CSV files, transforms them into long format, and then # combines these transformed files into a unified dataset. The script is organized into several key steps: # # 1. Load the necessary ...
db1af1c95566077360b15dc6551308a78916359acc0d235d4cf224eedc9a0fd1
R
6,205
211
--- title: "SCopeLoomR Seurat tutorial" author: "Katina" author_gh_url: "https://github.com/tropfenameimer" date: "20/02/2021" output: html_notebook: toc: yes html_document: keep_md: true df_print: paged toc: yes toc_float: yes BiocStyle::html_document: number_sections: no pdf_document: ...
c0409f49db15cd5e63d489f0335fb18b466cfc374d1265a41e9ff4ce1d3aead7
R
6,208
178
# remove genes with 80% zeroes and na rows remove_sparse_rows <- function(df, threshold = 0.8) { df[rowMeans(df == 0, na.rm = TRUE) < threshold & !apply(df, 1, function(x) all(is.na(x))), , drop = FALSE] } # log2 and z-score normalization norm_dat <- function(df, nor) { df <- log2(df+1) if (nor=="t...
41c4dd827929783caf7d57284e9ad4987c84209846b27e02e0ac29db676d87ef
R
6,231
123
--- title: "Unshared Features UINMF" author: "Joshua Welch and April Kriebel" date: "12/03/2021" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE, message = FALSE, warning = FALSE) ``` Unshared integrative non-negative matrix factorization (UINMF) [[Kriebel and Welch, 2022](http...
1f9f858be65f26b6951ad8e674c2a2893e500e7241aa9e1fdba979ae5cfa0394
R
6,241
89
library(tidyverse) library(Biostrings) source('helper.R') ###---------------------------------------------------------------------------------------------------------- ###--- Fig. 1e ---### ##-- prediction versus measured scatter plot # Training data: Frog endogenous mRNA tail-length change during oocyte maturation #...
67d604efc404dfa120ad247f777cf2218507373f56394d0b7e38fad98ff65705
R
6,262
197
# Load necessary libraries library(lme4) # For fitting linear mixed-effects models library(pbkrtest) # For Kenward-Roger approximation for mixed models library(simpleboot) # For simple bootstrap methods library(lmeresampler) # For resampling methods for mixed models library(foreach) # For looping con...
b42eaf007839ac9d42e2006c8aa48267313b71731fd260e5b1e2d08eb5c9d073
R
6,318
162
# ======================================================================================= # Purpose: Quantification of eCN neurons among 4 different genotypes # Author: James Li # Date: December 31, 2024 # library(Seurat);library(tidyverse) setwd("/Users/jamesli/Documents/Manuscripts/PC_Manuscript/data_analysis/Multi...
e6cd9175c3fba4a87839fad3486cde76c21d2d694a3ae1c233845dd962ef2070
R
6,370
207
--- title: "Fragmentation profiles" site: workflowr::wflow_site date: "`r format(Sys.time(), '%d %B, %Y')`" output: html_document chunk_output_type: console --- ```{r caching, echo=FALSE} knitr::opts_chunk$set(autodep = TRUE) ``` ```{r packages, echo=FALSE, message=FALSE, warning=FALSE} library(ggplot2) library(magri...
bdcfb7713bd30e1e9258acd19adde7724dfd1d38356f638b39fed786f243645a
R
6,412
143
## reading manually selected pathway list selected_pathway_set <- read.delim(file = "/home/siras/PSFC/inst/extdata/selected_pathways.txt", sep = "\t", stringsAsFactors = F) ## building keggres links data frame for downloading selected_pathway_set <- data.frame(pathway_code = selected_pathway_set$pathway_code, ...
abddd27be7a4b5ba1d536588e99e281d18a6b868b952a6ee626532212e9e8d1b
R
6,435
132
####### Dec 2023 # This script subtracts RRBS oxidative Bisulphite signal (oxBS, 5mC only) from RRBS Bisulphite signal (BS, 5mC & 5hmC) # It subtracts percent methylated oxBS from BS to arrive at 5hmC percent methylated (vairable b) # It subtracts count oxBS methylated from BS methylated to get 'count 5hmC' (variabl...
3524b8719480fe5067b101b56bc3f5ff1af4d29989073ce9842f513f1e82d592
R
6,458
158
#functions for loading packages, labeling boxplot outliers, and creating and saving pairwise and listwise deleted correlation tables, box plots, histograms, scatter plots, bar graphs, and multi-individual line graphs#### #package loading function#### load.packages <- function(package.list){ new.packages <- package.li...
f4c555180f731a61eaa5910f5d7718d45ce1d6eddd3ee86cbf812f4a0bd5a5f2
R
6,527
135
library(data.table) library(DT) library(miniUI) library(shiny) library(Seurat) library(ggplot2) library(psf) library(magick) library(shinyjs) library(visNetwork) library(plotly) shinyUI( navbarPage("PSF Spatial Browser", tabPanel("App", fluidPage( tags$scrip...
6483c01c96f5f03b35d28a28df7b342e15f6d7f7ace5610d24c7e8824464af2d
R
6,555
127
#' @import ggplot2 #' @importFrom reshape2 melt top_abundance_caculate <- function(data,structure_method = 'mean',num = 10,estimate_group='default'){ if (estimate_group== 'default') { estimate_group=unique(data$Group) } if (!all( estimate_group %in% data$Group )) { warning('estimate_group is wrong, ...
53290f67fb76283c5e30528deee8dfddf4e81124052a535345e86d5a8c39e985
R
6,560
203
projDir <- "~/Library/CloudStorage/Box-Box/YP Projects/MathFun/0_npj_revision2_md_td_tutoring/roi" setwd(projDir) source("../../script/functions_basic_stats.R") package.list <- c("psych","reshape2","lmerTest","lme4","afex","car","QuantPsyc","dplyr","ggplot2","Hmisc", "broom","tidyr","corrplot","ggpu...
a1598e96a50148358d676dad3c33d85e68d2226b773c516c98643e330f836fa5
R
6,578
145
# ======================================================================================= # Goal: Examine the robustness of PC subtype classification using publicly available data # Author: Nagham Khouri-Farah1 # Date: Sep 1, 2023 # library(Seurat); library(tidyverse); E1618a <- readRDS("/data/E16_18_All.rds") DimPl...
f845890eb251652d65c370261ee65c5f6d912d5e39babba2914402c2060b5a2b
R
6,582
198
--- 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...
31979b96ef7cf681ecb8965cfb08f9f7e74fe8106c3002774727dde1673d8030
R
6,624
146
--- title: "2D_S10" output: workflowr::wflow_html: toc: false editor_options: chunk_output_type: console --- ```{r composite, echo=FALSE, fig.width=16, fig.height=10, dev=c("png", "pdf")} library(data.table) library(gridExtra) library(devtools) library(here) load_all(here("code","useful.stuff.aa")) #...
36e4db0e319ff5af7e034e25a1477a86e02ab323dc8322ed8316ba2bac06686f
R
6,692
162
--- title: "3A" output: workflowr::wflow_html: toc: false editor_options: chunk_output_type: console --- ```{r} library(here) library(data.table) library(tidyverse) library(devtools) library(ggplot2) library(ggpubr) library(cowplot) features<-fread(here("data","Final_LUCAS_Ensemble","LUCAS_artemis.csv")) feat...
6e0acd5c089180ea3606bb975cb3bbb1b715266840014487d438d3b7c2512855
R
6,797
165
--- title: "S2_S3abc" output: workflowr::wflow_html: toc: false editor_options: chunk_output_type: console --- ```{r} library(here) library(data.table) library(tidyverse) library(devtools) library(ggplot2) library(ggpubr) library(cowplot) library(RColorBrewer) ``` ```{r} data<-fread(here("data","Kmer_Distri...
0ec6a07e1945140b77b8edab715c65b7fa647bca4e18da8ae906044f4ca6750f
R
6,808
152
--- title: "S17" output: workflowr::wflow_html: toc: false editor_options: chunk_output_type: console --- ```{r batch, echo=FALSE, fig.width=10, fig.height=6, dev=c("png", "pdf")} library(here) library(data.table) library(tidyverse) library(devtools) library(ggplot2) library(ggpubr) library(cowplot) library(r...
e7accb04e99f05f620421b593aa01aa3c6de17c3d56fc815e0b118614a745d63
R
6,830
172
### Author : Marie-Michelle Simon ### Date : April 30th, 2023 ### Goal : Generate a bargraph to compare the rate of complete RE-1 motifs found in H3K4me3 peaks (near non-muscle genes) VS the rate of complete RE-1 motifs found in the random genomic regions of the same length ### The matching random genomic regions of ...
77660714767f43e247274df0fde55ed15214886c05436296f8d34e031e90b958
R
6,943
152
# this script calculate translational efficiency changes for human and mouse mRNAs during oocyte maturation with re-precessed published datasets library(tidyverse) library(DESeq2) size.factor = function(dframe) { # a function for normalization using DESeq2 if (is.data.frame(dframe) == F) { stop("Please use datafra...
81c95de85d3d00c2f70924edb9028ca4f04391d7c0cc9266fdc8f16dba7d3780
R
6,955
154
# 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...
677b10150b9c342a09253cd64232dd447c567670f5686f90e1708c1de44af2e9
R
7,015
165
--- title: "Visualizing Feature Distributions in a Heatmap" site: workflowr::wflow_site output: html_document chunk_output_type: console --- ```{r packages, echo=FALSE, message=FALSE, warning=FALSE} library(tidyverse) library(openxlsx) library(devtools) library(ComplexHeatmap) library(circlize) library(data.table...
f544de4a717c9d708f62226c5c66df54a7f34b18a7e84a222de17756fa6d3ef9
R
7,030
181
library('signs') library('Cairo') library('RColorBrewer') library('ggrepel') library('ggseqlogo') library('cowplot') 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 |...
be337a34b5c75ff4c419e361ad46a1d1df2083004add072ab13a4f176ca0438a
R
7,082
188
--- title: "Training Model Variation - Feature Importance" 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) ``` ```{r packages, message = FALSE, ...
632a9574a5294d0e9df532b701fb38cebd69b07c8aeb28538c7f083d84424ea4
R
7,086
229
--- title: "S3d_S4" output: workflowr::wflow_html: toc: false editor_options: chunk_output_type: console --- ```{r} library(dplyr) library(devtools) library(here) load_all(here("code","useful.stuff.aa")) # Load library(tidyverse) library(data.table) library(readxl) library(ggplot2) library(corrplot) ...
5ecb1e2c6f1db9806df8f707720662da02a14d3514bb1eab15152c1b00624141
R
7,199
132
--- title: "Home" site: workflowr::wflow_site output: workflowr::wflow_html: toc: false editor_options: chunk_output_type: console --- ## Detection and characterization of lung cancer using cell-free DNA fragmentomes Abstract: Lung cancer remains the leading cause of cancer death world-wide, largely due to i...
532b2f485aabe31d66c7508c976939715e166bc44d60cca7e4a66039edc06dd0
R
7,262
184
library('tidyverse') library('ggplot2') library('Cairo') library('RcppAlgos') library('RColorBrewer') library('viridis') 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...
997b3823457f4b86bc9daeb0ae0a79f671eb27c98efb5ef64de610f687bff45c
R
7,382
182
#Sorts kraken output into 3 streams: unclassified, prokaryotic (bact + arch), and eukaryotic library(Biostrings) # Set the working directory args <- commandArgs(trailingOnly = TRUE) # Define the file path file_id <- commandArgs(TRUE)[1] # The first argument will be the file path sample_directory <- commandArgs(TRUE)[...
2c7cbdc842f2f9db6d2922de12f2e8c10358297e4f712925c80858c0872949fe
R
7,387
239
#### General functions for operations on the genome #### Functions in here likely can be sped up with compiled code #input a bed file, get out a wig file bedtowig <- function(pathToBed){ input <- pathToBed out <- gsub(".bed", ".wig", input) library(data.table) library(rtracklayer) tilesdt...
8cb86bddd500d8e2376f1bea1af0ba4f4701745032ccc1feb6a958cec5706134
R
7,484
208
#'*PLS-DA Plots of Metabolomics Datasets* # LIBRARIES: library(ggforce) library(scales) library(mixOmics) library(ggrepel) library(uwot) library(tidyverse) # Functions ------ metabolite_clean1 <- function(metabolite_list){ metabolite_list <- gsub(".TMS","",metabolite_list) metabolite_list <- gsub(".2TMS","",metab...
19eadfe4c81448422e3aaa333e925616bd776c5895ed60a7f217c4e88bb9f615
R
7,496
194
--- title: "2c_S8S" output: workflowr::wflow_html: toc: false editor_options: chunk_output_type: console --- ```{r} library(dplyr) library(devtools) library(tidyverse) library(data.table) library(here) library(readxl) library(ggpubr) library(cowplot) ``` ```{r MCCC1, echo=FALSE, fig.width=6, fig.height=6, d...
f2df5c9cfb7e52579da547095a04ad3a7623d2493d6a4d720853111a7599416e
R
7,548
209
library(tidyverse) library(readxl) library(magrittr) library(stringr) library(purrr) library(kableExtra) library(SummarizedExperiment) library(here) library(devtools) devtools::load_all("../../rlucas") load(here("data", "prediction_lucas.rda")) load(here("data", "metadata.rda")) data(bins1kb, package="svfilters.hg19") ...
582bd52898db1669b42b724a91819d5b9782a22b63fdd4eea1f78c63a26882f2
R
7,786
170
tax_plot_ttest <- function(data,tax_select=NULL,width_total=20,height_total=20,width=10,height=8,seed=123,row_panel=NULL,mytheme=theme(),palette=c("#E64B35FF","#4DBBD5FF","#00A087FF","#3C5488FF","#F39B7FFF","#8491B4FF", "#B2182B","#E69F00","#56B4E9","#009E73","#F0E442","#0072B2","#D55E00","#...
d146e2e690c479205afbe0af02e78d792519a99f3e2796c020af559bc00ed679
R
7,849
168
# Plot CNV for a single line in the entire genome, use QC summary files # Written by Lucia Trastulla -- email: lucia_trastulla@psych.mpg.de suppressPackageStartupMessages(library(argparse)) ############################## suppressPackageStartupMessages(library('ggplot2')) suppressPackageStartupMessages(library('gridEx...
051eec7a7b34dcdbe7b41423e8b4c5e8093ebe2f00e1bf825c20fcd71cba9a7c
R
7,892
205
--- title: "2B_S7" output: workflowr::wflow_html: toc: false editor_options: chunk_output_type: console --- ```{r} library(here) library(data.table) library(tidyverse) library(devtools) library(ggplot2) library(ggpubr) library(cowplot) library(RColorBrewer) ``` ```{r} kmer<-fread(here("data","CN_Analysis","...
78fa0054d8cfae971284733aa6fc66d3e185f4372dc4767c00518fa2f8dde163
R
7,900
111
library(unifed) # This code requires the user to have files named DatasetName_CellType_DifferentialExpression_UpReg.txt in the directory # DatasetNames is a vector of strings of dataset names. BroadClusterTypes is a vector of cell types. PresenceofDataTable is a table detailing whether a cell type has data for each ce...
dcc3440b8c0f75bf87b540a12fa08f04c257189abf39fd1d30cf6444d6ae9de0
R
7,949
184
### Author : Marie-Michelle Simon ### Date : April 30th, 2023 ### Differential accessible region analysis for REST WT and KO condition comparison in ATAC-Seq libraries ### GOAL : Generate list of differentially accessible region (more accessible in KO and less accessible in KO compared to WT) ### EXAMPLE CODE ONLY : ...
2e0587a5dc7d08fc68ff63cbea792670d5df773ebb6c2922348d75bf181c8b0d
R
7,969
236
--- title: "Effect of PCR on S/L ratios without GC correction" 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 packages, message=FALS...
b0449f00a6228ca28a5b7c4f804b70e160c7627251101f3095c8f786cb851c16
R
7,971
197
#----------------------------- #----------------------------- # standard DESeq2 and PCA analyzing new sequencing #----------------------------- #----------------------------- #----------------------------- # Load required libraries #----------------------------- library(readr) library(DESeq2) library(tidyverse) lib...
8d1d857fc0d7c7bd86640466a44b576b895d13e0102617a625733f2296961012
R
8,033
213
#' `r lifecycle::badge("experimental")` Suggest optimal K value for the factorization #' @export #' @description #' This function sweeps through a series of k values (number of ranks the #' datasets are factorized into). For each k value, it repeats the factorization #' for a number of random starts and obtains the obj...
1dade06f0735bc693777bb9fa837500f6ce476e0e0b24359d3f53a3f807e5aed
R
8,062
209
# Call in a way like: # object <- recordCommand(object, dependencies = ...) # Conditionally, should be placed after input checks # like `match.arg()` or `.checkUseDatasets()` # `...` is for the ... arguments in real function call, so S3 arguments passed # to downstream can be also captured recordCommand <- function( ...
4bef9f7a4f9122771fea2591e4db590c62d20695a4749f4858350cca73246bae
R
8,213
170
#!/usr/bin/Rscript #=####################################################################O # R Script with helper functions for displaying LMEM model details # # Author: R.Muralikrishnan # Script Version: 2024-11-30 #=#####################################################################m library(tidyverse) library(mag...
50c9ce9a9027c865d5eb6559081557e7bbccf64e033893de8467b29464d92708
R
8,281
196
--- title: "consensus HLA Report" output: pdf_document: highlight: tango number_sections: TRUE params: clin_hla_json: NAMESPACE germline_hla_json: NAMESPACE tumour_hla_json: NAMESPACE rna_hla_json: NULL pid: NAMESPACE date: "`r format(Sys.time(), '%d %B, %Y')`" subtitle: "`r paste('Patient ', params$pid...
7672af64a9d9ee82223acf64a5d6227aa8c8c67d5f1712130e84f14f0d406aea
R
8,301
229
--- title: "S18" output: workflowr::wflow_html: toc: false editor_options: chunk_output_type: console --- ```{r} library(tidyverse) library(data.table) library(ggplot2) library(here) library(devtools) load_all(here("code","useful.stuff.aa")) # Load library(gridExtra) library(cowplot) library(readxl)...
00dd6e9d7367cc470fd6b7d361cd2354e003f11fe3d3d1b6dad5773bde4d58ee
R
8,305
183
library(tidyverse) library(Biostrings) source('helper.R') #------------------------------------------------------------------------------------------------------------------------------------ # density plot for CPE and PAS in Xenopus ###--- Supplementary Fig. 3e ---### l_max <- 1000 # max length of 3' UTR to analyze ...
1984c13b69d807a8f636b1209ab5b4b0f38e190369bb86738de89fb2ad9c774f
R
8,305
205
#' --- #' title: Experiencer Verbs in Malayalam -- Light Verb Constructions #' subtitle: ERP Data analyses using Linear Mixed-effects Models - NP #' author: " " #' output: #' html_document: #' code_folding: show #' theme: flatly #' highlight: kate #' --- #' #' <style> #' pre { #' overflow-x: auto; #' ...
1cef0237101e35369f9016d508365a50de725cb7cd2ed774597acf5134561879
R
8,318
182
# Plot LRR and BAF for a pairwise compasion, 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')) suppressPackageStartu...
151c1a6aa4a4de064b7884adec23bcb88cdeb89bedf4feb3f86da8b284f8d1f5
R
8,321
228
library(ggplot2) library(dplyr) ####################################################################################### tt=1 #### tt=1 to reproduce case 1 (linear) and tt=2 to reproduce case3 (nonlinear) ####################################################################################### case_all<-c("lin...
239dba0de5dba49701c7fcdc3e54a4a25bff8d72dc01064b3a416157f474bf70
R
8,321
228
library(ggplot2) library(dplyr) ####################################################################################### tt=2 #### tt=1 to reproduce case 1 (linear) and tt=2 to reproduce case3 (nonlinear) ####################################################################################### case_all<-c("lin...
c909e057f25e8fe0de6342916c61d7fca9cb382a8e14dca3bf5954e95b24aa90
R
8,354
215
# Load test data from STARsolo run, process with Seurat # AUTHOR: Adam Reid # Copyright (C) 2023 University of Cambridge # This program is distributed under the terms of the GNU General Public License library(Seurat) library(SeuratDisk) library(SeuratWrappers) library(stringr) library(dplyr) library(ggplot2) library(...
817d625901c75ca72786569c47432283c2fb833e2eaf17e8c9efc9a8884c616f
R
8,433
90
--- title: "Home" site: workflowr::wflow_site output: workflowr::wflow_html: toc: false editor_options: chunk_output_type: console --- # Citation Annapragada, A.V. Niknafs, N. White, J.R. Bruhm, D.C., Cherry, C., Medina, J.E., Adleff, V., Hruban C., Mathios, D., Foda, Z.H., Phallen, J., Scharpf, R.B., Velcules...
06e58597ff0d688c67e94dd882254f00836ada358d277f6687da6ec2f82443bf
R
8,457
147
library(data.table) signor_all_pathways <- fread("~/Signor_database/all_signor_pathways.tsv", sep = "\t", stringsAsFactors = F, data.table = F) signor_all_pathways$pathway_name <- gsub(" ", "_", signor_all_pathways$pathway_name) signor_pathwa_names <- unique(signor_all_pathways$pathway_name) # library(biomaRt) # en...
7d076ec609f3764c7e980d90c845beb8dd5c382fcbc5a9f6776839ca625e3b8a
R
8,552
303
# auxiliary functions for the QC of CNV and the plots # Written by Lucia Trastulla -- email: lucia_trastulla@psych.mpg.de find_centromere <- function(df_ch, initial = FALSE){ len <- length(df_ch) diff_pos <- df_ch[-1] - df_ch[-len] id_max_gap <- which.max(diff_pos) centr_coord <- df_ch[(id_max_gap):(id_...
e6f7e8030850a2c038210b79d6697541e03e09f017182582db8a47385ce4fc36
R
8,603
260
#' @import ggplot2 #' @importFrom randomForest randomForest #' @importFrom randomForest varImpPlot #' @importFrom randomForest importance #' @importFrom pROC roc RFCVSEED <- function(RF,seed_start=123,ntree=1000,core=1,kfold=5,rep=10,RF_importance=1,step=1,each_ouput=F){ value=c("MeanDecreaseAccuracy","MeanDecrea...
98026a7990638a3c44dfc7d8182628b57c46025e678c460c344e3546197d8c11
R
8,633
178
--- title: "S5_S6" output: workflowr::wflow_html: toc: false editor_options: chunk_output_type: console --- ```{r} library(here) library(data.table) library(tidyverse) library(devtools) library(ggplot2) library(ggpubr) library(cowplot) library(RColorBrewer) ``` Organize the data for the matrix ```{r} feature...
efaeb95682a104fa8d0bd0d56d932f4f4b6d4bff1e2d61e6eafa384b2c267899
R
8,656
179
library(data.table) library(dplyr) library(corrplot) library(Hmisc) library(ggpmisc) # Correlation analysis dat_corr<-read.csv("df_behavioural_ques_wide_subj25_2311_selected_v2.csv") df<-dat_corr[1:25,-c(1:2)] ## Fig. C2: c_df <- rcorr(as.matrix(df), type='pearson') corrplot(corr=c_df$r, p.mat=c_df$P, sig.level=0.0...
e986e1ac22c265667202470043b811fc9b2b85cbcd7058e6c8bea053c4a967be
R
8,670
224
# Compute the heatmap for the GT amtch and update the annotation file with the GT match # Written by Lucia Trastulla -- email: lucia_trastulla@psych.mpg.de suppressPackageStartupMessages(library(argparse)) suppressPackageStartupMessages(library('ComplexHeatmap')) suppressPackageStartupMessages(library('RColorBrewer'))...
5ab570e2a7c45ec767a29cc1120e52a5c66bd78a353c73b82ebb03d70fe4b5b1
R
8,747
321
#!/usr/bin/env Rscript library(here) library(data.table) library(gt) library(dunn.test) ### INPUT fpaths <- list( RDS = c("adnimerge_baseline", "adni-bl_volumes_hcvc") |> sprintf(fmt = "data/rds/%s.rds") |> here(), SRC = c("parse_adnimerge-bl", "qc_segmentations_adni-bl") |> sprintf(fmt = "code/data_parsi...
f8df4529f9f84d3ffa8fa8366c924e39c058371d614b87cc4f6824c59e2412e7
R
8,775
251
--- title: "Relative coverage plot and ROC" 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 load_data, echo=FALSE, include=FALSE} ...
94dedbec145e594a278b70e00cd043e248343e9d14d586603d54c4bd6f1536e2
R
8,865
156
library(tidyverse) library(Biostrings) library(rhdf5) source('helper.R') #------------------------------------------------------------------------------------------------------------------------------------ #--- examine predicted tail-length changes in ISM results (not iterative exclusion) kmer.gain <- read_delim('../...
d838086c8c26217a3c2d75b4667e03877fe1b52d6922677827c4f442b19f7e04
R
9,187
208
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") metaDD <- cdS@meta.data # remove the posterior-most sections and cell clusters of imaging artifacts # we also removed mi...
695c9c3f17f6f30c01ddc19d2fefa80edeb1cb3faa7ab125f59ec8253edd0a02
R
9,212
205
library(Seurat);library(tidyverse) cdS <- readRDS("data/integrated_all.rds") # reload data metaDD <- cdS@meta.data # remove the posterior-most sections and non-specific cells #(similar results obtained without filtering) meta_filtered = metaDD %>% filter(!ID1 %in% c("P1_X44675","P2_X44675","P1_X44677","P1_X49530","...
1389e871db2b06a7e9ebb03e8b81f1c97c19b846c002578b72addcea8e064de5
R
9,237
205
library('Cairo') library('ggrepel') library('RColorBrewer') library('viridis', quietly = T) library('ggpointdensity', quietly = T) library('signs', quietly = T) library('circlize') custom_breaks <- function(bmin, bmax, digits = 0, length.out = 8, zero = TRUE) { bmin = floor(bmin * (10 ^ digits)) / (10 ^ digits) bmax...