sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
08f2a3dd87e5e30db01260da8818f1712520127bc168980766308744ebb13531 | R | 2,060 | 67 | #' @name DEPRECATED-orderwl
#' @concept deprecated
#'
#' @title (DEPRECATED)
#' Sorting the wavelengths of a `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-compatibilit... |
c57a242b48ed6fc2d4a385d278b2c14897a810bed4364489e0542e107d405387 | R | 2,068 | 40 | source('./scripts/01_Setup.R')
SignificantCells <- readRDS("./data/processed/rds/SignificantCells.rds")
SignificantCells= SignificantCells[SignificantCells$data%in% c('PTA', 'PicoPLEX'),]
delimiters = ".bowtie|.bt2"
aa= strsplit(SignificantCells$id, delimiters, perl=T)
aa2= sapply(aa, function(x) x[1])
aa2= standard... |
1d898697e2f70ef92797ba8b0611b8a77cb35fa489634ed537c948c12850ac00 | R | 2,070 | 52 |
#' mochims__predict_fitness
#'
#' Predict fitness from folding and binding energies for 3-state model.
#'
#' @param mochi_outpath path to MoCHI thermo model fit results (required)
#' @param dataset_name dataset name (required)
#' @param folding_energy folding energies for 3-state model (required)
#' @param binding_ene... |
2f978d75c0ae529ea42bb003fc7ebd11114eb3c1bce5318c5acf78ce69658086 | R | 2,073 | 54 |
setwd('../data_raw')
folders = list.dirs(recursive = F, full.names = F)
for(participant in folders){
setwd(participant)
files=dir(pattern='.csv')
# Read the data of one subject
data = read.csv(files[1])
# Find the scanning onset, offset and moment of each volume (be careful - slice time correction ... |
3802f2b43dc28742109e604dd92e7ef43ec139a916bb9877fd8a4d5d71f38358 | R | 2,073 | 104 | ---
title: "Phenotype distribution"
format: html
editor: visual
---
This notebook contains plots with the distribution of continuous variables in our project.
```{r setup, echo = FALSE, message=FALSE, warning=FALSE, include=FALSE}
library(dplyr)
# Load data
base::load(snakemake@input[[1]])
# Unlist for ease of life... |
a87030791c84d1e87050f9f1ce5e65861a9a1b45ba81d6a6f28e85dcd7e1f593 | R | 2,073 | 51 | # Variable, global to package's namespace.
# This function is not exported to user space and does not need to be documented.
opt= settings::options_manager(
thresh= 3,
speed_method= "z",
extend_by= 3,
island_size= 4,
extend_blink= 3,
overall_thresh= 0.4,
consecutive_thresh= NULL,
disable_smoothing= F... |
bb6dc6e23ec5e2227a01cf362a70314e4c549df1fc0449a75b34fc4324050687 | R | 2,074 | 66 | #### Markos et al 2024
#### Script used for analysis of 10X matrices
#### Crest markers
# load prerequisities
library(Seurat)
library(patchwork)
library(ggplot2)
# load output of AmphiN5stage.R
AmphiN5stage <- readRDS("../timepoints_rds/Amp_N5.RDS")
AmphiN5stage@active.ident <-
factor(
AmphiN5stage@active.iden... |
eae01f419c1e7309082f37abb05246786f678e8b397a62d0e567014f961bc1a8 | R | 2,084 | 55 | # Adapted from Matlab code:
# https://data.mrc.ox.ac.uk/data-set/simulated-eeg-data-generator
# function signal = noise (frames, epochs, srate)
#
# % function signal = noise (frames, epochs, srate)
# %
# % Function generates noise with the power spectrum of human EEG
# % Inputs:
# % frames - number of signal frame... |
5ad438c5a1be11657d9f20151d37d401920a77cf11648d96f3f03a596b0abb10 | R | 2,085 | 48 | #' Gene summary plot of neuroimaGene object
#'
#' Generates an overview plot of the neuroimaGene object according to each gene input.
#' @param ng_obj NeuroimaGene Object
#' @param maxGns maximum number of genes to visualize. default=15
#' @param title optional title tag for the plot
#' @param verbose print runtime mes... |
a38b0ed77210441b0572cef68ac41608535032065141753210dbbf080864a191 | R | 2,091 | 49 | #' Create a simple plot of a phylogenetic tree and tag monophyletic groups
#'
#' This function creates a simple plot of a phylogenetic tree and tags the monophyletic groups on the plot.
#' It is a wrapper function that combines the functionality of two other functions:
#' `create_simple_plot_boostrap_lab_fun()` and `... |
25d09961d2eb41cf6d67f1c0f02be543d0da91737baa6606c4fb4330539556a1 | R | 2,092 | 63 | #----01_setup-------------------------------------------------------------------
#-------------------------------------------------------------------------------
# This is the setup file for the connectivity analysis for
# Reinhard and Fukuda et al. 2024
# Here all necessary libraries are loaded and all used funct... |
9cdef3af35472fd5a87720f98f845a2d5019a6808b26fd44b8e30f4b43a83ec8 | R | 2,094 | 72 | # load libraries
library(tidyverse)
library(data.table)
library(Seurat)
library(singleCellNet)
library(WGCNA)
set.seed(1234)
args = commandArgs(trailingOnly = TRUE)
ref_path = args[1]
lab_path = args[2]
out_path = args[3]
threads = as.numeric(args[4])
nTrees = as.numeric(args[5])
#--------------- Data --------------... |
e467b38d7ba429217d17f6568d1a1f8c115fa2af0055fa2c80f51a6088ac1c73 | R | 2,095 | 55 | #################################
#
# This function used to illustrate
# the correlation matrix
#
ShowCorMat <- function(result_mat, lower = -1, upper = 1, title_text = "Correlation Matrix"){
library(ggeasy)
# define the color palette
jet.colors <- colorRampPalette(c("#00007F", "blue", "#007FFF", "cyan... |
722361f6e7383e1a01e3cb90658c7741788dce3a48faa468343068373cbfcff2 | R | 2,098 | 69 | #' @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... |
4e6c45d851538d0648a87ff84ec1f77047fde556733d02011f8c48fac51b1960 | R | 2,100 | 59 | #==================================================
# Figure S1: Heatmap of NPE correlations
#==================================================
library(data.table)
library(magrittr)
library(psych)
library(pheatmap)
library(polycor)
pheno <- fread("shared/nacc_rosmap_act_np.pheno", na.strings = "-1")
covar <- fread("... |
27ffbe52bea4f240b5af2f716a24f78935f3b679443fb08361307d96be2eb277 | R | 2,102 | 73 | setwd('C:/Users/au571303/Documents/projects/memory_music_iEEG')
library(MASS)
library(lme4)
library(effects)
library(ggplot2)
library(viridis)
library(RColorBrewer)
library(ez)
library(ordinal)
files <- list.files('logs', pattern = 'pilot')
# load all pilot files:
d <- data.frame()
for (f in files){
cdata <- read... |
1e17b3703fe785f21144b16793eef316bb6b376c8065c9f28608b7ba77a7205c | R | 2,103 | 50 | #=======================================================
# create data set with 4 CpG, SNP, CAA, and covariates
#=======================================================
library(data.table)
library(readxl)
library(ordinal)
load("data/cpg.RData")
covar <- setDT(read_xlsx("/data_global/ROSMAP/greg_20200109/dataset_843_b... |
8fefd6a4ed0eeda1dce61fabf55229b342f32b4f5b7b0d915d7fd4dab274b37f | R | 2,107 | 62 | args <- commandArgs(trailingOnly = TRUE)
fasta_file <- args[1]
output_dir <- args[2]
log_file <- args[3]
log_con <- file(log_file, open = "wt")
sink(log_con, type = "output")
sink(log_con, type = "message")
library(Biostrings)
library(dplyr)
library(ggplot2)
tryCatch({
# Read the fasta file
reads <- readAAString... |
aa6d0be5607b797a13ac0a954b9588d2b06aa3917cc82e6efe781f80542e8560 | R | 2,109 | 65 | #!/usr/bin/env Rscript
# This script is used to extract segments from NVI consensus files insaflu
# from cath naming
# renaming segt_isolate.fasta
require(optparse)
library(tidyverse)
library(seqinr)
option_list = list(
make_option("--sample", action = "store",
type = 'character',
h... |
38648bdbd2107f1bd145f0684cd3e8921769c10002dd3f407d25204652e165ff | R | 2,113 | 60 | #' @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... |
041704ed5baff525ad68db86e6e0f509abd4ee757d8f1f53618afc5bf7b9a046 | R | 2,116 | 49 | #=============================================================================
# Compare gene expression of COL4A1 and PIK3R5 with atherosclerosis and Braak
#=============================================================================
library(data.table)
library(ordinal)
library(readxl)
library(ggplot2)
rnaseq <- fre... |
b0a831b5056e6dddf4d62d9520fd03f1c77d94c77c5d4f9f1d5b1617f28cd8b2 | R | 2,120 | 88 | penalizations <- c(0.05, 0.1, 0.2, 0.3, 0.4)
library(scregclust)
library(progressr)
library(doFuture)
plan(multisession)
# Will be the dataset "wang" or "pbmc"
dataset <- commandArgs(trailingOnly = TRUE)[1]
output_path <- file.path("output", sprintf("%s-scregclust", dataset))
if (!dir.exists(output_path)) {
dir.c... |
2c4074d8ae49a46b09c4e67ac46166889d6c2a7287cbd86c64b6c3e349482be4 | R | 2,122 | 62 | #' Elevated CO_2 and total biomass of woody plants
#'
#' @description
#' Meta-analysis on effects of elevated CO_2 on total biomass of woody
#' plants
#'
#' This dataset has been used as an example in Hedges et al. (1999) to
#' describe methods for the meta-analysis of response ratios. The
#' complete dataset with 10... |
1d2fb16c1504dd52424357595ef8488e0ee686d7650bfc4e16643a1e144e2c2f | R | 2,123 | 78 | #Function borrowed from reticulate (accessed 09.12.2024, partly updated with 02.09.2026):
#https://github.com/rstudio/reticulate/blob/main/R/miniconda.R
#This is used to specify a version of miniconda instead of installing the latest to ensure compatibility with the VertexWiseR requirements
miniconda_installer_py310ur... |
984fda953e44f1677502d0ca448feda35135a84dfcb2ad4cca1fda6f04a5e7bd | R | 2,126 | 48 | library(Seurat)
load("Supp1_CellLine_R1/WT3CL_YWsubset_intObj_20230418.Robj")
### obtain AEI through RNAEditingIndexer
input_dir <- "/media/Scratch_SSD_Voyager/sammi/RNA_editing/AEI_CL_v1/output_index_20230420/"
aei_table <- list()
celltype_order <- c("Neural-Progenitors","Neurons","Retinal-Epi","SCP","Gut-Epi","HSC... |
28354fb00b2ee6baacbb8b8434e597dfe4ffd90847fd49f5172efd239787bc0b | R | 2,127 | 69 | library(chromVAR)
library(motifmatchr)
library(Matrix)
library(SummarizedExperiment)
library(BiocParallel)
library(JASPAR2020)
library(readr)
library(stats)
library(BSgenome.Hsapiens.UCSC.hg38)
library(TFBSTools)
library(Signac)
library(Seurat)
# Running Human chromVAR (Get Peak Motif Colocation Information)
input_dir... |
4958ac252b6ced715a54fe6fa98bd1338f0b72a6cef78e75b8fa2aedf34b45a1 | R | 2,133 | 67 | ---
title: "Here and File Architecture Setup"
author: "Katie Emberley, Jonathan Nelson, and Annie Lackey"
date: "`r format(Sys.time(), '%d %B %Y')`"
output:
html_document:
toc: yes
toc_depth: 3
toc_float: true
number_sections: yes
theme: bootstrap
df_print: paged
code_folding: hide
hi... |
877d0bad812c8bc0e7cedaf67be1f9470d67c72198e4570158ac9ab50442ffcd | R | 2,135 | 65 | library(DESeq2)
setwd("~/Library/Mobile Documents/com~apple~CloudDocs/Documents/Projects/GF_Mouse_Human_v_Primate/GF_Mouse_Human/First_experiment/Final_analysis")
#read in raw count data and metadata with columns of first matching rows of second
countdata<-read.csv("Liver_gene_expression_rawcounts.csv", row.names = "... |
2ba4574e858d376ddeb7bd347db5bb5dce60f1529a4996dbcdcb5d331cce1ad8 | R | 2,136 | 36 | #!/usr/bin/env Rscript
args <- commandArgs(trailingOnly=TRUE)
if (length(args) < 1) {
cat("\nqualSummaryStats.R <list of files with quality values (one file per row)> <outfile name> [column numbers to analyze]\n\n")
options(show.error.messages=FALSE)
stop()
}
flist <- as.character(read.table(a... |
7ebf11536f00a4a486c272af9de74788677751f08b0aed02ff19d627526138ce | R | 2,140 | 54 | context("Input detection")
# Positive definite matrix
x.spd <- matrix(c(1,.5,.5,1), ncol = 2)
x.s <- matrix(c(-1,.5,.5,-1), ncol = 2)
x.spdl <- lapply(1:5, function(i) x.spd)
x.sl <- x.spdl; x.sl[[1]] <- x.s
x.ns <- matrix(c(1,.5,.75,1), ncol = 2)
x.nsl <- x.spdl; x.nsl[[1]] <- x.ns
x.npdl <- x.spdl; x.npdl[... |
ea53ceebc0d0fb2fba33b75fd3acbb813cd87ab3ea81bd055df0da1453a44787 | R | 2,145 | 64 | #' Smoking example
#'
#' @description
#' Meta-analyses on the effect of smoking on mortality risk.
#'
#' @details
#' Data have been reconstructed based on the famous Smoking and Health
#' Report to the Surgeon General (Bayne-Jones S et al., 1964). Data
#' sets can be used to evaluate the risk of smoking on overall
#'... |
f098f3c6077cf7df026c3a156120352682ab1caff169910b5a1afdcd5381b601 | R | 2,145 | 62 | #' Conduct dictionary-based sentiment analysis.
#'
#' @description Tokenizes character vectors, counts words, and then takes weighted average to estimate sentiment.
#' @usage sentiment(x,tokens,scores)
#' @param x length n character vector. If you're input dictionary is lower case only, then be sure to preprocess input... |
8f33267e83199c562be62376c2fd2830ad55678ecd19cdfb56c43a1ee051cc86 | R | 2,156 | 64 |
## Compute the overlaps between two *numeric* lists:
numericListOverlap<- function(sample1, sample2, stepsize, method="hyper", tol = 0.5, offset = 1){
n<- length(sample1)
overlap_hyper <- function(a,b) {
count<-as.integer(sum(as.numeric(sample1[1:a] %in% sample2[1:b])))
signs<- 1L
log.pval<- -ph... |
93f66b35f2e40041ef1abff7f764da0caad330a75cd2e3ca2c6df769f5e44ecd | R | 2,163 | 60 | # File: compute_MCMC_CI.R
# Author: Kelly Chang
# Date: Oct 2017
# Version: 1.0
#
# Description: R script to compute credible intervals from MCMC results.
# For help, run this script with command line option "-h".
#
#--- specify command line arguments
library(optparse)
parser... |
bed16397c2cb13d1fbe414f07c291ab1ab79a40cf90558eddf468971a36678ae | R | 2,164 | 65 | #' @name DEPRECATED-read.asc.Andor
#' @concept moved to hySpc.read.txt
#'
#' @title (DEPRECATED)
#' Import Raman spectra/maps from Andor cameras/solis ASCII files
#'
#' @description
#' These data input functions are **deprecated** and they will be removed in
#' the next release of \pkg{hyperspec} package.
#' Now... |
08f4a54bd67106d92574a39deab3dd69834bafbbf7aedbeed68aff10f03e3127 | R | 2,166 | 65 | # Get command line arguments
args = commandArgs(trailingOnly=TRUE)
outfmt=args[1]
sample_name=args[2]
fmt=args[3]
outdir=args[4]
# Load required packages
library(tidyverse)
# Required functions
log_message <- function(message) {
cat(sprintf("[%s %s\n]", Sys.time(), message))
}
save_plot <- function(plot, filename)... |
19e68b519df11bfc26b92912b0434247f20b5ac242820f7fc870ca370b1c9ff6 | R | 2,168 | 70 | # This script further specifically does the GC for the schizophrenia associated genes using FPP30 cell type models.
# load library
library(data.table)
library(foreach)
library(doParallel)
library(tidyverse)
library(broom)
# read in the GReX files
fpp11 <- fread("/data/g_***/FPP11_eur.csv", h=T)
fpp30 <- fread("/data/... |
5455ffecf32081bdf1fca1f9af59349f1da44afa13bed8247db55780080cfed8 | R | 2,168 | 82 | #' Trim rPCA loadings according to heuristics and append them to the original object
#'
#' Under development. This function takes a 'reduce_rPCA' object,
#' and only a 'reduce_rPCA' object, and trims the original loadings.
#' The trimmed loadings can then be used for (new) predictions
#' with 'predict_feature()', for e... |
dd0d02a8edb335fe03e40df7b00c3b8e3800972b06e5e18b3a9a9cbd05551145 | R | 2,169 | 82 |
# Function -------------------------------------------------------------------
.split <- function(x, f, drop = TRUE) {
validObject(x)
hyperlist <- split(seq(x, index = TRUE), f, drop)
for (i in seq_along(hyperlist)) {
hyperlist[[i]] <- x[hyperlist[[i]], ]
}
hyperlist
}
#' Split a `hyperSpec` object ... |
e32b12a7cb65f47cbf28509a62295a0d408299e7ad86626efaec68d6612d4fbe | R | 2,174 | 62 | library(data.table)
library(Biostrings)
library(rhdf5)
library(reshape2)
source("coefplot.r")
h5dir = args[1]
testIDs = h5read(paste(h5dir, "test.h5", sep='/'),"geneName")
trainIDs = h5read(paste(h5dir, "train.h5", sep='/'),"geneName")
valIDs = h5read(paste(h5dir, "valid.h5", sep='/'),"geneName")
file1 = "Roadmap_Fant... |
28cc8a9ffa3d1b6cc7d979011f856148ef90644c90e597db340cc8cb5c91c336 | R | 2,180 | 86 | #' @name deprecated
#' @concept deprecated
#'
#' @title Deprecated and defunct functions
#'
#' @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 be
#' removed in the next r... |
833946fb0ce940b9a813b72c89efa2a7a24c0d160b260f5fbe2a7bfe4299a77a | R | 2,181 | 50 | library(latticeExtra)
getresults = function(thisfile){
sites = read.table(text = system(paste("python print_losses.py", thisfile), intern=T), sep='\t')
colnames(sites)=c("leftpos","rightpos","loss","params")
print(sites[which(sites$loss == min(sites$loss)),])
say(nrow(sites), "trials")
sites... |
78deadad8c4cb78907383ce3442de18c15b29236bff7c95b666ff48d1e2fc203 | R | 2,183 | 60 | #===============================================
# Create list of duplicates to remove
#===============================================
library(pacman)
p_load(data.table, magrittr, stringi)
cargs <- commandArgs(trailingOnly = TRUE)
prefix <- "act"
np_ids <- fread("data/act_np_ids.txt", header = FALSE)
miss <- fread(pa... |
5796fc3625098209ea605f11e9ac9b4d78550a349bfd709be033eb8a2f5d4ddd | R | 2,191 | 43 | test_that("cidprop transforms thresholds for supported summary measures", {
dat.prop <- data.frame(event = c(2, 5, 8, 12, 18),
n = c(30, 40, 35, 50, 45))
dat.rate <- data.frame(event = c(2, 5, 8, 12, 18),
time = c(30, 40, 35, 50, 45))
dat.mean <- data.frame(n = c(... |
f2f093c105e5090d670df0acf137d74a6359d79fb00f77cccf1c24432e32fbbc | R | 2,202 | 38 | ###Cell type classification with sctype
#2022-06-06
#Jessy Slota
# load libraries and functions
lapply(c("dplyr","Seurat","HGNChelper"), library, character.only = T)
source("https://raw.githubusercontent.com/IanevskiAleksandr/sc-type/master/R/gene_sets_prepare.R"); source("https://raw.githubusercontent.com/Ianev... |
03a2bf36bae0ca37cfc5b8bb50aa1201fc46de166479b0d8bd4c2dd3f9fbeb38 | R | 2,209 | 73 | # loading libraries
library(Seurat) # v5.0.3
library(SeuratWrappers)
library(patchwork)
library(dplyr)
library(ggplot2)
library(sctransform)
library(glmGamPoi)
# Loading data
Ctrl1.data <- Read10X_h5("~/Downloads/scRNA/Ctrl1_filtered_feature_bc_matrix.h5")
Ctrl2.data <- Read10X_h5("~/Downloads/scRNA/Ctrl2_filtered_... |
c699a17c9f7a4872a635fd15edfcfe2c1d198cb487c5ebea5fc0ad2941d39ac3 | R | 2,215 | 70 | # Get the command line arguments
args = commandArgs(trailingOnly=TRUE)
annotation=args[1]
cog=args[2]
sample_name=args[3]
fmt=args[4]
outdir=args[5]
# Load necessary libraries
library(tidyverse)
library(ggthemes)
library(svglite)
# Required functions
log_message <- function(message) {
cat(sprintf("[%s %s\n]", Sys.t... |
d289895e1090e1436ef90704f4cfa044c727a28cb5f91126246bdd43c29844ed | R | 2,217 | 61 | suppressPackageStartupMessages({
library(readxl)
library(tidyverse)
library(openxlsx)
library(tximport)
library(DESeq2)
library(pheatmap)
library(biomaRt)
})
if (!file.exists("biomart.rds")){
mart <- useMart("ENSEMBL_MART_ENSEMBL")
mart <- useDataset("mmusculus_gene_ensembl", mart)
atr... |
e0aef124f661ac67e8f3bdddfec19e7b1d3ba1e792f7d3d5cf01d00cbac3434a | R | 2,237 | 63 | # File: generate_bootstrap_samples.R
# Author: Kelly Chang
# Date: Oct 2017
# Version: 1.0
#
# Description: R script to generate bootstrap samples from hERG channel
# fractional block data for 12 CiPA training drugs.
# New drugs can be specified by running this s... |
db4dc0b950c79f56a4f0048cf7bd7a125f5c181a23c998e4cdff636bb5ee7599 | R | 2,243 | 81 | # Function -------------------------------------------------------------------
.quantile <- function(x, probs = seq(0, 1, 0.5), na.rm = TRUE, names = "num", ...) {
x <- apply(x, 2, quantile,
probs = probs, na.rm = na.rm, names = FALSE, ...,
long = list(probs = probs, na.rm = na.rm, names = names, ...)
)
... |
1413de3e1f7aedc73286b9c925d08855f988c8911f733db9c15baa42a23749ea | R | 2,246 | 64 | ---
title: "heatmap"
author: "Gokberk Alagoz, L&G Dept., MPI for Psycholinguistics"
date: "`r Sys.Date()`"
output: rmarkdown::github_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(dplyr)
library(tidyr)
library(ggplot2)
library(ComplexHeatmap)
library(circlize)
```
```{r readAndPre... |
fa2dcf6ee56440d48c1945e2c5dd297b4f6a75b9a06184481514f0dc4767d135 | R | 2,247 | 59 | args <- commandArgs(trailingOnly = T)
filenamex=as.character(args[[1]])
options(scipen=999)
set.seed(1)
for (t in 1:length(namex)){
filenamex= namex[t]
outpath= file.path("./data/processed")
source('./scripts/01_Setup.R')
setwd(file.path(outpath, filenamex))
aa= read.table('analysis', header = T)[,1]
d... |
74718d7d37068fb09ee97a72a1d95dd664b92171918116d45e3e851ecd292cb5 | R | 2,248 | 71 | #commonTheme
commonTheme= ggplot2::theme(
text= ggplot2::element_text(size= 14, face= "bold"),
axis.text= ggplot2::element_text(size= 14, face= "bold", color= "black"))
#' Plots two time series against each other
#'
#' The function plots two time series against each other.
#' The intended use is generally to chec... |
4a9867cab6c79390a9ee87209f2f1eb056070b292b7e4a353313eabe44165e87 | R | 2,251 | 48 | #' Compute the mean of a set of spd matrices
#'
#' Function computes the mean of a set of symmetric positive-definite matrices.
#' Several methods are implemented, as described in \code{Details}.
#'
#' @param x A list of symmetric, positive-definite matrices
#' @param method The type of mean to compute. See details
#' ... |
d50c058c39d591c14be9d5ff2262652ae440bcc612d584438e505baa2dcd3f9b | R | 2,255 | 107 |
library(nlme)
library(car)
library(mosaic)
setwd("~/Library/Mobile Documents/com~apple~CloudDocs/Documents/Projects/GF_Mouse_Human_v_Primate/GF_Mouse_Human/First_experiment/Final_analysis")
data<-read.csv("Phys_combined_corrected_adults.csv")
percent_weight<-lm(percent_weight_gain~Species, data=data)
summary(aov(pe... |
138698e8db52580e52c66a1ec911975f0dfd429659bf2fe596542fe84bdee455 | R | 2,259 | 76 | #' Create study labels in JAMA layout (deprecated function)
#'
#' @description
#' Deprecated function to create study labels in JAMA layout (for
#' forest plot). Replaced by \code{\link{labels.meta}}.
#'
#' @details
#' This auxiliary function can be used to create study labels in JAMA
#' layout which can be added to ... |
17b583f46a64275b858beb79506d54b1a1bef87238a01eaae6eb058ffe2ae635 | R | 2,260 | 72 | # File: combine_results.R
# Author: Kelly Chang
# Date: Oct 2017
# Version: 1.0
#
# Description: R script to aggregate action potential (AP) simulation
# results.
# For help, run this script with command line option "-h".
#
#--- specify command line arguments
li... |
cc3e6e42aefeb0ac9ff66242fce1a28e105778aafb80a2bd1f4e88c8a1965bbc | R | 2,263 | 50 | ---
title: "LDSC"
author: "Jack Humphrey"
date: "27/01/2023"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(tidyverse)
```
```{r}
farrell <- read_tsv(here::here("data/Farrell_PSP.cell_type_results.txt") ) %>% mutate(disease = "PSP - this study")
nalls <- read_tsv(her... |
f7c4732198c74412a5231b0a0bbafdf1dd0d0384a65e56088decc7e3d22b04f2 | R | 2,264 | 61 | test_that("metareg robust methods work without cluster", {
skip_if_not_installed("metadat")
data(dat.konstantopoulos2011, package = "metadat")
dat <- dat.konstantopoulos2011
dat$group <-
factor(ifelse(dat$district <= median(dat$district), "A", "B"))
ma <- metagen(yi, sqrt(vi), studlab = study,
... |
fab504cdbcf7628e17ac66b598d8459b6edb7bc6f860041b22ee132e34858c7b | R | 2,265 | 41 |
#!/zs32/home/frwang/software/R-3.4.0/bin/Rscript
library(qvalue)
library(preprocessCore)
library(peer)
#Read command line arguments
args <- commandArgs(trailingOnly = TRUE)
try(if(length(args) != 3) stop("Incorrect number of arguments, usage> Rscript RNA_processing.R INPUT PEER_factor OUTPUT"))
opt_input = args[1];
o... |
340c847d39914c200de2b1cf2122381318aede17f27b32112520a280249935a3 | R | 2,268 | 64 | wd = "C:\\" ## Change filepath of working directory
setwd(wd)
#### Install package metafor
library(metafor)
### Observational Practice vs. Rest
# Load Dataset
data = read.csv("direct_effects_obs_rest.csv")
# Compute effect sizes for clockwise perturbation studies
es1 <- escalc(measure="SMD", m1i=m_olcs,... |
1a8d7c14493348d32c88ba4af241f8cb13162b3912cf96ed17eeed729dcc56f5 | R | 2,270 | 60 | args <- commandArgs(trailingOnly = T)
filenamex=as.character(args[[1]])
options(scipen=999)
set.seed(1)
for (t in 1:length(namex)){
filenamex= namex[t]
outpath= file.path("./data/processed")
source('./scripts/01_Setup.R')
setwd(file.path(outpath, filenamex))
aa= read.table('analysis', header = T)[,1]
d... |
52e97b3ca1b326f9146e8e206e695cad89ecfacbb41a72631b3383a7fe1ef9ff | R | 2,278 | 58 | #setwd("D:/0AALRJ/scRNA-seq/VAE/scDisco/experiences/simulate")
rm(list=ls())
library(SeuratDisk)
library(Seurat)
library(stringr)
library(aricode)
library(rhdf5)
library(Matrix)
# ### 2. Running Complete data by seurat -------------------------------------------------
data_dir = '../../datasets/human_lung/'
... |
e61262a4f7df00f26d06f1d01fdcbcd6db71a733201a1922740549e5eab45f91 | R | 2,279 | 77 | ###########################
#
# This function is used to conducted
# permutation test for group difference
# time delay estimation between HC
# and subtype, or between two subtypes.
#
# R packages coin and tidyverse are essential
# for this function.
#
# Liang Qunjun
TtestBrain <- function(data, subtype1, subtype2... |
fdfc71465ed23fd43dff551dda9fa5d12edb10de732a5f16ec72d80cbae722b6 | R | 2,283 | 55 | #' Covariance estimation
#'
#' Function implements several forms of covariance estimation.
#'
#' @param x A data matrix, where rows are observations and columns are variables
#' @param method Method of covariance estimation. See details
#' @param ... Additional arguments passed to estimation functions. See details.
#'... |
1e64376f003d69dd2a7503f01950ae5e53179f37e3977d4f586783631073c359 | R | 2,294 | 80 | #' Cisapride in Non-Ulcer Dispepsia
#'
#' @description
#' Meta-analysis on cisapride in non-ulcer dispepsia.
#'
#' This meta-analysis is used as a data example in Hartung and Knapp
#' (2001).
#'
#' @name cisapride
#'
#' @docType data
#'
#' @format A data frame with the following columns:
#' \tabular{rl}{
#' \bold{... |
c3fefc8381ee96d440d30a42734f243cc8915aa0f2e98fb895f7633f384af1c2 | R | 2,296 | 52 | #' Creates a dataframe from the file containing a list of duplicates
#'
#' `create_duplicates_df` reads a file containing a list of duplicates, as produced by seqkit,
#' and creates a dataframe with information about the duplicates. The file should be in
#' tab-separated values (TSV) format with two columns: "ndub" and... |
99bcd299214bda0a993cda60e86504283d047ace66ffb6643f67f9bf8d3cdbf1 | R | 2,300 | 87 | library(Seurat)
library(scregclust)
library(data.table)
path <- "data/Wang2019"
if (!dir.exists(path)) {
zip_file <- "data/Data_Wang2019_Brain.zip"
if (!file.exists(zip_file)) {
# Download link for data from Wang et al. (2019)
# from https://www.weizmann.ac.il/sites/3CA/brain
url <- paste0(
"http... |
7f7f851f23f791a3ee1ebb2f79bb1dbd6874c5fc15a47f0fbc4eb21a370f8794 | R | 2,305 | 63 | ##### Supplementary Figure 2-a #####
# Transcriptional changes of six GT28 genes in male accessory glands (MAG)
# at 0, 1, and 2 days after eclosion
#
# MAG bulk RNA sequencing data is deposited in NCBI SRA (PRJNA1140569).
# RNA-seq row data was process using kallisto to generate 'MAG_day0-3.txt' file.
# fbgn_fbtr_fbp... |
f6582b455395e2eb3518f1fdac5a0a6f1ddb5ac3957100a9f1ff4876bbc7a441 | R | 2,310 | 51 | #' data wrangling for phylogenetic annotations with ggtree::geom_facet
#'
#' @description
#' Returns a dataframe for phylogenetic annotations with ggtree::geom_facet
#' with options geom_text and geom_tile, for a categorical variable that is stored in a
#' nested contingency table.
#'
#' @details
#' `get_ctg_dat... |
12f30928c506fb4bc8e27e4675507d372920a713568a9610f9c82b6d4d96bf7f | R | 2,311 | 91 | ---
title: "Wilcox BoxPlots"
author: "Abdullah Khan"
date: "2025-04-01"
output: html_document
editor_options:
chunk_output_type: console
---
```{r}
library(openxlsx)
library(ggplot2)
library(ggpubr)
library(tidyr)
library(dplyr)
library(ggsignif)
path <- "/bgfs/ialdiri/Boxplots/"
```
### Load in excel sheets
```{... |
aa7bd4194186be8b9edc1f7c744dd11ede0c17a31fc343c72096566bda3dbd02 | R | 2,318 | 57 | #' contingency_df_variable_fun
#' Contingency DataFrame Variable Function
#'
#' This function takes a data frame, a list of variables, and an optional grouping variable, and returns a contingency data frame.
#' The contingency data frame summarizes the values of the variables for each group.
#' For each variable, it al... |
a7546b39d5a2c529efacbc016d174d30685d908f8b461de7178c65d52a8dcb2a | R | 2,319 | 90 | AnalyseExperimentShort<-function(dr, dataname, resdr, cropLim, knn){
# performs a simpler analysis than AnalyseExperiment
library(scatterplot3d)
library(spatstat)
library(spptest)
library(ggplot2)
source('Thomas3d.R')
nn = knn
nrsim<-49
delta<-10000 # size of analyzed images patches
pb<-read... |
3f1f010bf7a21ce87175eb01366cc2d0cfe30fa39ab400200e1ceda146295f37 | R | 2,325 | 35 | load("/media/Scratch_SSD_Voyager/sammi/RNA_editing/Figure3_ADARKO_R1/KO_4ter_project_SO_annot_collapsed_ADARB1-1rm_20230207.rda")
Idents(KO_sub) <- KO_sub$guide
comps <- data.frame(compA = c("ADAR1","ADARB1","ADARB2"), compB = rep("AAVS1", 3))
JNKgenes <- c("TRAF3","TRAF4","GADD45A","GADD45B","CCN2","GADD45G","TNFRSF1... |
2272c366140e11fe7439dd1b692bcf579ec157a231c0c0ad148dc16b25198e90 | R | 2,327 | 76 |
#' mochims_structure_metrics
#'
#' Add 3D structure metrics.
#'
#' @param input_file path to MoCHI thermo model fit results (required)
#' @param outpath output path for plots and saved objects (required)
#' @param pdb_file path to PDB file (required)
#' @param execute whether or not to execute the analysis (default: T... |
a72086309e378c6435e8200a73c3bd73238c4cd8aaea6424ff984c9761c99b76 | R | 2,332 | 68 | ### R-4.3.1
# library
library(edgeR)
library(RColorBrewer)
library(pheatmap)
colors = brewer.pal(8, "Set2")
### HCC data
data = read.table('../data/pivot_160_FRepr.txt', sep = '\t', header = T)
rownames(data) = data$Gene
data = data[-c(1:13)]
group = factor(ifelse(grepl('T', colnames(data)), 'Tumor', 'N... |
54668f2f238519c0ca02d82e1509375e8000d409a719ff0bfd5f58481d6a6c8d | R | 2,335 | 50 | #libraries
library(xlsx)
library(car)
library(lmPerm)
library(dplyr)
#set the paths
pvt_path = '/m/cs/scratch/networks-pm/effects_externalfactors_on_functionalconnectivity/data/cognitive/sub-01_day-all_device-presentation_test-pvt.csv'
nback_path = '/m/cs/scratch/networks-pm/effects_externalfactors_on_functionalconnec... |
9bc165e3ee6073bf938256947ad561ebab7a2bbde737af25398cb7ed88c1d65f | R | 2,344 | 71 | library(data.table)
library(ggplot2)
library(ordinal)
dt <- fread("data/rosmap_data.csv")
dt[, caa_4gp := ordered(caa_4gp)]
dt[, apoe := factor(apoe, levels = c("apoe33", "apoe22", "apoe23", "apoe34", "apoe44"))]
apoc2_plot = dt[!is.na(rs7247551_G) & !is.na(APOC2),
ggplot(.SD, aes(factor(rs7247551_G)... |
03216b0a9ac9bf132c134e2a528f3e5b4364b4764616928d9f077d85fb6864d3 | R | 2,345 | 72 | library(ArchR)
library(BSgenome.Hsapiens.UCSC.hg38)
library(TFBSTools)
library(JASPAR2020)
addArchRThreads(threads = 8)
addArchRGenome("hg38")
# Load Data
adata = loadArchRProject('HumanBrain')
# Add JASPAR2020 motifs
PWM <- getMatrixSet(
x = JASPAR2020,
opts = list(collection = "CORE", tax_group = 'vertebrate... |
ecfd3b58eeeedac91a7a2ee0673b8dbc0be587df7bb110c63d3ee847518c24b7 | R | 2,351 | 75 | # load libraries and arguments
library(tibble)
library(data.table)
library(Seurat)
library(WGCNA)
set.seed(1234)
#---------- Parameters -------------------
args = commandArgs(trailingOnly = TRUE)
ref_path = args[1]
lab_path = args[2]
out_path = args[3]
threads = as.numeric(args[4])
nPC_computed = as.numeric(args[5])... |
070b8e0653b1f0d59b1f36201db5c7a8800d28ff6388705123e6eb697e2ccdd6 | R | 2,353 | 68 | ##-------------------------
## ordinal regression
##-------------------------
library(pacman)
p_load(data.table, magrittr, MASS, brant)
#.raw file from regression.sh output with variant minor allele
#values for each participant
raw <- fread("02_analysis/ordinal/top.snps.raw")
# file with other variables for each ... |
2b748182ce3695f1baadfe4dcecd20939021bd1caefbe20ef288564df0412a87 | R | 2,356 | 66 | #' List NIDPs
#'
#' Supplies a list of all NIDPs by name for any given modality or atlas
#' @param modality Neuroimaging modality. Defaults to NA; see README for additional options
#' @param atlas Neuroimaging parcellation atlas for NIDP query. Defaults to NA;
#' see README for additional options
#' @param filename op... |
8271197723782cdf728585e43dfb5f594d441edd1e807faad023883b3bc62565 | R | 2,361 | 49 |
###Script 4
#Sctype to identify cell types
# load libraries and functions
lapply(c("dplyr","Seurat","HGNChelper"), library, character.only = T)
source("https://raw.githubusercontent.com/IanevskiAleksandr/sc-type/master/R/gene_sets_prepare.R"); source("https://raw.githubusercontent.com/IanevskiAleksandr/sc-type/... |
ee8fbdbfe7a92dd406cd73b54d90c9c02dcda921278067ebd4b986bfdb008c21 | R | 2,364 | 68 | ---
title: "PSP GWAS genes in PSP brain"
author: "Jack Humphrey"
date: "06/03/2023"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(tidyverse)
library(patchwork)
```
Cortex and Cerebellum RNA-seq from PSP cases and controls.
```{r fig.width = 10, fig.height = 10}
ctx ... |
e55d2da67e07acec41e5a26cfbe67fcba73acda409b2f86ecc1ec99f8d1b7a5b | R | 2,376 | 95 | #' Cochrane review: summary of meta-analyses
#'
#' @description
#' Calculate and print a summary of all meta-analyses in a
#' Cochrane review.
#'
#' @param x An object of class \code{rm5}.
#' @param comp.no Comparison number.
#' @param outcome.no Outcome number.
#' @param ... Additional arguments (passed on to \code{... |
518a8b3a3ae16e31f0a855b4b99f2a1305554b09f029723fbdcb42a40e0d0c1a | R | 2,378 | 70 | library(data.table)
library(synapser)
library(magrittr)
library(stringi)
# array metadata: syn23569440
# login to synapse
synapser::synLogin()
# RNA expression metadata file
rnaseq_meta <- fread(synGet("syn21088596")$path)
rnaseq_meta <- rnaseq_meta[!is.na(RIN)][libraryPrep == "polyAselection"]
# get metadata for a... |
892c8172c65e952314fbdb9eb83a8fd1115f539eebf9a38c6ddeefa02bd6cff7 | R | 2,386 | 88 | source("code_utils/read_data/utils.R")
source("code_utils/read_data/installation.R")
install_libraries()
library(SingleCellExperiment)
library(rhdf5)
library(tidyverse)
library(Matrix)
library(mclust)
library(rjson)
args = commandArgs(trailingOnly=TRUE)
config_file_path <- args[1]
params <- fromJSON(... |
bb1d45552dd2d22518d517735618faf96829923ec6ca534d40d7b4c317059a0a | R | 2,392 | 72 | #' Cluster information for MTG data set.
#'
#' Cluster information (including name, color, and type) for MTG data sets.
#'
#' @format A data frame with 75 rows and 11 variables:
#' \describe{
#' \item{cluster_id}{cluster identifier}
#' \item{cluster_label}{cluster name}
#' \item{cluster_color}{cluster color in MT... |
7399ca6f14788f6852ab832ee7d177fbe8d74b66a8d6eb868580f6386dad2ad1 | R | 2,393 | 82 | ---
title: "panel_Kv_toxin"
author: "Franz Xaver Mittermaier"
date: "2024-05-02"
output: html_document
---
This script creates the graph for the DTX-I experiments.
In brief, I performed axonal bleb recordings. In voltage clamp mode I then performed the following protocol:
Activation protocol: The bleb was hel... |
cd179716d356dec446c9f8424c872f35adfcbdbc5e4d4de8164c36fba7b60f83 | R | 2,397 | 83 | library(data.table)
library(ggplot2)
library(scales)
dt = np_cpg_rna
# tmem106B expression vs. LATE
p_late_tmem = dt[
!is.na(TMEM106B) & !is.na(tdp_st4),
ggplot(
.SD,
aes(x = factor(tdp_st4),
y = log2(TMEM106B) + 1,
fill = factor(tdp_st4),
alpha = 0.2))] +
geom_boxplot(outlier... |
1f7459a5a72fe8e3ede5b4d1785400d7db2edc2a8458e9e2eb312a6f9b5f4085 | R | 2,398 | 84 | # Auxiliary functions to transform relative treatment effects to
# pairwise comparisons
#
# Author: Gert van Valkenhoef <gvanvalkenhoef@cochrane.org>
# License: GPL (>= 2)
#
# For use with dplyr::group_map
#
pwgen_study <- function(input, studlab) {
# Get rid of warning 'Undefined global functions or variables'
tr... |
965e66853bd03fe7bf4320dd1fb32cd1ef04ecf0dd9eced30287bf1027c671d7 | R | 2,407 | 80 | # 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... |
94a5081639c5ba5c340419ff22c8baeeef68302d98c31bf6773902a75cbd4063 | R | 2,411 | 56 | # ========================================================
# Make tables of LDSC partitioned heritability results
# The results files (.results) from the LDSC run should be organized
# by annotation, with separate directories for each annotation.
# Updated for the nonGC version
# ===================================... |
eaa3014fc8d685acc178568d149333b62c8b85110692460684b490ec0d53f1f8 | R | 2,415 | 72 | library(ArchR)
library(BSgenome.Mmulatta.UCSC.rheMac10)
library(TFBSTools)
library(JASPAR2020)
addArchRThreads(threads = 8)
rheMac10_UCSC = createGenomeAnnotation(genome='BSgenome.Mmulatta.UCSC.rheMac10')
# Load Data
adata = loadArchRProject('MacaqueBrain')
# Add JASPAR2020 motifs
PWM <- getMatrixSet(
x = JASPAR... |
400c1b305e61b1b6ade54387187de964ed5a30dcf19c4eb358e1055258a75452 | R | 2,423 | 48 | source('./scripts/01_Setup.R')
setwd("./data/processed/rds")
aa= grep("_gc_plot",list.files(), val=T)
aa2= aa[aa%in%c("dMDA_101_500kb_gc_plot.rds",
"Pico_76_500kb_gc_plot.rds",
"Pico_101_500kb_gc_plot.rds",
"PTA_48_500kb_gc_plot.rds",
"PTA_101_500kb_gc_pl... |
4b13f5c02d98179f52bbc891cb151764dffe793da13a4b688a9aaa58dd29efce | R | 2,424 | 70 |
library(data.table)
library(stringi)
nacc <- fread('data/adc/apoe_snps.raw')
rosmap <- fread('data/rosmap/apoe_snps.raw')
act <- fread('data/act/apoe_snps.raw')
adni <- fread('data/adni/apoe_snps.raw')
# covar <- fread('data/mega/mega_np.covar')
nacc_covar = fread("data/adc/adc_np.covar")
rosmap_covar = fread("data/r... |
d0bbf797ac8690a4b5581dd179937a9f8c031fb8cbef762332b0810e8c46f6b0 | R | 2,430 | 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... |
16f33d4a02867fa5131db9acf8474784b06697f0817366bea687b40d64e4f3fe | R | 2,431 | 123 | ##
##Performs perurbations to get p-values for lm
##
lm.pert<-function(dat,form,perturbations="perturbations",batch="batch",numRep=1000,useBatch=F,dep_var="DPT",ref="",minPert=10,verbose=T)
{
dat=dat[!is.na(dat[,perturbations]),]
lst=table(dat[,perturbations])
dat=dat[dat[,perturbations] %in% names(lst)[... |
e8f7d2becb505dd6f7be0a1a7cf62bbaef982f16b9c8c69e651622f498161d66 | R | 2,436 | 42 | #----Figure_06_G----------------------------------------------------------------
#-------------------------------------------------------------------------------
# This is the code for Figure 06 Panel G for the connectivity analysis for
# Reinhard and Fukuda et al. 2024
#-------------------------------------------... |
9a13555d811922702c8fad959e7d4421e7c81d0630805bae23f88278d14b62da | R | 2,437 | 59 | #' makeChipsMultiClass
#'
#' Deprecated. Use \code{\link{makeChips}} with \code{mode = "Positive"} instead.
#'
#' This function is a deprecated wrapper around \code{\link{makeChips}}. It
#' will be removed in a future version. Replace calls of the form:
#'
#' \code{makeChipsMultiClass(image, mask, ...)}
#'
#' with:
#'
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.