sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
d48b039a9d31b98fe4643dcc28fa585bc0f8d1514f8aad57d24d5d302c3af587 | R | 2,446 | 57 | #' Load data and annotaitons from Excel file and create SE object
#'
#' Load data and annotation matrices from Excel sheet. This function assumes the Excel file
#' contains three sheets corresponding to the assay, rowData, and colData data frames. The file
#' must satisfy the following requirements:
#' \itemize{
#' ... |
bde9838256a54321e36d03143b3534715fe3fa1d074659c9d07e1ca87b42f73b | R | 2,452 | 49 | #######################################################
### Deep Brain Stimulation: STN vs GPi.
### Table One
### 2023 Katrin Petermann
#######################################################
t1_variables <- c("sex", "age_surgery", "disease_duration", "time_after_surgery", "pdq39_si_preop",
"ledd_pr... |
8135916c0aed420a1c59db366af6178897a32e714075080ced3f508e925a418c | R | 2,459 | 77 | #! /usr/bin/Rscript --vanilla
#=================================
# POLMM SNP regression
#=================================
library(data.table)
library(snpStats)
library(POLMM)
library(stringi)
library(argparse)
parser <- ArgumentParser()
parser$add_argument("-m", "--model",
help = "path to POLMM ... |
39e355c05cb82e7ce420cb1ff0bf36d2516a1e9e91e8bf6e8c68a82ebe769e6c | R | 2,462 | 58 |
###Script 6
#cell classification with MapMyCells (Allen brain atlas)
library(Seurat)
library(sctransform)
library(patchwork)
library(dplyr)
library(anndata)
md <- readRDS("output/atlases/seurat_metadata_subset.rds")
###Save compressed h5ad files for each raw library
for (i in unique(md$orig.ident)) {
... |
83efbb2d2fd726434b998ab023c5346aab4ad167ea841bc97023f0f1249aa200 | R | 2,464 | 57 | test_that("metagen robust methods work without cluster", {
skip_if_not_installed("metadat")
data(dat.konstantopoulos2011, package = "metadat")
dat <- dat.konstantopoulos2011
ma <- metagen(yi, sqrt(vi), studlab = study,
data = dat,
sm = "SMD")
ma_cr01 <- update(ma, method.rand... |
2280eb5c13db9321ffdbaa9e5a7f35ccb04a4b15564d395d591b284e9cbcb2c2 | R | 2,465 | 81 |
library(dplyr)
library(ggplot2)
##################################
###QC filtering based on nuclei###
##################################
nuc.res <- read.csv("output/RNAscope_cellprofiler_Nuclei.csv") %>%
mutate(ID = paste0(ImageNumber, "_", ObjectNumber))
valid.ids <- nuc.res %>%
filter(AreaShape_Comp... |
e2ce000a4be932ff9e6c69be3f4bb7e3f10a614e4db06d419cde392dbec352ff | R | 2,477 | 73 |
#' List available *R hyperSpec* family packages
#'
#' @description
#' Get the names of *R hyperSpec* family packages that are available on GitHub
#' organization [**`r-hyperspec`**](https://r-hyperspec.github.io/)
#' (the official homepage of these packages).
#'
#' This function requires Internet connection.
#'
#' @de... |
cb96b73f8dc5281f179137febad81ab4db94e5ac23abc45830a81ffa28ca0157 | R | 2,484 | 37 | source('./scripts/01_Setup.R')
top=8
L2_hg38 <-readRDS("./data/processed/Pico_101_250kb/L2_4min_Exp1.7A_sn2_Fibr_CellRaft_v3_S32.bt2.hg38.sorted.dup_marked.bam.rds")
L2_lift<- readRDS("./data/processed/Pico_101_250kb_lift/L2_4min_Exp1.7A_sn2_Fibr_CellRaft_v3_S32.bt2.hg38.sorted.dup_marked_mapped_T2T.sorted_ilmn.pe.lif... |
96e16743b9a4533af0d44e97291d98f593ffbe0705f11ad1a7f0ae51ee15c007 | R | 2,486 | 56 | #' describeBatch
#'
#' Generate summary information for a batch of image chips and masks.
#'
#' The goal of this function is to provide a check of a mini-batch of image chips and associated
#' masks generated by a DataLoader instance using defineSegDataSet(). Summary information includes the mini-batch size
#' (batchSi... |
dd4d774a22aedf302e61675e6dc97451bf76017c896016ad758fc0e97cf0d410 | R | 2,490 | 69 | ---
title: "IPD_genes"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r}
library(tidyverse)
library(RColorBrewer)
library(reshape2)
library(ggbreak)
```
```{r}
setwd("Z:16-Our Papers\\In Preparation\\PD_Diabetes_Alise\\Figures\\Figure2\\originals\\B... |
1da297a4980269a9deabe8b6382cd10f58aa5aeb2111dfc1c4b3d1d852610c1a | R | 2,492 | 97 | #' takes an LMEM object and plots the results
#'
#' This function is meant to depict the time course of
#' t statistics for each effect in a lmem_test object. At state it is
#' very essential, and there is little room to set graphical pars from
#' within this function.
#'
#' @param LMEM A lmem_test object.
#' @param ex... |
0ff1663f9558ae90661fc1b7f53649903091a2282b38fae887919a756ea2052a | R | 2,498 | 78 | #! /usr/bin/Rscript --vanilla
library(data.table)
library(snpStats)
library(stringi)
library(foreach)
library(doParallel)
library(argparse)
library(stringi)
parser <- ArgumentParser()
parser$add_argument("-b", "--bim", help = "PLINK .bim file",
default = "data/mega/mega_np.bim")
parser$add_argumen... |
2bbd2e72773b0606b2d7ba9c997bb778593df8850aea5cfe42c8436c4ad29f3e | R | 2,498 | 78 | # load libraries and arguments
library(tibble)
library(data.table)
library(Seurat)
library(WGCNA)
set.seed(1234)
#---------- Parameters -------------------
args = commandArgs(trailingOnly = TRUE)
sample_path = args[1]
model_path = args[2]
pred_path = args[3]
threads = as.numeric(args[4])
nPC_used = as.numeric(args[5... |
077b503f4fcbc537775f54616799faa8a93d5b71a9ae1c0f8bfff0b9d0f651b0 | R | 2,516 | 68 | test_that("metacor checks null effect on correlation scale", {
cor <- c(-0.2, 0.1, 0.4)
n <- c(20, 30, 40)
expect_equal(metacor(cor, n, sm = "ZCOR", null.effect = -1)$null.effect, -1)
expect_equal(metacor(cor, n, sm = "ZCOR", null.effect = 1)$null.effect, 1)
expect_error(metacor(cor, n, null.effect = -1.1),... |
44f036e17ff461fb68aba39d24bb5b3cc2baf57c66ec641608b34944b7779c5d | R | 2,523 | 63 | library(Seurat)
library(ggplot2)
library(reticulate)
np <- import("numpy")
Args<-commandArgs()
PATHDIR = Args[6]
RNAfile = paste0(Args[6],'scRNA_count.txt')
RNA <- read.table(RNAfile,sep = '\t',header = TRUE,row.names = 1,quote = "")
RNA <- CreateSeuratObject(counts=RNA, project='RNA', min.cells=0, min.features=0)
Sp... |
462d339335ad4ed6a910562ee8863950b8b3d07b533b2b260471734b0eb64a30 | R | 2,523 | 62 | # --------------------------------------------------------------------------------- #
# #
# Hippocampal volumes in UK Biobank are associated with APOE only in older adults #
# ... |
6a06c018ff770dd47186718177b121774efbf4820c7fa472e802b81335147f87 | R | 2,528 | 66 | ---
title: "panel_axon_passive_sig"
author: "Franz Xaver Mittermaier"
date: "2023-06-20"
output: html_document
---
This script plots the panel that shows the attenuation of the passively spreading subthreshold depolarization along the axon. I performed paired somato-axonal patch-clamp recordings. I injected cur... |
84c1101a88ba6f3822bfa436c92e5151658cfe1746a9fff31343fc85011f261f | R | 2,536 | 70 |
library(data.table)
library(magrittr)
na_strings <- c("-9", "-4", "9999", "999", "888")
# Universal Data Set + NP
uds <- fread("/data_global/nacc/investigator_nacc61.csv",
na.strings = na_strings)
# NP data not longitudinal, so just keep obs from last visit
uds <- uds[NACCVNUM == NACCAVST]
# Minimal Da... |
14d7f21530e5615ecaed1ec7b3f2f59c2d81bd8bfd67a9b6248401d22cf8a44a | R | 2,539 | 93 | #' Consolidate pupil data according to different heuristics
#'
#' Mostly used, e.g., when pupil data is available for both eyes and one needs
#' a single variable. Results are weighted by vectors of signal validity
#' as provided by the eye-trackers. If absent, that all signals is valid is assumed.
#'
#'
#' @param s1 A... |
9e5882646493ba64dd8fa491fe0616f8b7eaef935da1c5b3b9982ff5b578a20c | R | 2,541 | 85 |
library(readr)
library(ggplot2)
library(RColorBrewer)
library(reshape2)
library(gridExtra)
library(tools)
library(plyr)
library(matrixStats)
library(tidyverse)
library(stringr)
path <- file.choose()
DIR <- dirname(path)
#Merge the track basic info
Track_results <- list.files(path = DIR, # Identify all csv f... |
cd86bbcd5615476c0eca1f603dd5f38f01c26920ea169befaf801976f20d2e84 | R | 2,546 | 71 | library(geodl)
setwd("Your Working Directory")
# Dataset Example ----------------------------------------------------------
#Get chips dataframe
chpDF <- makeChipsDF(folder = "data/toChipBinary/chips/",
outCSV = "data/toChipBinary/chips/chipsDF.csv",
extension = ".tif... |
5e270ddd44bee986426756b9ae36f742192a217c2f648943f4f93d91295c5e92 | R | 2,552 | 58 | #' Output AutoFocus clusters at a specified threshold in table format
#'
#' Outputs a dataframe containing the information on nodes found in AutoFocus clusters of size greater than 1
#'
#' @param R R_struct object output by initialize_R
#' @param threshold Enrichment threshold at which to calculate cluster enrichment
#... |
1f0fd752381a11cfd65d012bf3ecb38cf86a54b9fabe9c95ed1a046dcf01d49f | R | 2,564 | 69 | test_that("transf handles Freeman-Tukey transformed proportions", {
p <- c(0.1, 0.2, 0.3)
n <- c(10, 20, 30)
expected <-
0.5 * (asin(sqrt(p * n / (n + 1))) +
asin(sqrt((p * n + 1) / (n + 1))))
expect_equal(transf(p, "PFT", n = n), expected)
expect_equal(transf(p, "PFT"), p2asin(p))
expec... |
972f6f13eaeaab8d98954df21d6ae7633f28d81ad6efebba14eecf13eb4643f1 | R | 2,568 | 92 | #' @aliases levelplot,hyperSpec,missing-method
#' @include plotmap.R
#' @rdname levelplot
#'
#' @export
#' @concept plotting
#' @concept plotting tools
#'
#' @seealso [`hyperSpec options()`][hyperSpec::options] [spc.identify()]
#' [map.sel.poly()]
#' @param tol tolerance for `map.identify` as fraction of the viewport
... |
371b660d53e31a6a64b3b779a0f1ca4515063518e687baf1f7dfc72fff3f5f9a | R | 2,571 | 58 | library(Giotto)
library(SeuratDisk)
args<-commandArgs(T)
scrna_path = args[1]
spatial_path = args[2]
celltype_final = args[3]
my_python_path = args[4]
output_path = args[5]
instrs = createGiottoInstructions(python_path = my_python_path)
sc <- LoadH5Seurat(scrna_path)
st <- LoadH5Seurat(spatial_path)
st_data <- create... |
56c73ce74b250d3a84b3a8b68e5bbe607be6347a9325a07ced376fe3289f6f0f | R | 2,573 | 95 | library(SingleCellExperiment)
library(celda)
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-celda", dataset))
if (!dir.exists(output_path)) {
dir.create(output_path, recursi... |
8df89e6585fb0c10c5ae3ebd2ac319754da7efadd4b3aa747260718ade1ceeb9 | R | 2,580 | 82 | #' copy a variable from one data.frame to another of different length given ID and Trial constraints
#'
#' Sometimes info that are relevant for the eye-tracking file are only to be
#' found in the associated behavioral file. These data.frames have different
#' dimensions, thus copying one variable to another can be cum... |
6521d1e656d15b12b72ad92024f41a451d8280ffd80521c58f0b2059938094a2 | R | 2,596 | 90 | #' @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 w... |
a05a8d4f5a710c7289ae3e576eecd9b83474b09295177692e1ea6bd01f5c5917 | R | 2,597 | 83 | #' @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... |
d676d561d7e49a22c1c03167743d6945a191a6cb75edaf1907c3aa199c675061 | R | 2,606 | 61 | #' the R implemention of a computational framework to evaluate the cellular states
#' @description score the cell states on the single-cell RNA-seq digital expression profiles
#' @param mat a features x barcodes expression matrix
#' @param state cell state(s) to evaluate. For now, Optional states: Exhaustion, EMT, Cell... |
f30aa6ffa4413c4b4c69906abd8e2bfab8a2a098cc081115bd7d88034f49ebe6 | R | 2,607 | 57 |
library(data.table)
library(tidyverse)
#net_cols <- c("#0072B2", "#009E73", "#D55E00", "#56B4E9", "#E69F00", "#F0E442", "#CC79A7")
net_cols <- c("#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7")
# TMT
# A
d_subsample = read_csv('/data/project/ukb_reliability_in_prediction/input/learning_c... |
40b9df5f0ad9e5ad4991e22096a2b92e9e8b7a4564c783f0e741b5bfe2b20d89 | R | 2,620 | 78 |
library(Seurat)
library(stringr)
setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
metadata <- read.csv("../raw_data_full/metadata_split.csv")
metadata$sex <- as.factor(metadata$sex)
metadata$study <- as.factor(metadata$study)
#metadata$cell_type <- as.factor(metadata$cell_type)
#metadata$orig.... |
53dcff7696ac2e11d366c7600fd162f6a6ca8fb76234da29625d99fbcf49e335 | R | 2,624 | 82 | # File: model_init.R
# Author: Kelly Chang
# Zhihua Li
# Date: Oct 2017
# Version: 1.0
#
# Description: Helper R function to initialize a drug binding model and run
# voltage clamp simulations at different drug concentrations.
#
model_init<-function(modelname, s... |
875f66f5eb5d89d0842d43494015de9a6ddd8d4bbf8957f1225b943681ae5293 | R | 2,628 | 84 | # source: https://gist.github.com/benmarwick/2a1bb0133ff568cbe28d, 06.07.2022
# somewhat hackish solution to:
# https://twitter.com/EamonCaddigan/status/646759751242620928
# based mostly on copy/pasting from ggplot2 geom_violin source:
# https://github.com/hadley/ggplot2/blob/master/R/geom-violin.r
library(ggplot2)
... |
5a3ac97063a5a8d4b5fa8fe3093b9ef2bfe538a7aa47ac3e832cc94b5a6c2f1c | R | 2,631 | 42 | #----Figure_07_A----------------------------------------------------------------
#-------------------------------------------------------------------------------
# This is the code for Figure 07 Panel A for the connectivity analysis for
# Reinhard and Fukuda et al. 2024
#-------------------------------------------... |
f850be3796528dab7129f69c41aff4a6fd130773a9b84ed6f4e874c5bce15094 | R | 2,632 | 48 | file = args[1]
outfile = args[2]
b=list()
mononuc=list()
################ cpg
a=fastread(paste("zcat ", file,sep=''))
a$PROMOTER = substring(a$PROMOTER,6000,14000)
a$EXPRESSION=log10(a$EXPRESSION+0.1)
a$EXPRESSION=(a$EXPRESSION-min(a$EXPRESSION))/(max(a$EXPRESSION)-min(a$EXPRESSION))
a$bin <- cut(a$EXPRESSION, breaks... |
0de911633326966740f2e5bc5296c4f49a8431c185017e4e327a31d35c680003 | R | 2,635 | 116 | #' Plot spectra matrix
#'
#' Plots the spectra matrix.
#'
#' If package \pkg{plotrix} is available, a color legend is plotted to the right.
#' The right margin is set to at least 5 lines.
#' @param object hyperSpec object
#' @param y character giving the name of the extra data column to label the y axis.
#' @param ylab... |
710c000a93e29095ce83e198653c1af21ee1f3f8ad429343335aa2ac6272da82 | R | 2,636 | 78 | #Install the package. If no package is installed, perform the following operations
#if (!requireNamespace("BiocManager", quietly = TRUE))
#install.packages("BiocManager")
#BiocManager::install("limma")
#BiocManager::install("Biobase")
#BiocManager::install("edgeR")
#BiocManager::install('bladderbatch')
#BiocMana... |
5c653192e8210dfce45f6928a733000bb177f0831d95a139531cb3b7b7040552 | R | 2,639 | 67 | ## Marker gene score
calculate_marker_gene_score <- function(gene_spectra_score_file, geneset, scale = TRUE){
## Get top 50 genes per GEP
gene_score <- read.table(gene_spectra_score_file, sep="\t", header = TRUE, stringsAsFactors=FALSE, row.names = 1)
rownames(gene_score) <- paste("GEP_",seq(1,nrow(gene_... |
4329d286b1b786d8f86e8e8b34b779a07810b9d81c2f526f5ecb37ca6c833400 | R | 2,641 | 77 | #! /usr/bin/Rscript --vanilla
#======================================
# Fit null model for POLMM regression
#======================================
library(data.table)
library(POLMM)
library(argparse)
library(dataPreparation)
library(parallel)
parser <- ArgumentParser()
parser$add_argument("-c", "--covar", help="pat... |
94b87cca629e8124f2fcc80aa765906f575e0a46f0fba678c6676fcbbca376df | R | 2,644 | 78 | #' @title Core function to conduct STADIA algorithm
#' @description core function to conduct STADIA algorithm
#'
#' @importFrom methods slot
#'
#' @param object.list a list of seurat object.
#' @param hyper a list of all hyperParameters.
#' @param dim dimension of hidden space.
#' @param n_cluster number of spatial dom... |
5a5b98b8bfc64f6e6b4ed81c2cd166183ac4f01ace20445c14d98846e491b76c | R | 2,655 | 69 | library(data.table)
library(gwasglue)
library(coloc)
calc_betavar_from_beta_pval <- function(beta, pval) {
z <- qnorm(pval / 2, lower.tail = FALSE)
se <- beta / z
betavar <- se^2
betavar
}
calc_betavar_from_beta_pval <- Vectorize(calc_betavar_from_beta_pval)
make_coloc_dataset <- function(l) {
ds <- c(l$dat... |
39b8860d6ec346674c81055ec9d9a7d6c3f2f0173b4533dbe8782df48e56455d | R | 2,665 | 84 | # FNIH Project 2
# get AUCs for covariates-only models
#### Coded: Kellen Petersen
#### Date as of commenting and documentation - 05/28/2024
# Load libraries
library(tidyverse)
library(pROC)
library(here)
#here::i_am("get_AUC_covariatesOnly.R")
data_file <- here("adni_data","cross_sectional_data_CLEAN.csv")
data.in0... |
55d8d07776cf0662fd92b320fd35cb0a7899f66f2d22fcdd51b15028dc4a81db | R | 2,670 | 53 | #' get_represented_helper
#'
#' This function retrieves the tips that are represented for a given tip x. It serves as a helper function for mapping.
#'
#' @param x The tip for which represented tips are to be retrieved.
#' @param df_duplicate The data frame containing duplicate information.
#' @param df_label The col... |
8279d6d04a7537f80bf2b66e25c44095cb999d0c2deab968d3d5f31db50c29c7 | R | 2,672 | 50 | ##Scrublet - compiling all the doublet and nondoublet outputs
library(SingleCellExperiment)
library(Seurat)
library(tidyverse)
library(Matrix)
library(scales)
library(cowplot)
library(RCurl)
library(DeconRNASeq)
library(gplots)
library(dplyr)
library(MCL)
library(clusterProfiler)
library(mygene)
library(tidyr)
librar... |
3a41a41ece12987e05da4cd3c0a6db36899510da22a2c33ef9276bff6522fd7b | R | 2,675 | 95 |
library(tidyverse)
library(psych)
plt_out = '/data/project/ukb_reliability_in_prediction/plots/UKB/'
# load data
T1 <- read.csv('/data/project/ukb_reliability_in_prediction/input/cog_plus_2.0_data.csv', check.names = FALSE)
T2 <- read.csv('/data/project/ukb_reliability_in_prediction/input/cog_plus_3.0_data.csv', c... |
0db535a25041719139d53b9102a4a4cb61692f6bb30324af6c9982f564feda32 | R | 2,681 | 54 | #This R script uses the plotly package to create two 3D surface plots based on fluorescence and
#diameter data from a dataset. It sets up the working directory, loads the data, and then subsets
#it for plotting. The plots visualize how fluorescence and diameter change across the length of a
#flagellum over time. T... |
6d71449e3f4a780a874ba5fc43bd2cb8435c049f3bf4563ab4fcad24e9976a7e | R | 2,683 | 105 | #' Getting and setting the wavelength axis
#'
#' `wl()` returns the wavelength axis, `wl<-` sets it.
#'
#' The wavelength axis of a `hyperSpec` object can be retrieved and
#' replaced with `wl` and `wl<-`, respectively.
#'
#' When the wavelength axis is replaced, the colnames of `x@@data$spc` are
#' replaced by the rou... |
c417593d896b9f30e3e530fff55ccfd4d994c6458d19e07c129ffe9b1ee3bf00 | R | 2,698 | 69 | #' export_meta_treenodes_funV2.R
#' Modified according to the afterthoughts of collaborators
#' Function that wrangles the metadata for a tree using plot_data. Given a set of labels of tips and nodes,
#' and all the represented tips for each set of labels, it join the metadata - unnests a set of selected
#' columns, r... |
c103370b80601387fb3aa0143f6b72642368390e65c9874c80870f20850126b0 | R | 2,716 | 66 | library(RCTD)
library(Matrix)
library(data.table)
library(Seurat)
library(SeuratDisk)
args<-commandArgs(T)
snrna_path = args[1]
spatial_path = args[2]
celltype_final = args[3]
output_path = args[4]
sc_obj <- LoadH5Seurat(snrna_path)
diff_list <- list()
c = 0
for (i in seq_along(unique(sc_obj@meta.data[,celltype_final... |
014f3b45a8960bc06fbf070aac8e1ee3b12036bfba1521c56f90a8fe51b47770 | R | 2,721 | 63 | ###assign clusters on integrated dataset
#2022-06-01
#Jessy Slota
library(Seurat)
library(sctransform)
library(patchwork)
library(dplyr)
dt.sct <- readRDS("datasets/3_seurat_integrated_clustered_sctype.rds")
dt.sct <- RenameIdents(dt.sct, `0` = "oligo.0", `1` = "astro.1", `2` = "opc.2",
... |
2eb52933292bc477a2e7c6e37e0dbd1a5406d714aaaa2a92f840f15c5809f289 | R | 2,724 | 92 | 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(... |
63fee35042ed814ff4de81923e38472a83095854b7c7bc67f6533cdbe2eb6671 | R | 2,725 | 64 | library(ggplot2)
library(readxl)
#Figure 1b, make piechart of STR annotations
dat.annot<-data.frame(read_excel("plot_table_fig1.xlsx", sheet=1), stringsAsFactors = F) #,header=TRUE)
dat.annot$annotation<-gsub("Downstream", "Distal_Intergenic", dat.annot$annotation )
dat.plot<-data.frame(table(dat.annot[dat.annot$seg_d... |
fab4a0a4758a20c4bf3d892324e208409597bcc2aa585112080fe5b2dbe33c0e | R | 2,726 | 64 | library(LSD)
library(data.table)
library(ROCR)
####################
##One2One analysis##
####################
a=read.delim("human2mouse_one2one_orthologs.txt",F)
b=fread("zcat Roadmap_FantomAnnotations.InputData.pM10Kb.txt.gz | cut -f 1-2",header=T,data.table=F,sep="\t")
c=fread("zcat Mouse_FantomAnnotations.InputData... |
076f267eb0c4eba07c348c66f6b041abb2b138dc7e15a2688c692af3787e2fac | R | 2,730 | 45 | #----Figure_06_B----------------------------------------------------------------
#-------------------------------------------------------------------------------
# This is the code for Figure 06 Panel B for the connectivity analysis for
# Reinhard and Fukuda et al. 2024
#-------------------------------------------... |
7d9ab828f8617eac7d16df8805d1e081332c131914c111e489ae0582b38e5cb4 | R | 2,732 | 103 |
#single tissue top
#gtex v8
args<-as.numeric(commandArgs(TRUE))
folder='top'
#set up sub jobs
run_id<-1
run_list<-list()
for (i in c(22)){ #tissues
for (j in 1:40){ #subjobs per tissue
run_list[[run_id]]<-c(i,j)
run_id=run_id+1
}
}
run_i<-run_list[[args[1]]]
print(run_i)
#tissue... |
1cc58bdf775d610c83bea727451188de1a3e35553a78cbba0b3079de9f62c3e6 | R | 2,733 | 86 | # load in the packages
library(Seurat)
library(SeuratData)
library(SeuratDisk)
library(irlba)
library(ggplot2)
library(dplyr)
library(Matrix)
library(uwot)
library(RColorBrewer)
library(cowplot)
## Convert h5ad to seurat
Convert("./D11.log.norm.h5ad", dest= "h5seurat", assay = "RNA", overwrite = FALSE, verbose = TR... |
aad9c461f17fffaaafda72c1c983919df3cd0d120151136f5beb7e62c61268fa | R | 2,736 | 56 | #read in expression data (exon array expression)
loadBrainSpanExpression <- function(pathToBrainSpanExpression, doRankTransform=TRUE) {
rowLabels <- read.table(paste0(pathToBrainSpanExpression, "/rows_metadata.csv"),header=T,row.names=1,sep=",",stringsAsFactors = F)$gene_symbol
print("Loading expression, please wai... |
c83c8110ad1321a8afb380a386eaa1b19c2c83e97bfdd468ee560e9f7e5e5e43 | R | 2,740 | 56 | source('./scripts/01_Setup.R')
setwd("./data/processed/rds")
aa= grep("_lorenz",list.files(), val=T)
aa2= aa[aa%in%c("dMDA_101_500kb_lorenz.rds",
"Pico_76_500kb_lorenz.rds",
"Pico_101_500kb_lorenz.rds",
"PTA_48_500kb_lorenz.rds",
"PTA_101_500kb_lorenz.rd... |
f49e9b0fc4430632f8d0aa76097b03a19c5b15998c52bc9beac5d6f29e75ef6e | R | 2,745 | 64 | library(Seurat)
library(sctransform)
library(dplyr)
library(HGNChelper)
EC1 <- readRDS("datasets/raw_dataset_EC1.rds")
EC2 <- readRDS("datasets/raw_dataset_EC2.rds")
EC3 <- readRDS("datasets/raw_dataset_EC3.rds")
EC4 <- readRDS("datasets/raw_dataset_EC4.rds")
EC5 <- readRDS("datasets/raw_dataset_EC5.rds")
EC... |
87c273fd7b44524641262dd93c1b793b5458e8704f0f90227f089f7140c2a31e | R | 2,746 | 75 | library(data.table)
library(Biostrings)
library(rhdf5)
library(reshape2)
h5dir = args[1]
kmerlen = args[2]
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_Fantom... |
865ac9709b7da2077a07806150281e8826bd4a48b0f5132a279a4bbb978b84c1 | R | 2,747 | 67 | #' the R implemention of a computational framework to evaluate the cellular states
#' @description score the cell states based on your model
#' @param mat a features x barcodes expression matrix
#' @param w1_file weight file downloaded from the online training website
#' @param b1_file bias file downloaded from the onl... |
038ecdbde26f141eb1aeeb529e1ab34b8d11e871be92a0f171138e22f0b21d09 | R | 2,753 | 84 | #' Function to get the isolate ID from a prepared data where
#' labels are given in a string format.
#' HELPER : done to accomondate change of mind
#' rerun the dataframe where the columns where the labels are stored with isolateID instead
#' @param data the dataframe to modify label, val
#' @param metadata the metada... |
e6301b1dda36ce6807ab379c58e98f163b51cc90048988b582825737d254121e | R | 2,754 | 80 | library(fgsea)
library(data.table)
library(ggplot2)
library(msigdbr)
library(dplyr)
library(ComplexHeatmap)
library(RColorBrewer)
library(future)
library(ggrastr)
library(ggrepel)
gmt.file <- gmtPathways("c5.go.v2023.2.Hs.symbols.gmt")
###############
###MAST GSEA###
wrap.gsea <- function(i) {
x <- ... |
137079dea59c28087203d1e36f9326a404435fd1579ece4c9c41c7cd3c596ebf | R | 2,757 | 131 | # Function -------------------------------------------------------------------
.ncol <- function(x) {
validObject(x)
ncol(x@data)
}
#' Number of rows (spectra), columns, and data points per spectrum of a
#' `hyperSpec` object
#'
#' These functions return the number of rows (spectra), columns, and/or
#' data points... |
4a4b0c8f88abfc0543f79735f2c9bad44eaf020c1f556fe70d7507b8c8d8db2e | R | 2,765 | 66 | #DPR environment
#ml GCC/6.4.0-2.28 Python/3.6.3 OpenMPI/2.1.1 numpy/1.13.1-Python-3.6.3 pandas/0.18.1-Python-3.6.3 scipy/0.19.1-Python-3.6.3 tabix/0.2.6 R
#source /data/c***/z***/tools/TIGAR/tiger_env/bin/activate
#export PYTHONPATH=$(python -c 'import sys; print(sys.path[-1])'):${PYTHONPATH}
#---R script for ... |
2f174529c1630ee86f3db266af1aad5f47d50afcba0c14ac7620aad64692b29d | R | 2,769 | 81 | library(data.table)
library(coloc)
library(ggplot2)
library(ggthemes)
caa_apoe <- fread("output/gwas/mega/polmm/caa_ord_apoe_polmm_results.txt")
pheno <- fread("data/mega/mega_np_ord.pheno", na.strings = "-1")
covar <- fread("data/mega/mega_np_apoe.covar")
caa_apoe_snps <- caa_apoe[pval.spa < 5e-8, SNPID]
chr19_mqtl <-... |
a3bfabb4db4d810d52a5615f33f232b0cb28a3c2db65bc840c54590d7c7ec253 | R | 2,796 | 80 | library(fgsea)
library(data.table)
library(ggplot2)
library(msigdbr)
library(dplyr)
library(ComplexHeatmap)
library(RColorBrewer)
library(future)
library(ggrastr)
library(ggrepel)
gmt.file <- gmtPathways("c5.go.v2023.2.Hs.symbols.gmt")
###############
###MAST GSEA###
wrap.gsea <- function(i) {
x <- ... |
f2422437ff31e847e932e68846576f45ba2a1306d16db94e7665b2ce8ea9649b | R | 2,807 | 59 | # Description: Extract highly variable genes of zebrafish embryonic (ZB) scRNA-seq data.
# Author: Jiaqi Zhang <jiaqi_zhang2@brown.edu>
# Reference:
# https://www.science.org/doi/10.1126/science.aar3131
# https://github.com/farrellja/URD
# https://singlecell.broadinstitute.org/single_cell/study/SCP162/
library(UR... |
d4b62a586df4bc64446d476c3898d1b722f7b4b2f9fd10f0efe77f160914e66d | R | 2,814 | 69 |
#' mochims__plot_additive_trait_3state_sos
#'
#' Plot sum of sigmoids additive trait.
#'
#' @param mochi_outpath path to MoCHI thermo model fit results (required)
#' @param input_dt data.table with model free energy estimates (required)
#' @param phenotype_name phenotype name (default:'Binding')
#' @param report_outpa... |
1872d5045f1794ba284e60117871f421929d2130c8b39b54f8f05943a7b0017a | R | 2,816 | 88 | ---
title: "Selection species tree"
author: "Bucao, Christabel Floi"
output: html_document
date: "`r Sys.Date()`"
params:
selectome.path: "../../data/selectome"
output.rds.path: "../../results/09_Selection_Species_Tree"
---
# Setup
## Parameters
```{r print-params}
print(params)
```
## Libraries
```{r import-lib... |
aab6e0bda98f8eecf3a8378ac69aee231149119e41473e3c8d2102e3f855d9be | R | 2,816 | 96 | #' Animate a 3D scatterplot (based on plot3D) through gifski
#'
#' This function executes plot_manifold, from which it
#' inherits parameters, iteratively, saves each frame in a folder in the
#' current path, and then creates a gif with the package gifski,
#' which must be installed.
#'
#'
#' @param Scores An object as... |
edc415fc581494070b8e4c40d4f911088c5769c86050ad7c85cfc102ca971772 | R | 2,817 | 57 | # --------------------------------------------------------------------------------- #
# #
# Hippocampal volumes in UK Biobank are associated with APOE only in older adults #
# ... |
6f7a243f015d336582b95c579daf51d833841549e3a48cfa86f83b8711d72ef6 | R | 2,820 | 101 | #' @name DEPRECATED-wc
#' @concept moved to hySpc.read.txt
#'
#' @title (DEPRECATED)
#' Line/word/character count of ASCII files
#'
#' @description
#'
#' These data input related functions are **deprecated** and they will be
#' removed in the next release of \pkg{hyperspec} package.
#' Now functions in package \... |
7838985edf948e45fe658f006c88475ae5a01acf9e0f202dff6065deeefd9fc3 | R | 2,829 | 85 | ---
title: "panel_hyperpol"
author: "Franz Xaver Mittermaier"
date: "2024-04-05"
output: html_document
---
This script creates the graphs for the figure that deals with isolated hyperpolarizations (i.e. without preceeding depolarizations).
```{r, message=FALSE, warning=FALSE}
#load libraries:
library(tidyv... |
644f97f10b4966d628aa3bb485f9c5e82b47df80c00bd97b096b660196948aa1 | R | 2,832 | 80 | ##### SRMR2 - analyses on relationships along the neuraxis #####
# TS, 08/2022
# packages
library(R.matlab)
library(lme4)
library(lmerTest)
#### Import and prepare single-trial data (alternating stimulation conditions) ####
# path names
datapath <- '/data/pt_02068/analysis/tilman/'
savepath_figures <- '/data/pt_02... |
dc85f74deddfc0ec2ebd2c4b1f2616e3ee4dd32fdbd01de0b4cea969b60bb716 | R | 2,835 | 73 | #' Update plot data for monophyletic nodes (HELPER)
#'
#' This function updates the plot data for monophyletic nodes in a tree plot.
#' It filters the tree plot data to get only nodes,
#' finds the monophyletic groups for each node,
#' checks if the groups are monophyletic with and without bootstrap support above a giv... |
a79c0132ca79fde78ccb7e8f3993142f2ddde2a41f4e4168a84a934409457b76 | R | 2,842 | 78 |
library(data.table)
library(tidyverse)
### Figure 3 A ###
# AGE
#net_cols <- c("#0072B2", "#009E73", "#D55E00", "#56B4E9", "#E69F00", "#F0E442", "#CC79A7")
net_cols <- c("#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7")
plt_out = '/data/project/ukb_reliability_in_prediction/plots/Figures... |
5a4ab0a7942394e6895b5f1663fe12ea7a32a2c5274dfa4d5f3ce7fab88e80a7 | R | 2,855 | 69 | ---
title: "Optic Nerve Pre-Processing and Analysis Sequential Knit"
author: "Katie Emberley"
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
highlight: pyg... |
80dfa2a53a2010dc74869a84d4c018a490ccdf14a7a6775577e1e9ef48975150 | R | 2,876 | 66 | suppressPackageStartupMessages({
library(readxl)
library(tidyverse)
library(openxlsx)
library(biomaRt)
})
### see https://www.biostars.org/p/256949/ for rMATS headers explainations ####
### read in JCEC reads that span splicing junctions and reads on target (striped regions on home page figure) ####... |
00dbb906a7cd76f181c519d9a2578c76e6950c6a1050303210e727a4da69985d | R | 2,880 | 100 | # FNIH Project 2
# make ROC plots
#### Coded: Kellen Petersen
#### Date as of commenting and documentation - 05/28/2024
# Load libraries
library(tidyverse)
library(data.table)
library(RVAideMemoire)
library(pROC)
library(RColorBrewer)
library(MuMIn)
library(here)
library(cowplot)
library(ggeasy)
library(showtext)
libr... |
e5fe578d41dbed13cccafe1a6bff463fd422f149880cd6e4bf0261ed026b5a99 | R | 2,881 | 102 | ### ---------------------------------------------------------------------------
#' @rdname write_txt
#' @aliases write_txt_wide
#'
#' @concept io
#' @concept write to file
#'
#' @importFrom utils write.table
#' @export
write_txt_wide <- function(object,
file = "",
... |
e7edca20974be1e117c7da013c7a400b09a048cbd0f05724924e13ba754403da | R | 2,890 | 71 | # fine mapping SNP To target gene using ABC (SCZ)
# ABC-MAX
library(dplyr)
library(stringr)
library(reshape2)
library(rtracklayer)
library(ComplexHeatmap)
library(circlize)
library(data.table)
load('/sc/arion/projects/CommonMind/roussp01a/INGELHEIM/atacseq/step3_neuron_width500/files/abc_piso/fine/ABC_summary.Rdata')... |
9e9678c7a6bd2ed092dc5735939926b7b1edb4d48167de4cbaeb522e9a332bfa | R | 2,896 | 68 | # Load and install missing packages
packages = c("optparse")
if (!requireNamespace("optparse", quietly = TRUE)) {
install.packages("optparse")
}
# Parameters definiton
option_list <- list(
make_option(c("--inputPath"), type="character", default = NULL,
help="Data folder"),
make_option(c("--... |
1967705b2b219d13cf8cabb4a58d7f144ab6d1ea98ca99770085ab02f8e2abee | R | 2,904 | 121 | # Auxiliary functions to calculate heterogeneity measures
#
# Package: meta
# Author: Guido Schwarzer <guido.schwarzer@@uniklinik-freiburg.de>
# License: GPL (>= 2)
#
Rb <- function(seTE, seTE.random, tau2, Q, df.Q, level) {
#
# Calculate Rb
# Crippa et al. (2016), Statistics in Medicine, 35 3661-75.
#
... |
fefce1ec123cd8121a89d43cd05a99b8363f163f08e2c578b8c648c34cc9cc4e | R | 2,908 | 128 | ---
title: "DPX-EEG: Compute sample statistics"
author: "José C. García Alanis"
date: "`r Sys.Date()`"
output:
html_document:
theme: lumen
highlight: pygments
css: "styler.css"
---
Created with `r R.version.string`
```{r, setup, include = FALSE}
knitr::opts_chunk$set(class.source = "customCode",
... |
cac3dec83cc94937d3786901267ab11a5c6d5db0c27cd36e5e20fc911df01592 | R | 2,912 | 92 | #'@title DOTNB_pdf
#'@description
#'Calculates the p-value for the probability of significant difference between two negative binomial distributions using the DOTNB probability density function.
#'
#'@param r1 The r parameter for the first distribution
#'@param p1 The p parameter for the first distribution
#'@param r2 ... |
d49aae10180545f419ef293172b5a2f5bf191fc60a94b79b964cacee95c18f17 | R | 2,912 | 73 | #' NIDP summary plot of NeuroimaGene object
#'
#' Generate overview plot of the neuroimagene object according to nidps
#' @param ng_obj NeuroimaGene Object
#' @param maxNidps maximum number of NIDPs to visualize. default=30
#' @param title optional title tag for the plot
#' @param shortnames optional boolean tag for si... |
fa6febe0df44926ff382b56ebf70996642223fa029f16704958f73c4fe1374ee | R | 2,919 | 70 | ---
title: "LAVA TUTORIAL"
author: "Josefin Werme, CTG Lab, VU Amsterdam"
date: "`r Sys.Date()`"
output: rmarkdown::github_document
vignette: >
%\VignetteIndexEntry{tutorial}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
## Obtaining sample overlap from LDSC
To correct for potential sample ov... |
e459d935af7193c32f49cf8e96f5d7b6765d36464a514cff6bd46413b2b4a258 | R | 2,922 | 68 | library(dplyr)
twas_results = read.csv("/data/clusterfs/lag/users/gokala/beat-dyslexiaevol/results/TWAS/twas_all_results.csv", header = T)
twas_results$pvalue = as.numeric(twas_results$pvalue)
twas_results = na.omit(twas_results)
nrow(twas_results)
# 193,541 gene-tissue pairs to be removed
length(unique(twas_results... |
fc077f860a5f1c349b154f76503ac65e796c3ad9cea8a2e52ac6d674ed32cc16 | R | 2,931 | 102 | #' @name DEPRECATED-read.mat.Cytospec
#' @concept moved to hySpc.read.mat
#'
#' @title (DEPRECATED)
#' Import for Cytospec `mat` 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 \pk... |
1a2414feef9de767255cfed2c9da30dbc6f30254054807121b9884955012dccd | R | 2,932 | 91 | args=as.numeric(commandArgs(TRUE))
#simulation times per gene
n_simulations=100
#n of causal genes
n_causal_genes=100
#sample size
n_samples=c(1000,5000,10000,25000,50000,100000,250000,500000)[args]
#heritability for all the causal genes
h2_all_gene=0.5
#generate true expression
set.seed(2020)
true_exp_m... |
e134241145faecf1283a34c3456860991bf5b759b163ee750f830dba958cb3f9 | R | 2,939 | 85 | # Simulate ERP in Np participants, then estimate onsets using cluster sum.
# Function used in onsetsim_eeg_group_comp.Rmd
sim_eeg_group_onset <- function(ronset, Nt, Np, ...){
out <- vector(mode = "numeric", length = Np)
cond1 <- matrix(0, nrow = Nt, ncol = Nf)
cond2 <- matrix(0, nrow = Nt, ncol = Nf)
... |
7d637c36e92e4cefd52ac817c28aa02abdc02d61f4b055b6f4368066e1934d29 | R | 2,940 | 64 | counts <- Matrix::readMM("Data/raw_data/simulations/unpaired_scenario/pbmc/counts.umi.txt")
cells <- as.vector(read.table("Data/raw_data/simulations/unpaired_scenario/pbmc/cells.umi.new.txt")$V1)
genes <- as.vector(read.table("Data/raw_data/simulations/unpaired_scenario/pbmc/genes.umi.txt")$V1)
genes <- as.vector(sappl... |
fe178272c009987dc35348bbd8f8f89cccdba4672a45442e25cb38277b4aa28e | R | 2,940 | 79 | # new shap data processing....
# processing one single shapley matrix and try to identify any spots above 0.95 criteria.
args <- commandArgs(trailingOnly = TRUE)
if(length(args)!=2){
print("Usage: Rscript *.R <full path to input shapley matrix folder> <sample name>")
quit()
}else{
# default threshold 0.95
libra... |
12fc047e6a5e8fbc7f7337786039cc73d3bb272036702208ca4ae240de6393b8 | R | 2,942 | 65 | plotMultiReadCorr <- function(OldSegDat, NewSegDat, SigDat){
for(regId in unique(OldSegDat$Region)){
rOldSegDat <- OldSegDat[OldSegDat$Region == regId,]
rNewSegDat <- NewSegDat[NewSegDat$Region == regId,]
rSigDat <- SigDat[SigDat$Region == regId,]
regCenter <- median(SigDat$Position... |
f863d36dbf7e126692497223e861f19039e963b80d91c0ed2f2676f83c92d1ff | R | 2,943 | 70 | #' generate_type1_data
#'
#' This function generates data and plots for selected clusters.
#'
#' @param meta_data_file Path to the metadata file.
#' @param gene_count_file Path to the gene count file.
#' @param selected_clusters A named vector specifying the clusters to include.
#' @param prefix Prefix for the output C... |
2883cb8d4793786c6c2b98e3a276945365768265c18a8ef61fcdd5e82d0040b6 | R | 2,949 | 113 | #' @rdname spc-loess
#'
#' @title LOESS smoothing interpolation for spectra
#'
#' @description
#' Spectra smoothing and interpolation on a new wavelength axis using
#' [stats::loess()].
#'
#' @details
#' Applying [stats::loess()] to each of the spectra, an interpolation onto a new
#' wavelength axis is performed. At th... |
99963231a3243f29b21a50005a1eed4fc5694bc13c949a85f278a387ee112c38 | R | 2,951 | 120 | #' Highlights and test the time-course of effects through bayes factors
#'
#' This function performs general bayesian tests through
#' 'BayesFactor::generalTestBF()'.
#'
#'
#' @param data A data.frame containing all the necessary variables.
#' @param formula A 'lme4'-style formula, passed as a string.
#' @param time ... |
7613d65ebf33568991db0a522da34c69c20d10a5f45913ad22a8b1a9382dd59a | R | 2,955 | 71 | # Load libraries
library(dplyr)
library(tidyr)
library(stringr)
library(mclust)
library(ggplot2)
library(gridExtra)
# Function
TopScoringGenes <- function(gene_spectra_score = gene_spectra_score, rank = rank, output_dir = output_dir, file_prefix = file_prefix){
GS <- read.table(gene_spectra_score,sep="\t", ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.