sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
10001d3ce6d4baf43e78a3496b9aa1333a8d9b96d6684d8049db7f3ddf902bf6 | R | 2,272 | 79 | #'
#' Class which generates output for every requested analysis.
#'
#' Reference class which is instanciated with an analysis description
#' as well as a plot generating function. With the command setData() the plots
#' are generated at runtime.
#'
#' @field description Description of the analysis
#' @field plot_fnc Fu... |
2d2daba829005686e882f88b6eb25482f6e4927111157531d718063b4d467276 | R | 2,272 | 82 | #' @name DEPRECATED-read.ini
#' @concept moved to hySpc.read.txt
#'
#' @title (DEPRECATED)
#' Read INI files
#'
#' @description
#'
#' These data input functions are **deprecated** and they will be removed in
#' the next release of \pkg{hyperspec} package.
#' Now functions in package \pkg{hySpc.read.txt}
#' ([lin... |
61cc04491fb198ff94f917f4d02f491141108ff09d07bc02c562a841563ea66a | R | 2,276 | 62 | ## input two table, each is from one rep
## version: 1.1
##table1 and table2 are the filenames with data
organizeExp <- function(table1,table2,col1,gene1=NA,tx1=NA,align=c("gene","tx"),col2=col1,gene2=gene1,tx2=tx1){
align <- match.arg(align)
# v1.1: Changing to no header and tab delimited for grit's bed like ... |
00a54900c19e761c95197aaa52a084836a69b684325add5b25aa79ed4bd768c7 | R | 2,280 | 89 | #!/usr/bin/R
# -------------------------------------------------------------
# Replot the modules representations for extended data figures:
# Updated 11/28/2021
# -------------------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
if (!exists("cellmeta")){
source(paste... |
76f72eb26748719177158584d25e25d3f61128e5205496842c58fde6ffb248a5 | R | 2,283 | 80 |
## <----------------- LIBRARIES
library(data.table)
library(fmsb)
## <--------------- MAIN
## Specify HPO ID for case cohort
h <- "hpo_id_here"
## Get all HPO terms
get_hpo_terms <- fread("/path/to/hpos.tsv")
colnames(get_hpo_terms) <- c("sample_id", "hpo_term")
## Read GA4K diagnostic status
ga4k_meta <- fread("... |
aed879b4d4decdf775c7b0edad6618cc8f020e300fbafaa390bcf24b65c9a502 | R | 2,283 | 67 | #!/usr/bin/env Rscript
# OPNMF on data matrix (subj x voxel) over a range of ranks or factors by steps
# of one. W = factor matrix, H = subject matrix
args = commandArgs(trailingOnly=TRUE)
### Arguments ####
## 1: relative path to data matrix (subj x voxel) as .rds file ##
## if matrix is in wd/data/mat.rds then ar... |
f6bdeeab4e4989b5d27924de43d6c77e831d6d1cba4857a02614c623bb4f7fd4 | R | 2,283 | 73 | library(tibble)
library(stringr)
library(arrow)
library(yardstick)
library(ggplot2)
library(gdata)
library(dplyr)
library(logger)
config = snakemake@params[["config"]]
# use_rank = snakemake@params[['use_rank']]
phenotype = snakemake@params[["phenotype"]]
top_q = as.numeric(snakemake@params[["top_q"]])
phenotype_su... |
a91110b263cc3f091847211b5c885e5c9c1c9a57d6cabf7caec5db4a4a3224c4 | R | 2,293 | 98 | options(bitmapType='cairo')
args <- commandArgs(TRUE)
name<-args[1]
dataColumn<-as.numeric(args[2])
skip<-as.numeric(args[3])
minY<-as.numeric(args[4])
maxY<-as.numeric(args[5])
fileArray=args[6:length(args)]
nFiles=length(fileArray)
cat("found ",nFiles," files.\n")
for (i in 1:nFiles) {
arg<-fileArray[i]
cat("\t"... |
0b9dbe8d7d133c7e0ec6c3aa9bae4c45aa23a24a46cb37ea9fc320c22c4cc589 | R | 2,301 | 53 | library(pROC)
library(PRROC)
library(tidyverse)
library(writexl)
source("Functions.R")
###########################################################
# This is for the predictions based on image metrics.
###########################################################
predictions = read_tsv("PMC_Results_Predictions.tsv") %>... |
46a128540085dc2894a7919a072a07c0253b973f6463541117250b8fb5d7ae2d | R | 2,308 | 73 | #' @name DEPRECATED-normalize01
#' @aliases normalize01
#' @concept deprecated
#'
#' @title (DEPRECATED)
#' Normalize numbers to interval \[0, 1\]
#'
#' @description
#' These \pkg{hyperSpec} functions are **deprecated** and not maintained any
#' more. You should not use these.
#' Currently they are present due t... |
c4e2f40accbbb91d9794aa0081ee69716fde1ffeea7df2bd289d3f0e97c3c597 | R | 2,308 | 63 | setwd("D:/Brain_region_project/Brain_region_final")
library(ggplot2)
library(Seurat)
pbmc=readRDS("Ast_integrated2.rds")
DefaultAssay(pbmc)<-"RNA"
addition=read.table("Ast_Metadata2_addition_cell_type_highres.txt",header=TRUE,row.names=1,sep="\t")
pbmc=AddMetaData(pbmc,addition)
Idents(pbmc)<-"cell_type_high... |
fe8bef21e23b37d271cb11b2481a82738e76b857785c603385709499173ae62c | R | 2,310 | 62 | # Sickness behavior analysis across cohorts
# Jenn Kim
# load libraries
library(tidyverse)
library(cowplot)
theme_set(theme_cowplot())
library(nlme)
library(lsmeans)
# load data
data <- read.csv("SicknessBehavior.csv") %>% select(-X)
data <- as.data.frame(data)
data$LPS.Treatment <- factor(data$LPS.Treatment, levels... |
b94cffb729a6221054520ee435acb1b897c34af63049e8ab5a4192b3a7ea5721 | R | 2,322 | 100 | options(bitmapType='cairo')
args <- commandArgs(TRUE)
name<-args[1]
dataColumn<-as.numeric(args[2])
skip<-as.numeric(args[3])
minY<-as.numeric(args[4])
maxY<-as.numeric(args[5])
fileArray=args[6:length(args)]
nFiles=length(fileArray)
cat("found ",nFiles," files.\n")
for (i in 1:nFiles) {
arg<-fileArray[i]
cat("\t"... |
56eef61aee60db570be37150e5402b9c3f3deea871ef6aeb9bfbe3c75b4e8ca6 | R | 2,327 | 68 |
options(stringsAsFactors = FALSE)
library(reshape2)
library(plyr)
library(data.table)
library(openxlsx)
library(doParallel)
library(limma)
library(parallel)
all_SEG <- read.xlsx(xlsxFile = "Mic.SEG.xlsx", sheet = "all.SEG")
DA9_SEG <- read.xlsx(xlsxFile = "Mic.SEG.xlsx", sheet = "da.SEG")
MEGENA_df <- read.xlsx(xls... |
4f251cde56db497f59fd2132055816bbbd31f30b8fd808045b729aaa356c5de7 | R | 2,329 | 56 | #' Clear Stan Model Cache
#'
#' @description
#' This function removes the Stan model cache directory and all its contents. The cache is used by cmdstanr to store compiled Stan models.
#' Clearing the cache can be useful when:
#' \itemize{
#' \item You're experiencing issues with cached models
#' \item You want to f... |
8f64f68af4ecba0b43ba39a573d0dd4d16502ff7b158b8c85649c0758a582fa8 | R | 2,329 | 55 | #' @title Compare summary statistics and PLINK .bim data.frames
#'
#' @param ss.df A data.frame of summary statistics
#' @param bim.df a data.frame from A PLINK .bim file
#' @param exclude.ambiguous should ambiguous SNPs (i.e. A/T or G/C) be excluded
#' @details Both \code{ss.df} and \code{bim.df} must be \code{data.f... |
f117221e4647ef8119339e3cb5962f8e8bcbe8fe200942ac62f6a8ef06e83c64 | R | 2,331 | 83 |
library(seurat)
library(monocle3)
library(SeuratObject)
#remotes::install_github('satijalab/seurat-wrappers')
library(SeuratWrappers)
# Read in the seurat object for koenig et al:
koenigPath = "./koenig_et_al_data/koenig_nuclei.Robj"
load(koenigPath)
# object "nuclei" is the seurat object holding all nuclei
koenigNu... |
299c3b269a7e68be28ed37a334c24fa10990f5b09f731861df6f6b379aa1c433 | R | 2,335 | 69 | #!/usr/bin/R
# ---------------------------------------------
# Load the coordinate system for modules' UMAP:
# Updated 01/25/2023
# ---------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
if (!exists("cellmeta")){ source(paste0(sbindir, 'load_metadata.R')) }
options(width=170)... |
0d57bddf9b9b4802fff70f084de69d672ddc5dbab2c1114d380ec4897644c08b | R | 2,341 | 99 |
#### Select ROIs ####
## -------------------
setMethod("selectROI", "SpectralImagingExperiment",
function(object, ..., mode = c("region", "pixels"))
{
mode <- match.arg(mode)
if ( ...length() > 0L ) {
plot <- plot(image(object, ...))
} else {
plot <- plot(.last$image)
}
.select_ROI(object, plot, mode)
})
#... |
90acc04fd0bdd8d7f8ac9571942ed7ee7fa866be69cdab211ee7f053634b2682 | R | 2,343 | 72 | #' @name DEPRECATED-read.asc.PerkinElmer
#' @concept moved to hySpc.read.txt
#'
#' @title (DEPRECATED)
#' File import filter PerkinElmer ASCII spectra
#'
#' @description
#'
#' These data input functions are **deprecated** and they will be removed in
#' the next release of \pkg{hyperspec} package.
#' Now function... |
7acbfb8234b15bd8ff692a16a3c038381945918c73c1a02a29c9eb0d73d90f64 | R | 2,344 | 76 | merge.lassosum.pipeline <- function(...) {
#' Merge a list of lassosum.pipeline objects
#' @param ... \code{lassosum.pipeline} objects, separated by commas
#' @export
l <- list(...)
names(l) <- NULL # This will save a LOT of memory!!!
# Otherwise c() starts concantenating the names also
... |
4aeea5afa3dd9040ac3a2c5d9b2b68575ae22936a259ebbf237891a0e50521c6 | R | 2,345 | 67 | if (!require("dplyr")){
install.packages('dplyr')
library(dplyr)
}
set.seed(026)
cov=read.table("./Integ_var_invar.txt",sep=" ",header=TRUE)%>%
select(SubID,sex,ImagingCentreID,Handedness)%>%unique()
imagen=read.table("./IMAGEN_full_v4_all_Age.txt",sep=" ",header=TRUE)
group_member=read.table("./gro... |
77d72dc282e39a65c1bf608011367918813e1aebaf8fea4a35a4310bff84e790 | R | 2,347 | 50 | setwd("F:\\Manuscript\\ATAC\\data")
library(dplyr)
peak_gene <- read.csv("AllPeakList.merged.ReadCount.PeakToGene_Feature.csv", header = T)
TisSpeGene <- read.csv("F:\\ATAC\\processFiles\\RNA-tissue_specific0711\\RNA-Tissue_specific.genes.csv", header = T) %>% arrange(.,Var1)
##extract the peaks that can be ann... |
41d2c158a15ff887a6b990d4571b2588de7c174f461c766c5503110b94ef590d | R | 2,361 | 75 | ##1) convert reads count based gene expression to TPM based
library(dplyr)
library("DGEobj.utils")
setwd("C:\\Users\\qjp\\Desktop\\Manuscript\\RNA\\Ori\\data\\featureCount\\")
data <- read.csv("GeneExpressionAllSamples.csv", header = T, row.names = 1) %>% as.matrix()
length <- read.csv("GeneLength.csv", row.... |
2c03ab1919dda17923fffa9d398044899abc40a2f9fb3a70d457016adf36a782 | R | 2,362 | 75 | #!/usr/bin/R
# -------------------------------------------------
# Collate lists of markers for pseudobulk plotting:
# Updated 04/29/22
# -------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
source(paste0(sbindir, 'load_metadata.R'))
library(tidyr)
library(ComplexHeatm... |
88af5932c1f33477413e551e314f19681165162a0458b8754fbd8fe21ae58a39 | R | 2,363 | 75 | ##1) convert reads count based gene expression to TPM based
library(dplyr)
library("DGEobj.utils")
setwd("C:\\Users\\qjp\\Desktop\\Manuscript\\RNA\\Ori\\data\\featureCount\\")
data <- read.csv("GeneExpressionAllSamples.csv", header = T, row.names = 1) %>% as.matrix()
length <- read.csv("GeneLength.csv", row.... |
2953f8e7181b1019507dba87facf273a32028171b3c812d0370be4426cac3148 | R | 2,365 | 36 | library(data.table)
library(dplyr)
for(tis in c("Lung", "Muscle")){
m6A_anno <- fread(paste0("~/Downstream_analysis/m6A_Genomic_enrichment/", tis, ".m6A_peaks.merged_tested.anno.txt"), sep = "\t", header = TRUE) %>%
rename(Peak_ID = matches("PeakID")) %>%
select(Peak_ID, Annotation) %>%
mutate(Annotation = gsub... |
45e06ff9d6b8beb619c579ba69650ba9587f93e0f74364a72f879219ce474a2b | R | 2,371 | 71 |
basepath = "/net/trapnell/vol1/home/readdf/trapLabDir/hubmap/results/2021_07_15_Greg_ATAC_Code_nobackup/"
# dir.create(paste0(basepath, "archr/"))
# dir.create(paste0(basepath, "archr/results/"))
out_path = "/net/trapnell/vol1/home/readdf/trapLabDir/hubmap/results/2021_07_15_Greg_ATAC_Code_nobackup/"
blacklist = read.... |
ab495054e69b12ce8ee4265269da03a3cfc13c3cc8f7c0d3da5f438ea814c0b7 | R | 2,383 | 70 | #!/usr/bin/R
# -----------------------------------------------
# Aggregate all DEGs results for EC / HC neurons:
# Updated: 12/06/2021
# -----------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
source(paste0(sbindir, 'load_metadata.R'))
library(tidyr)
# Directories:
regdir =... |
642cb03cf390f2b8ca4be97b9da48bd5d30bff9650a107fb2372604a902f8caa | R | 2,386 | 51 | # Tmisc()
# Tim.load(lassosum)
# exec <- attachroot("~/WORK/myRpackages/lassosum/inst/lassosum.R")
# system(paste("chmod +x", exec))
# # system(exec)
# setwd(tempdir())
# f <- function(file="") paste0(system.file("data", package="lassosum"), "/", file)
# ss <- read.table2(f("summarystats.txt"), header=TRUE)
# options <... |
47d42e95554286fbd230d980162bc2514dae625fa61a281fac5231e19efe1134 | R | 2,388 | 71 | library("batchtools")
## use the bath tools for RNA contamination detection and doublet removal
setwd("./Step5.FinalClustering")
reg <- makeExperimentRegistry("FindMarker.Registry",
packages = c("tidyverse", "Seurat", "data.table"),
seed = 20221005)
reg <- ... |
3d8e278422614fd93822b1d1b5bfb941b18cb887891e75e0a3d8f6a444113571 | R | 2,390 | 84 | output_dir <- file.path("EMC-SKlab-scRNAseq", "results", "test_pipe")
# files and sample names
sample_files <- c("C:/Users/mauri/Desktop/Single Cell RNA Sequencing/EMC-SKlab-scRNAseq/results/Pipe_SCTv2_23-06 cluster_level_selection/BL_A/BL_A.qs",
"C:/Users/mauri/Desktop/Single Cell RNA Sequencing/EMC-... |
7a82a569dd17f1fd7347b4ff7391597c9c23b326ab192280edd712287eeed95d | R | 2,390 | 73 |
basepath = "/net/trapnell/vol1/home/readdf/trapLabDir/hubmap/results/2022_04_03_redoATAC_proc_nobackup/"
# dir.create(paste0(basepath, "archr/"))
# dir.create(paste0(basepath, "archr/results/"))
out_path = "/net/trapnell/vol1/home/readdf/trapLabDir/hubmap/results/2022_04_03_redoATAC_proc_nobackup/"
blacklist = read.ta... |
0fe52cc10bc68b24caf4b8fbb1ec8d7794956e1f94f41d172caf98f8ee2cbf75 | R | 2,391 | 70 | #!/usr/bin/R
# -----------------------------------------------
# Functions for processing gprofiler enrichments:
# Updated 12/09/2022
# -----------------------------------------------
library(cbrbase)
library(tidyr)
library(gprofiler2)
library(ComplexHeatmap)
library(circlize)
source(paste0(sbindir, 'auxiliary_plottin... |
f8ef44a73affc7739283fc88393161b0bab07d9dc38259dd598c8e1e9f55be5d | R | 2,396 | 80 | #!/usr/bin/R
# --------------------------------------------
# Plot the expression patterns for GWAS genes:
# Updated 12/17/2021
# --------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
if (!exists("cellmeta")){
source(paste0(sbindir, 'load_metadata.R'))
}
source(paste0(sbi... |
966af6351a8e730d2268aba965a4bcbb8ed3f4e5ed32dd5560331cd1dad1144a | R | 2,405 | 73 | library(dplyr)
region_list = c("AG","EC","HC","MT","PFC")
for (i in 1:length(region_list)){
region=region_list[[i]]
directory=paste0("D:/Projects/Large_scale_snRNA_seq/Brain_region_project/Brain_region_final/Evaluate_overlap_SEA_AD/Permutation_test/plaq_n/Overlap_results_up/",region)
setwd(directory)
obse... |
bf2a559e0245c4fb02c92edd33d2bc7a9387d9ab7a966f3b6a63a44acb828457 | R | 2,406 | 70 | library(dplyr)
integrated <- qs::qread("C:/SynologyDrive/Projects/scRNAseqR/results/sakshi_4/NSM-NS-NC-M/NSM-NS-NC-M.qs")
integrated$kriegstein.seurat.custom.clusters.mean
integrated$mapmycells_supercluster
idents <- paste(integrated$orig.ident, integrated@meta.data[, "kriegstein.seurat.custom.clusters.mean"], sep = "... |
2111ef04df2315eba890a7acf4aa93ad48ba1a3a5ec6c46705e58e934fed5f62 | R | 2,409 | 75 | library(data.table)
library(dplyr)
df_bim <- fread("UKB_random10k_noqc.bim",
sep="\t", data.table = F, col.names = c("chr", "snp", "cm", "bp", "ref_ukb", "alt_ukb"),
nThread = 20) %>%
dplyr::select(snp, ref_ukb)
### MetS_lind GWAS
trait <- "MetS_lind"
file_gwas <- "UKBB_MetS... |
97966e17fa0504007f26ca57a0a419472ac76e63a247e5a58a44733b50894c2c | R | 2,411 | 73 | library(dplyr)
region_list = c("AG","EC","HC","MT","PFC")
for (i in 1:length(region_list)){
region=region_list[[i]]
directory=paste0("D:/Projects/Large_scale_snRNA_seq/Brain_region_project/Brain_region_final/Evaluate_overlap_SEA_AD/Permutation_test/plaq_n/Overlap_results_down/",region)
setwd(directory)
ob... |
c9f85c5e6529f86f5aff8cdafe3f06a921f25273e3a1412c1e92afd4aa5c8bc3 | R | 2,413 | 80 | test_that("contrast key aliases are mapped and unknown keys error", {
lg <- lgr::get_logger("test-contrast-key-validation")
lg$set_threshold("fatal")
mobj_diag <- list(level = 1L, regressors = "stim")
class(mobj_diag) <- c("list", "l1_model_spec")
alias_spec_diag <- list(
name = "basic",
signals = l... |
0c820f3998769a9dbc3bd8ce71f57a9c87dc24272c1eb8447a9785741d2c26a6 | R | 2,414 | 73 | ## ---------- Script -----------------
##
## Purpose: input variables for characterising QC of ONT targeted mouse transcriptome datasets
##
## Author: Szi Kay Leung (S.K.Leung@exeter.ac.uk)
## ---------- Packages -----------------
suppressMessages(library("dplyr"))
## ---------- LOGEN modules -----------------
L... |
0d7840d2ad90356fa43b4c33d8d436d2a48e2f9d05f310217f09cafc1c0ae676 | R | 2,423 | 81 | ---
title: "Auc Guide for NosaAnalysis"
author: "Julia Thüringer"
date: '`r Sys.Date()`'
output:
html_document: default
pdf_document: null
vignette: >
%\VignetteIndexEntry{Auc Guide for NosaAnalysis}
%\VignetteEngine{knitr::rmarkdown}
\usepackage[utf8]{inputenc}
---
### Description
```{r description, eval=T... |
8423308bbb83363ca0a0a388fc7e06a51de8ae167c863b93d651f19d6a48557b | R | 2,428 | 65 | library(testthat)
library(dplyr)
# Load the testing set
test_citations <- read.csv("labelled_test_set.csv")
test_citations <- as.data.frame(test_citations)
# Test case: No record_id column
test_that("No record_id column", {
test_citations_no_col_for_id <- test_citations %>%
select(-record_id)
w <- capture_wa... |
75db342ee7dc21a18a2f66fb1ade860ed24904bec65f40700b2c777ed75443fb | R | 2,431 | 120 |
#### Deprecated and defunct ####
## -----------------------------
setMethod("fetch", "SpectralImagingData",
function(object, ...)
{
.Deprecated()
spectraData(object) <- fetch(spectraData(object), ...)
if ( validObject(object) )
object
})
setMethod("flash", "SpectralImagingData",
function(object, ...)
{... |
67fdb8e3e98a6827100fd52e15e1836111bbf7f1c11ac598c82f543e459d6fb2 | R | 2,440 | 83 | #' @name DEPRECATED-spc.spline
#' @concept deprecated
#'
#' @title (DEPRECATED)
#' Spectral smoothing by splines
#'
#' @description
#'
#' These \pkg{hyperSpec} functions are **deprecated** and not maintained anymore.
#' Currently they are present due to back-compatibility reasons and will be removed
#' in the ne... |
740bdc7e66848e879dd0155469625de8e311ecadb87956de52de9520b840434d | R | 2,450 | 98 | #!/usr/bin/R
# ----------------------------------------------
# Intersect the SCENIC regulons with the modules
# Updated 01/25/2022
# ----------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
if (!exists("cellmeta")){
source(paste0(sbindir, 'load_metadata.R'))
}
source(past... |
b9de13644b99a9b9da8c41042defceae33ff2756da266c0deebfc5e86042c98f | R | 2,453 | 71 | #!/usr/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)
# Create masked GM matrix (subj x voxels) for OPNMF analyses #
### Arguments ###
# 1: Species investigated - "chimp" or "human"
# 2: Name of meta data .csv file #
# 3: Name and relative path of GM mask Nifti image #
wd <- "~/projects/chimp_human_opnmf/"
... |
bad9e07e2fe6c4491f0caf3ddb21d41ae19099916a422f91440ca985ea01d8c3 | R | 2,467 | 76 | #!/usr/bin/R
# ------------------------------------------
# Plot pathology measurements by region, ABC
# Updated 11/10/2023
# ------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
source(paste0(sbindir, 'load_metadata.R'))
library(tidyr)
library(ggplot2)
library(ggpubr)
library... |
eb010e5b47cd361b6e3f84d33aece0195d5ab063a3bddafd4c83e097e0559136 | R | 2,467 | 76 | options(bitmapType='cairo')
args <- commandArgs(TRUE)
inputFile_1<-args[1]
inputFile_2<-args[2]
name<-args[3]
dataColumn<-as.numeric(args[4])
skip<-as.numeric(args[5])
outlierFraction<-as.numeric(args[6])
correlationMode<-args[7]
if((outlierFraction > 1) | (outlierFraction < 0)) {
outlierFraction<-0.05
... |
3ca51f42581b2e6cfb19f00b3d485e58bf2f51efdea5e576880496d9f6a89fde | R | 2,476 | 84 | library(tidyverse)
library(ROGUE)
out.path <- "/home/pauling/projects/04_SEmodel/01_data/04_rogue/09_simulation_rogue/01.vary.gene/01.NB"
simul_da <- function(gene_means, r = 2, n_gene = 10000, n_cell = 2000, ZINB = F){
sda <- matrix(data=NA, nrow=n_cell, ncol=n_gene, byrow=FALSE, dimnames=NULL)
gene_means <- gen... |
aa7b24137f4ac86495e5bcf7203dd8a25c7f281b918ec4e0546ebdc908300a4a | R | 2,476 | 83 | #!/usr/bin/R
# ---------------------------------------------------
# Plot GWAS genes against modules + flag as DE / not:
# Updated 12/21/2022
# ---------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
if (!exists("cellmeta")){
source(paste0(sbindir, 'load_metadata.R'))... |
e0572a9e14a8bb93e031b1e18c89b85e6c1820379210853e0efe28cf8dff10e0 | R | 2,477 | 72 | ---
title: "Simple Deduplication"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Simple Deduplication}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
## **Setup**
First, install and loa... |
c69826414f5ad5da829a65b8603e657941eac4de6291a11d482ada3fafdede1c | R | 2,480 | 66 | log <- file(snakemake@log[[1]], open = "wt")
sink(log)
sink(log, type = "message")
suppressPackageStartupMessages(library(DESeq2))
suppressPackageStartupMessages(library(ggplot2))
suppressPackageStartupMessages(library(cowplot))
# load deseq2 data
dds <- readRDS(snakemake@input[[1]])
# obtain normalized counts with ... |
950203dc9e4a330a124914efef2c2751001cfceec085be09741ad1bb7dfb34ca | R | 2,484 | 80 | ---
title: "02_betacorrection"
author: "Veronica Mandelli"
date: "10/12/2022"
output: html_document
---
### load libraries and set paths
```{r}
# load libraries
library(gridExtra)
library(ggplot2)
library(reshape2)
# set paths
work_dir = "..."
codepath = file.path(work_dir,"code")
datapath = file.path(work_dir,"resul... |
7ccbc16c85f6c86de2606db9e329e344e9d81ab7d739a80b229bd1442d112ab8 | R | 2,485 | 81 | extract_contrast_names <- function(contrasts, model_name = NULL, level_label = "model", allow_empty = TRUE) {
checkmate::assert_string(level_label)
checkmate::assert_flag(allow_empty)
if (is.null(contrasts)) {
if (isTRUE(allow_empty)) return(character(0))
stop(
sprintf("No %s contrasts available fo... |
cad6f1f61917d6ddf431b89ace12fa70d3459341f451b94de8946a059a55f5ec | R | 2,485 | 57 | ## ---------- Script -----------------
##
## Script name:
##
## Purpose of script:
##
## Author: Szi Kay Leung
##
## Email: S.K.Leung@exeter.ac.uk
##
## ---------- Notes -----------------
##
##
##
##
##
## ---------- Directory -----------------
WKD_ROOT <- "/gpfs/mrc0/projects/Research_Project-MRC148213/sl693/r... |
b7f682428af668b3592943f958162ddbf6f27bbd87aef570a027db16faf9a552 | R | 2,493 | 96 | library(TwoSampleMR)
library(MRInstruments)
### Exposure data preparation
exp_clumped_file_path <- "MetS_exposure_clumped.rds"
if (file.exists(exp_clumped_file_path) == FALSE){
exposure_file <- "MetS_exposure.csv"
exp_dat <- read_exposure_data(
filename = exposure_file,
sep = ",",
snp_col = "SNP",
... |
c966a16b797f56f0f0fcaf2e145e45738ddd33e4ce0fe881ff46a13b29590a0c | R | 2,499 | 74 | library(dplyr)
region_list = c("AG","EC","HC","MT","PFC")
for (i in 1:length(region_list)){
region=region_list[[i]]
directory=paste0("D:/Projects/Large_scale_snRNA_seq/Brain_region_project/Brain_region_final/Evaluate_overlap_OteroGarcia/Permutation_test/nft/Overlap_results_up/",region)
setwd(directory)
... |
7b899e6de2067ecdd9ee14a33487713166a61354cbf752e5e6dcec4b8a546d6f | R | 2,503 | 74 | library(dplyr)
region_list = c("AG","EC","HC","MT","PFC")
for (i in 1:length(region_list)){
region=region_list[[i]]
directory=paste0("D:/Projects/Large_scale_snRNA_seq/Brain_region_project/Brain_region_final/Evaluate_overlap_OteroGarcia/Permutation_test/nft/Overlap_results_down/",region)
setwd(directory)... |
4860304226a59c5e436e6f623442ec2ad0e9498866788504cdf43680e1079154 | R | 2,510 | 77 | library(Rcpp)
library(stringr)
library(arrow)
library(yardstick)
library(ggplot2)
library(gdata)
library(dplyr)
library(tidyr)
library(logger)
log_info("Snakemake params: {snakemake@params}")
config = snakemake@params[["config"]]
log_info("Config: {config}")
# use_rank = snakemake@params[['use_rank']]
use_rank = FALSE... |
754783eac0eb02a97c3d8867553ac9fd16384519182d7832b167e3bacf65068b | R | 2,510 | 57 | #' @title draw_heatmap_gene_level
#' @description This function uses hierarchal clustering to plot a heatmap of the gene expression across samples
#' @param diff_genes: tappAS output of list of differentially expressed genes
#' @param genelevel_exp: tappAS output of normalised gene expression values
#' @param type: "g... |
e78d1eb6dd332f89a39163ccdc11753e2f078a7db6d3734d333fbe9760ad3d54 | R | 2,516 | 81 | # Function -------------------------------------------------------------------
.scale <- function(x, center = TRUE, scale = TRUE) {
validObject(x)
if (!is.logical(center)) center <- as.matrix(center)
if (!is.logical(scale)) scale <- as.matrix(scale)
x@data$spc <- scale(x@data$spc, center, scale)
x
}
#' C... |
73a495912ed5b68047de55e23ac54b8569ab0987c5d0bb145633b8bd09175ab2 | R | 2,517 | 49 | test_that("get analyser object", {
refGen = get("SEM_Analyser")
ana = refGen$new()
expect_equal(ana$ana_name, "SEM")
expect_equal(length(ana$plots), 0)
})
test_that("generates plots and plot_data", {
yaml = get_testyaml_object("dir", analyser = "SEM",
changes = c("DataSettings$St... |
a19261f6ceb56785e7771a0c41da20c73ad242b09d0709b7b760b9a6f2792443 | R | 2,520 | 58 | library(ComplexHeatmap)
library(circlize)
library(dplyr)
setwd("D:/Projects/Large_scale_snRNA_seq/Brain_region_project/Brain_region_final/Evaluate_overlap_proteomics/Correlation_EffectSize/Results")
pval=read.csv("Pval_adj_plaq_n.csv",row.names=1)
correlation_coefficient=read.csv("Correlation_coefficient_plaq_... |
d7bc43ff6e64645e8748b37609b3191e95b0dc2899b631677af65dd7043c0c8c | R | 2,525 | 91 | options(bitmapType='cairo')
library("ggplot2")
library("reshape")
args <- commandArgs(TRUE)
name<-args[1]
dataColumn<-as.numeric(args[2])
skip<-as.numeric(args[3])
minX<-as.numeric(args[4])
maxX<-as.numeric(args[5])
fileArray=args[6:length(args)]
nFiles=length(fileArray)
cat("found ",nFiles," files.\n"... |
579bb0b7b12080e254e91e7266a8f2d662711da41ad27033dc9438534f91b191 | R | 2,527 | 69 | #!/usr/bin/env Rscript
# OPNMF on data matrix (subj x voxel) over a range of ranks or factors by steps
# of one. W = factor matrix, H = subject matrix
args = commandArgs(trailingOnly=TRUE)
### Arguments ####
## 1: relative path to data matrix (subj x voxel) as .rds file ##
## if matrix is in wd/data/mat.rds then ar... |
b92bbdff85ece8a5304ef53b180926a561777ede635781475343b48d8392e648 | R | 2,529 | 75 | library(tidyr)
library(dplyr)
library(purrr)
options(dplyr.summarise.inform = FALSE)
phenotype_suffix = snakemake@params[['phenotype_suffix']]
linear_model_res_path = snakemake@params[['linear_model_res_path']]
this_quantile = as.numeric(snakemake@params[['quantile']])
phenotypes = snakemake@params[['phenotypes']]
di... |
b8ff66231cdc34e77e629f8553f83dc30d4406acc33ab65af65328b5c5cf5f8a | R | 2,535 | 87 | #!/usr/bin/R
# --------------------------------------------------------
# Plot the aggregated DE results across different methods:
# for specific examples (e.g. P2RY12 for reviewer)
# Updated: 11/30/23
# --------------------------------------------------------
library(cbrbase)
set_proj('DEVTRAJ', 'multiRegion')
source(... |
14cd553b9e1121b1313a5fda228d903526c6ca0149fd6cd813d51ec3bbe22c35 | R | 2,556 | 66 | # Create violin plots for the chimp and IXI whole sample meta data #
# to show age, sex, & scanner distribution #
wd <- "~/projects/chimp_human_opnmf/"
setwd(wd)
# load in libraries needed for script #
# need to install pacman if not already installed
if (!require("pacman")) install.packages("pacman")
pacman::p_load... |
1029968e6886fc70479974395d8b22b79b8fe031731224f111e31aa5ceaf1afe | R | 2,557 | 69 | library(dplyr)
library(gridExtra)
setwd("F:/Brain_region_project/Module_scores_DEGs/Module_scores_PFC427DEGs/Results")
data=read.csv("OPC_metadata.csv")
colnames(data)
###############################################################################
#Load metadata
setwd("F:/PFC_429_final_Spring2021/Vanshika"... |
4061d541485f213cae6908ff254efffd042b614f7e17da2cb16eec53f816db0c | R | 2,557 | 69 | library(dplyr)
library(gridExtra)
setwd("F:/Brain_region_project/Module_scores_DEGs/Module_scores_PFC427DEGs/Results")
data=read.csv("Mic_metadata.csv")
colnames(data)
###############################################################################
#Load metadata
setwd("F:/PFC_429_final_Spring2021/Vanshika"... |
8973febb2e90adce6903ec66384eac6f8ca7a667d8268c28ef9945fccfaf577a | R | 2,557 | 69 | library(dplyr)
library(gridExtra)
setwd("F:/Brain_region_project/Module_scores_DEGs/Module_scores_PFC427DEGs/Results")
data=read.csv("Oli_metadata.csv")
colnames(data)
###############################################################################
#Load metadata
setwd("F:/PFC_429_final_Spring2021/Vanshika"... |
dc2ea978b922b5230cf6149a0ec2b296fcfa7c11c828d13a182634ad2267637f | R | 2,557 | 69 | library(dplyr)
library(gridExtra)
setwd("F:/Brain_region_project/Module_scores_DEGs/Module_scores_PFC427DEGs/Results")
data=read.csv("Ast_metadata.csv")
colnames(data)
###############################################################################
#Load metadata
setwd("F:/PFC_429_final_Spring2021/Vanshika"... |
40c453efc8ecd515002dbfb96b3d398137642cf1528754ee7ba13b42f149318d | R | 2,563 | 94 | library(ROGUE)
library(tidyverse)
library(ggplot2)
## Plot
pauling.theme <- function(poi = "right", size = 12, title.size = 15){
theme(
legend.position = poi,
axis.title = element_text(size = title.size,color="black"),
axis.text = element_text(size = size,color="black"),
legend.title = element_text(... |
9dab78e5473afbcc898531f14bb41d7ddf7da5ce947648eba6dfa2363095161f | R | 2,577 | 83 | ##
cd /mnt/home/quanjian/resources/ASElist
grep -f AGE.list <(awk '$3=="gene"' /mnt/home/quanjian/resources/Sus_scrofa.Sscrofa11.1.98.gtf|cut -f1,4,5,9)|cut -d ';' -f1|sed 's/gene_id "//g'|sed 's/"//g'|sort -k1,1n -k2,2n > AGE.bed
grep -f POE2.list <(awk '$3=="gene"' /mnt/home/quanjian/resources/Sus_scrofa.Sscro... |
ea205925eb9b3b09a0dfdd96995d175ac0d668cfbe543c91c1329248ac3c8035 | R | 2,577 | 92 | # Greg Booth 2021
# This script creates an ArchR project by combining all arrow files from HEART
# It then filters cells based on the filtered cds objects previously created
# for each sample
basepath = "/net/trapnell/vol1/home/readdf/trapLabDir/hubmap/results/2022_04_03_redoATAC_proc_nobackup/"
dir.create(paste0(ba... |
31998668fffc0f214c4787b42d4f9e017e26528b92cb64ba92dc3bae70a7fc9b | R | 2,579 | 65 | test_that("one stimulus, unpaired", {
pdf(NULL) # to prevent generating an empty RPlots.pdf
yaml = get_testyaml_object("dir", analyser = "Responses", changes = c("DataSettings$Stimulus$Time = 4",
"DataSettings$Stimulus$Name = 'x'"))
ana = ge... |
d175cedc97f2ec97d3fbd9cc6d876583c3a284fe7e8b1985c2193dda1c87a4bc | R | 2,581 | 69 | library(data.table)
library(dplyr)
library(survival)
library(survminer)
library(ggplot2)
source("00_read_prs.R")
######### References
######### Read PRS
df_prs <- read_PRS()
######### Read covariates
file_in.cov <- "reformat.ukb.covariates.csv"
df_cov <- fread(file_in.cov, sep=",", data.table = F, nThread = 5)
####... |
3a7f836f414dfae1182053323261dfa2ac9e485a564b2483446d75a00666dbfc | R | 2,582 | 61 | #create weight of variants based on MAF
MAFcut=0.0001
rareCut=0.001
dirtail='PTV.misCADD15.Poly.01NA_I.1'
dir=paste0('/mnt/analysis-psp/users/timchang/v3/pc/2211/results/hwe/vcffilter/',dirtail,'/')
inhead='PSP.chr'
intail='.filter.out'
outtail='.c.vcffilter.out'
wtouttail='.weight.out'
assocdir='/mnt/analysis-psp/us... |
9cc06d7335add9d96370bd40461828a27cf10d522a203cd9f1d8639e4f8c93d6 | R | 2,582 | 92 | #' @aliases levelplot,hyperSpec,missing-method
#' @include plot_map.R
#' @rdname levelplot
#'
#' @export
#' @concept plotting
#' @concept plotting tools
#'
#' @seealso [`hyperSpec options()`][hyperSpec::options] [identify_spc()]
#' [map.sel.poly()]
#' @param tol tolerance for `map.identify` as fraction of the viewport... |
81a31a7edf288eb9a5582cf714c2ffd2dabbc0d200c77deb173d6dcd91bcf751 | R | 2,591 | 105 | suppressPackageStartupMessages({
library(Seurat)
library(magrittr)
library(dplyr)
library(purrr)
library(stringr)
library(forcats)
})
mk_seurat <- function(dir_path) {
meta <- paste(dir_path, "meta.csv", sep = "/") %>%
read.csv(
row.names = 1,
numerals = "no.loss"
) %>%
mutate(
... |
0f6075cd871b55a4a185334c24f4c29a333be4b8c18d843606f6356092c18178 | R | 2,592 | 76 | library(dnapath)
library(clustifyr)
#gl <- gmt_to_list(path = "data/reactome/ReactomePathways1.gmt",cutoff=20)
source("normalized_to_dna.R")
source("dna_to_summary.R")
source("init_required_packages_and_files.R")
dir_counts <- "./data/counts/"
dir_output <- "./output... |
180345840f501c87680d8d8806c725435b1c8500c155203ebea7d2560b8760ef | R | 2,592 | 89 | #' @name DEPRECATED-spc.identify
#' @concept deprecated
#'
#' @title (DEPRECATED)
#' Identifying spectra and spectral data points
#'
#' @description
#' These \pkg{hyperSpec} functions are **deprecated** and not maintained any
#' more. You should not use these.
#' Currently they are present due to back-compatibil... |
66facaca4dd747178dc81f8e0fb89c72aee0616edbf1c6a6c8490fd68edccb22 | R | 2,592 | 88 | #' @name DEPRECATED-baselines
#' @concept deprecated
#'
#' @title (DEPRECATED)
#' Polynomial baseline fitting
#'
#' @description
#' These \pkg{hyperSpec} functions are **deprecated** and not maintained any
#' more. You should not use these.
#' Currently they are present due to back-compatibility reasons and will... |
e15e9ddd5ec6c7fef362f6784ef2bcb9ef743a9ec48bdaca53ff2c495164fe40 | R | 2,598 | 82 | #' @name DEPRECATED-wl.eval
#' @concept deprecated
#'
#' @title (DEPRECATED)
#' Evaluate function on wavelengths of `hyperSpec` object
#'
#' @description
#' These \pkg{hyperSpec} functions are **deprecated** and not maintained any
#' more. You should not use these.
#' Currently they are present due to back-compa... |
789b59c84a18d9c1ca93ec75db54226de55f4d091961322e1baedd7f31db548e | R | 2,603 | 93 | # Greg Booth 2021
# This script creates an ArchR project by combining all arrow files from HEART
# It then filters cells based on the filtered cds objects previously created
# for each sample
basepath = "/net/trapnell/vol1/home/readdf/trapLabDir/hubmap/results/2021_07_15_Greg_ATAC_Code_nobackup/"
dir.create(paste0(b... |
d703402c36b9e4f144f1068c92a7624d20f533dfc33c2d52193b1ff70a2a15f3 | R | 2,614 | 121 | phenotypes <- c(
'Apolipoprotein_A',
'Apolipoprotein_B',
'Calcium',
'Cholesterol',
'HDL_cholesterol',
'IGF_1',
'LDL_direct',
'SHBG',
'Total_bilirubin',
'Triglycerides',
'Urate',
'Mean_corpuscular_volume',
'Platelet_count',
'Mean_platelet_thrombocyte_volume',
'Platelet_crit',
'Standing_he... |
03672fa6cf6dd11a3379ebe3cd85718aa6eb97e54d8fa83298395ad22025552c | R | 2,625 | 58 | library(dplyr)
OriExp <- read.csv("C:\\Users\\qjp\\Desktop\\Manuscript\\RNA\\Ori\\data\\Tissue_Stage_specific\\GeneExpressionAllSamples.fittedValue.csv", header = T, row.names = 1)
OriExp70 <- select(OriExp, contains("70"))
gene <- c("ENSSSCG00000040410","ENSSSCG00000046943","ENSSSCG00000047414","ENSSSCG000000... |
c619e274969fc0c64e6094f18c478e80de1fe72bb0ceaab735bd5f493ee60668 | R | 2,627 | 75 | ### Ref links
# http://tuxette.nathalievilla.org/?p=1696
# https://swcarpentry.github.io/r-novice-inflammation/05-cmdline/
## -----------------------------------------------------------------------------
# get the input passed from the shell script.
args <- commandArgs(TRUE)
# test if there is at least one argument... |
4a03d02e12476919ca4aae00288eb307f0595f24aa8bff74b1e1daea973b7524 | R | 2,628 | 77 | # https://mllg.github.io/batchtools/articles/batchtools.html
library("batchtools")
setwd("./Step6.DEG")
reg <- makeExperimentRegistry("DEGRegistry",
packages = c("MAST", "data.table", "Seurat", "lme4"),
seed = 22112019)
reg <- loadRegistry("DEGRegistry", wr... |
c8baac59847a6d32c598d0036db582eda30d29c73ba08427ee82d98f5a8f6952 | R | 2,634 | 63 | #' @title Performs `pseudovalidation' to select the best \eqn{\lambda} value in lassosum
#'
#' @param bfile A plink bfile stem
#' @param beta The matrix of estimated \eqn{\beta}s
#' @param cor The vector of correlations (\eqn{r})
#' @param sd The standard deviation of the SNPs
#' @param extract SNPs to extract
#' @par... |
ba5084e3857bb3c56a7349f6015c7387db63a2062f528dacbb7e24d35f5fbf43 | R | 2,635 | 60 | ### Ref links
# http://tuxette.nathalievilla.org/?p=1696
# https://swcarpentry.github.io/r-novice-inflammation/05-cmdline/
## -----------------------------------------------------------------------------
# get the input passed from the shell script.
args <- commandArgs(TRUE)
# test if there is at least one argument: ... |
b7dbf0bf24ca23d82734cd52b148373cad1b93dea13b6e7e5910870c353d5df8 | R | 2,638 | 58 | # create meta data csv fie for eNKI sample to conduct age_def_compare #
wd <- "~/projects/chimp_human_opnmf/"
setwd(wd)
# load in libraries needed for script #
# need to install pacman if not already installed
if (!require("pacman")) install.packages("pacman")
pacman::p_load(fs, ggplot2, dplyr, tidyr, readr, tibble)... |
25ef5ce03ffee83b83e9eef4e8173adfdb3b6c67c4497065a976a8892a4e6279 | R | 2,641 | 50 | # Script borowed from E.Walker
# Mouse Array Data: Methylation from normalised beta
suppressMessages(library("dplyr"))
suppressMessages(library("readr"))
suppressMessages(library("stringr"))
# normalised betas
load("/gpfs/mrc0/projects/Research_Project-MRC148213/Mouse_Array_Data/Normalised_Data_Sesame_2.rdat")
#add... |
cc03cc46cf57644a4dbb77ec6ba7eb8e59eb2a74fd78219f882ff0cc10a5bf35 | R | 2,643 | 53 | ####the diversity of variats in each chromosome
setwd("C:/Users/qjp/Desktop/Manuscript/WGS/data")
chr_len <- read.table("pig_karyotype.txt",header=T)
p <- c(paste0('chr',1:19))
for(i in 1:nrow(chr_len)){
len=chr_len$End[i]
s=seq(1,len,100000)
e=seq(100000,len,100000)
chr=rep(chr_len$Chr[i],length(s))
... |
3579092571ed3da4ac7811829daea3328c92d2bd295d64d16db5d9508501eedb | R | 2,645 | 65 | # CHECK_LR_DIFF
# This function tests wether there are statistical differences between the two
# hemispheres or whether there is a significant interaction effect of the hemisphere
# with the direction (of the turn)
# INPUT:
# - data_input: subset of data for a given condition
# - brm_form: formula for the Bayesian anal... |
2175285eb389aa051200c34a3dadf1381d91c02316a57bee93d3b3832e53098d | R | 2,650 | 78 |
# Get functions
library(monocle3)
source("/net/trapnell/vol1/home/readdf/trapLabDir/sharedProjectCode/utility/singleCellUtilFuncs.R")
# modStatus <- loadMonoclePackages()
# library(tidyr)
library(cicero)
library("optparse")
# Get the passed parameters
option_list = list(
make_option(c("-c", "--cdsName"), type="cha... |
5ee7e7dac799ac93cdb46e077cabffbe650930d56dee99267e90ca1d2dd09e14 | R | 2,651 | 96 | # For the specified k, find the correlations between gPLSC, gPCA, gEFA, gCFA,
# and the 10 input cognitive variables.
# Output:
# cogcorr.csv Correlations between cognitive variables.
# cogcorr_round.csv Correlations between cognitive variables, rounded.
#Set libraries.
library(tidyverse)
#Catches arguments.
args <- ... |
a9655abfc4c8a2b50c47f93a558a7f5b030bb2f1e1e984808f39aa087280e375 | R | 2,653 | 110 | library(testthat)
library(sccomp)
test_that("design matrix parameter previews are compact", {
x <- matrix(0, nrow = 2, ncol = 12)
colnames(x) <- paste0("parameter_", seq_len(ncol(x)))
expect_equal(
sccomp:::format_design_matrix_preview(x),
paste0(
"12 parameters: ",
paste0("parameter_", s... |
a75d1cb867bdb13471e45a125e35629e51420e64426b635ece03971b80919567 | R | 2,656 | 83 | #!/usr/bin/R
# -------------------------------------------------------
# Extract a specific set of genes across all DEG results:
# Updated: 05/25/21
# -------------------------------------------------------
# Aggregate number of sign. genes:
library(cbrbase)
set_proj('DEVTRAJ')
source(paste0(bindir, 'multiRegion/load_m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.