sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
b7e746d98efb3dc402b9a16cbb9953ed84dffbe308cb327a84465c3c41218375 | R | 3,423 | 87 | #' Jiayi rewrite Jun 2024
#' CreateVCF
#'
#'
#' Create the VCF (Variant Call Format) file
#' @param bamdir The Path of to the BAM Directory
#' @param Genome_Fa Path for whole genome FASTQ file
#' @param DIR_Genome_DICT
#' @param Picard_Path Path to the Picard directory, with all the JAR files
#' @param CMD_gatk
#' @par... |
6a70b47a34911bfc5c43d1bfa3b6e447a4e6e54449a1ff40097a07b15f1ee897 | R | 3,424 | 68 | plotSingleRun <- function(sigDat, quantDat, boxDat, eventDat,
baseDat, TitleDat){
## fix 0 baased coordinates passed in
sigDat$Position <- sigDat$Position + 1
quantDat$Position <- quantDat$Position + 1
boxDat$Position <- boxDat$Position + 1
eventDat$Position <- eventDat$Pos... |
96a09c81736e6119c1fd666a687ebd2aa2b9781339449feecd3da40aab4adb2b | R | 3,424 | 169 | #' Cochrane review: detailed summary of meta-analyses
#'
#' @description
#' Calculate and print a detailed summary of all meta-analyses in a
#' Cochrane review.
#'
#' @aliases summary.rm5 summary.cdir
#'
#' @param object An object of class \code{rm5} or \code{cdir}.
#' @param x An object of class \code{summary.rm5}... |
0e185f6530965f7989ca3d8f40c9a6b65e29946157f3ee37d231f63f44a565ce | R | 3,428 | 84 |
library(dplyr)
library(snow)
library(ggplot2)
library(ComplexHeatmap)
library(RColorBrewer)
library(ggrepel)
library(ggrastr)
library(viridis)
library(enrichR)
library(future)
########################################
###Volcano plot DE genes each cluster###
ident.de <- function(i) {
x <- gsub(".csv... |
d19301d093f94a198f0b66ae91a5cd8af6aa4527ef2204a2e4d75394a467275f | R | 3,441 | 94 | ---
title: "CPASSOC_SHom"
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)
source("/home/gokala/programs/CPASSOC/FunctionSet.R")
library(data.table)
library(plyr)
library(qqman)
``... |
b62b634fcd353025ccccc198fcca5e53d1ff2da2b521f90ce38fd6204207192d | R | 3,446 | 83 | # fine mapping SNP To target gene using ABC (BIP)
# ABC-MAX
library(dplyr)
library(stringr)
library(reshape2)
library(rtracklayer)
library(ComplexHeatmap)
library(circlize)
library(data.table)
setwd('~/PF_25BR/data/')
load('/sc/arion/projects/CommonMind/roussp01a/INGELHEIM/atacseq/step3_neuron_width500/files/abc_pis... |
27609e9d82cdc770d9c4daebae6c7a4c05b3f68bfc22bcd1be69d5d4042a3352 | R | 3,452 | 118 | # Load libraries
library(scater)
library(Seurat)
library(tidyverse)
library(cowplot)
library(Matrix.utils)
library(edgeR)
library(dplyr)
library(magrittr)
library(Matrix)
library(purrr)
library(reshape2)
library(S4Vectors)
library(tibble)
library(SingleCellExperiment)
library(pheatmap)
library(apeglm)
library(png)
libr... |
bbe47a4173e1f48c38be95f35e387d8693c1db40d22142633249d7fc957f7fea | R | 3,452 | 93 | # Get command line arguments
args = commandArgs(trailingOnly=TRUE)
file=args[1]
sample_name=args[2]
fmt=args[3]
outdir=args[4]
# Load necessary libraries
library(tidyverse)
library(ggthemes)
library(svglite)
log_message <- function(message) {
cat(sprintf("[%s %s\n]", Sys.time(), message))
}
save_plot <- function(p... |
d30af5e2cd24231713e2a6d39ff14a0e9a873235a131d4d16a68ca969be34ad3 | R | 3,454 | 84 |
library(dplyr)
library(snow)
library(ggplot2)
library(ComplexHeatmap)
library(RColorBrewer)
library(ggrepel)
library(ggrastr)
library(viridis)
library(enrichR)
library(future)
########################################
###Volcano plot DE genes each cluster###
ident.de <- function(i) {
x <- gsub(".csv... |
a3d3601cbf56e2eb51c61e249b28ac8b10dcb5df60fb0aa7a085dc801e109871 | R | 3,459 | 82 | library(liger)
library(Seurat)
library("plyr")
library(reticulate)
np <- import("numpy")
Args<-commandArgs()
PATHDIR = Args[6]
RNAfile = paste0(Args[6],'scRNA_count.txt')
rna = read.csv(RNAfile,sep = '\t',header = TRUE,row.names = 1,quote = "")
spatial_origal = as.data.frame(t(read.csv(paste0(Args[6],'Insitu_count.txt... |
5e5bc2aafb38b8c70c9f7aa39e4b373533f679ac5e3505fe50cd1513cf6acfba | R | 3,463 | 78 | ### EMD to measure KO screen effects - whether each guide has similar effects on changing transcriptome?
### code adopted from https://github.com/yanwu2014/teratoma-analysis-code/blob/fd1be4e669027236e20a7d85e1cccf4d9a0743d2/Figure4/03_disease_screen_cluster_enrich.R
library(perturbLM)
library(swne)
# one command from... |
6c833fff361be58a7d47a54dbc5c3d317131c5d2d5f2951f62c812c7eb78c7bf | R | 3,468 | 89 | #' @title Iteractive clustering
#' @description Iterative clustering algorithm for single cell RNAseq dataset.
#' @param norm.dat data input
#' @param select.cells data ref
#' @param prefix meta input
#' @param k.nn meta input
#' @param max.dim meta input
#' @param split.size meta input
#' @param result meta i... |
2e0e9f56903c597c2562c99afc229b0f0d104f49569da2f23ef18a8acdc23e27 | R | 3,469 | 100 |
###Script 1
#pre-process and QC individual libraries
library(SoupX)
library(Seurat)
library(sctransform)
library(dplyr)
library(HGNChelper)
library(DoubletFinder)
parallel::mclapply
timestamp()
fls <- c("filepath/neuM02_count_res/outs/",
"filepath/neuM03_count_res/outs/",
"filepath... |
13c6e296584c7268e7e1a6627d5387ba992797a21ea2afe84501f16637e5013b | R | 3,471 | 64 | library(dplyr)
library(tidyr)
library(stringr)
library(Seurat)
# 1. Data normalizeation and calculation of admixture
GBM.data <- Read10X_h5("filtered_feature_bc_matrix.h5")
# Initialize the Seurat object with the raw (non-normalized data).
GBM_xeno <- CreateSeuratObject(counts = GBM.data, project = "GBM_xenografts", ... |
d80ef098606afe39cfdd54c38dceb03e6161e5249e3e8c239a8f290f5bbc1aa5 | R | 3,479 | 152 |
clean_island= function(vector, island_size){
#reshape
grid= embed(vector, island_size+2)
#first and last column must be NA
ss1= is.na(grid[,1]) & is.na(grid[,island_size+2])
#sum of middle columns must NOT be NA
if(island_size==1){
ss2= !is.na(grid[,2])
} else {
mc= 2:(island_size+1)
s... |
7528f6a1e3d36f6b55cd68b18d8c669625808d2065ccd09f4394c9534470832f | R | 3,486 | 132 | ---
title: "Cell type annotation"
output:
html_document:
df_print: paged
---
Libraries
```{r Librairies}
library(tidyverse)
library(dplyr)
library(clustree)
library(patchwork)
library(Seurat, lib.loc = "/opt/rstudio-server_conda/conda/envs/rstudio-server_4.1.0/lib/R/library/")
```
Import objects
```{r Objects}... |
501d12b9d0be6acb1cd5b801750fbe31dbee9769a2793925dab056f8879c3f07 | R | 3,496 | 125 | #' @name DEPRECATED-spc.loess
#' @concept deprecated
#'
#' @title (DEPRECATED)
#' LOESS smoothing interpolation for spectra
#'
#' @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 re... |
76b7f5f9ea454375a1a6d233211089ca4dff5e932e61b38e7cb81d9492aa9814 | R | 3,498 | 119 | # --------------------------------
# Load libraries and data
# --------------------------------
library(rstudioapi)
library(yaml)
library(readr)
library(lme4)
library(lmerTest)
# Set working directory to script location
setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
# Load configuration
config <- read_ya... |
e5d14173aedbf21853bb076497b408c20e1554c866760c8f72d519116bc55216 | R | 3,502 | 122 | ---
title: "Comparison_ClusteringAlgorithms"
author: "Fabienne Rössler"
date: '2023-02-15'
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
Required libraries:
```{r, message=FALSE, warning = FALSE}
source("DLCAnalyzer_Functions_v4.R")
source("UnsupervisedAn... |
6417c9772b267a5146a38305dc84b06fb0a881dec18bb030fe64be80529c2e9b | R | 3,506 | 104 | # Get command line arguments
args = commandArgs(trailingOnly=TRUE)
file=args[1]
sample_name=args[2]
kegg=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.time(), me... |
a6b39cbd6bfd5db1903d999c4a1b34e6b24ec60403f55210f9c437883d92b72d | R | 3,514 | 91 | test_that("metareg examples run", {
data(Fleiss1993cont)
Fleiss1993cont$age <- c(55, 65, 55, 65, 55)
Fleiss1993cont$region <- c("Europe", "Europe", "Asia", "Asia", "Europe")
ma1 <- metacont(n.psyc, mean.psyc, sd.psyc, n.cont, mean.cont, sd.cont,
data = Fleiss1993cont, sm = "SMD")
ma... |
cc349e40354518a9b8b87951f7e86f963ea5e6d425f666528ee5008d89c520d5 | R | 3,516 | 60 | args <- commandArgs(trailingOnly = T)
filenamex=as.character(args[[1]])
include_files <- c("dMDA_101_5Mb_t2t", "Pico_101_250kb_t2t", "Pico_76_250kb_t2t", "PTA_101_500kb_t2t", "PTA_48_500kb_t2t")
if ((filenamex %in% include_files)){
turan_CNV1_svd= readRDS(file.path('./data/processed/rds', paste0('CNV1_', filenamex,'.r... |
5cbcd135ce26a9bb0c26e6174530dd68e56548b374eb61bf5c6bb4273b6d1c38 | R | 3,536 | 79 | #' generate_type3_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... |
220674e7317bbadcaceb71e61379647f810a55d72afaeab1d04d1fa1f9abb373 | R | 3,540 | 101 | # File: compute_qNet_CI.R
# Author: Kelly Chang
# Date: Oct 2017
# Version: 1.0
#
# Description: R script to compute credible intervals for qNet and plot
# the results for fixed-input and uncertainty-input simulations.
# For help, run this script with command lin... |
54973585d155639238be7bb2ec1e988c7434b718935836e6d8faeb72ec87a5a4 | R | 3,552 | 91 | test_that("RVE methods work in univariate random effects meta-analysis", {
data(Fleiss1993bin)
data(Fleiss1993cont)
data(smoking)
mbin <- metabin(d.asp, n.asp, d.plac, n.plac, study,
data = Fleiss1993bin,
method = "Inverse", method.random.ci = "CR1",
random... |
697aaada030af8591f02cf9572200ebdd675d589418a62ede4e1048b15b6562b | R | 3,557 | 110 | suppressPackageStartupMessages({
library(readxl)
library(tidyverse)
library(openxlsx)
library(tximport)
library(DESeq2)
library(pheatmap)
})
source("script_tximport.R")
meta <- read.xlsx("meta_data.xlsx")
if (!file.exists("dds.filtered.rds")){
dds.raw <- DESeqDataSetFromTximport(txi,
... |
538c584fdc0088dffb396d42cd6cab3633be9fe4376b2de230aafbb5c10befa0 | R | 3,563 | 65 | source('./scripts/01_Setup.R')
all2= readRDS("./data/processed/rds/SignificantCells.rds")
picocells_passing_mad_conf= all2$id
Pico_76 <- readRDS("./data/processed/rds/PTA_48_500kb_lift_SegFixed_cnv_stat_genome.rds")
Pico_76x= Pico_76[Pico_76$id%in%picocells_passing_mad_conf,]
Pico_76x= Pico_76x[!Pico_76x$chr%in%c('chr... |
47cb87c279aa5dd42ce7ffc600c4a6c41ee75b247cded9611d05ca5e3bb3d985 | R | 3,567 | 161 | library(tidyverse)
library(janitor)
`%nin%` = negate(`%in%`)
setwd('~/Dropbox/Research/UCSF/ABA')
# NACC
## Import datasets
nacc.raw <- read_csv('resources/investigator_nacc58.csv')
## NACC variables of interest
nacc_df_lv <- select(nacc.raw, NACCID, NACCADC, VISITYR, PACKET, NACCVNUM,
NACCAGE,
... |
7131ebe93297d6dc936257e9657ed76238bc603f4b9544af351e933f74f388fe | R | 3,568 | 85 | #Set the variables
path = "/m/cs/scratch/networks-pm/effects_externalfactors_on_functionalconnectivity/data/mri/conn_matrix/pvt"
beh_path = "/m/cs/scratch/networks-pm/effects_externalfactors_on_functionalconnectivity/data/"
save_path = "/m/cs/scratch/networks-pm/effects_externalfactors_on_functionalconnectivity/results... |
3613785233621a8ec39a427dc7bfb8af06f3b5e6f7d894e869db5a7585f1992a | R | 3,571 | 75 | #' @title DTSERIESvextract
#'
#' @description Extracts vertex-wise surface-based CIFTI dense time-series data from an individual dtseries .nii file from HCP, fMRIprep or XCP-D preprocessed directories, and stores it as a single .RDS file.
#' @details The function extracts the data from the dtseries.nii file provided, a... |
df497f9cf1d04590c84702ff91e99859a63e0ebfd5b26187f4041d7825d5e742 | R | 3,579 | 87 | #' data wrangling for phylogenetic annotations with ggtree::geom_facet
#'
#' @description
#' Returns a dataframe for phylogenetic annotations with ggtree::geom_facet
#' with options geom_bar, for a categorical variable that is stored in a
#' nested table. For nested contingency tables and usage with geom_text and ... |
7486aa9b0ffed57d1b60ffc36fe9bb249ca2fe62f2f34a253215d5a6f203ed01 | R | 3,585 | 110 | # loads needed libraries
library(tidyverse)
library(data.table)
library(Seurat)
library(WGCNA)
set.seed(1234)
args = commandArgs(trailingOnly = TRUE)
sample_path = args[1]
model_path = args[2]
pred_path = args[3]
threads = as.numeric(args[4])
# get path for other output
out_path = dirname(pred_path)
#--------------... |
f8f4a447b012311cc24ffcc6be52ac8f50e8ea85671d6ff158fb9ddcde414831 | R | 3,589 | 87 | #Set the variables
path = "/m/cs/scratch/networks-pm/effects_externalfactors_on_functionalconnectivity/data/mri/conn_matrix/pvt"
beh_path = "/m/cs/scratch/networks-pm/effects_externalfactors_on_functionalconnectivity/data/"
save_path = "/m/cs/scratch/networks-pm/effects_externalfactors_on_functionalconnectivity/results... |
7832b5017b2bd65b10ba56cc1f30ccd953ae03e553bf6ee539ba4d90fb3c1c52 | R | 3,592 | 147 | library(abind)
library(glmnet)
library(caret)
library(waveslim)
library(dplyr)
# Parse command-line arguments manually
args <- commandArgs(trailingOnly = TRUE)
# Initialize default values for arguments
train_observations <- 80
test_observations <- 10
align <- FALSE # Default to false (no alignment)
# Loop through a... |
8a8620d29900152ec70cf03c20a971794e4d6da28652ba39cf88962348919e8f | R | 3,594 | 85 | #Set the variables
path = "/m/cs/scratch/networks-pm/effects_externalfactors_on_functionalconnectivity/data/mri/conn_matrix/nback"
beh_path = "/m/cs/scratch/networks-pm/effects_externalfactors_on_functionalconnectivity/data/"
save_path = "/m/cs/scratch/networks-pm/effects_externalfactors_on_functionalconnectivity/resul... |
c993e0b9457662ad21d4bb142e3a410b0f1cf3072b7471d8cca4f51226c6c6c8 | R | 3,594 | 178 | #' Cochrane review: trim-and-fill method
#'
#' @description
#' Conduct trim-and-fill analysis for all meta-analyses in a Cochrane
#' review.
#'
#' @aliases trimfill.rm5 trimfill.cdir
#'
#' @param x An object of class \code{rm5}, \code{trimfill.rm5},
#' \code{cdir} or \code{trimfill.cdir}.
#' @param comp.no Compar... |
43c257f814863a5656f2de3f0fe01b147ec075767cee33060fa3863ec216e049 | R | 3,595 | 98 | # based on import example of hyperSpec read.txt.wide and FileIO/read.txt.PerkinElmer.R
# you may want to add indices to the hyperSpec obj:
# hyobj@data$indices<-spectral.indices(hyobj)
read.txt.pz2 <- function (
file = stop("filename is required"),
label = list (),
wavelength = NULL,
short... |
421bcbc174af2adbcd79266ffd0791374bc13e7afdf9fe17576bca6b8e627941 | R | 3,598 | 101 | # File: process_boot_results.R
# Author: Kelly Chang
# Date: Oct 2017
# Version: 1.0
#
# Description: R script to do postprocessing of hERG fitting results for
# the 12 CiPA training drugs. This script aggregates
# bootstrapping results, plots the bootstrap distr... |
55aab8919a267cdc98080b90f35274c18f4627c00b896371dcb5ebcd7aa3f551 | R | 3,599 | 87 | #Set the variables
path = "/m/cs/scratch/networks-pm/effects_externalfactors_on_functionalconnectivity/data/mri/conn_matrix/pvt"
beh_path = "/m/cs/scratch/networks-pm/effects_externalfactors_on_functionalconnectivity/data/"
save_path = "/m/cs/scratch/networks-pm/effects_externalfactors_on_functionalconnectivity/results... |
eb0a1158b1dcf682d8ebe1322b0079d7300dec55ba3a4c78f571896b09a0b44e | R | 3,607 | 77 | source('./scripts/01_Setup.R')
all2= readRDS("./data/processed/rds/SignificantCells.rds")
picocells_passing_mad_conf= all2$id
Pico_76 <- readRDS("./data/processed/rds/Pico_76_250kb_lift_SegFixed_cnv_stat_genome.rds")
Pico_76x= Pico_76[Pico_76$id%in%picocells_passing_mad_conf,]
Pico_76x= Pico_76x[!Pico_76x$chr%in%c('c... |
d7222c81c41f806294bcae6b2faf342411b187a264c1f2276ec2f8a329460eaf | R | 3,609 | 123 | #' Calculate absolute and percentage weights for meta-analysis
#'
#' @description
#' This function returns a data frame containing information on
#' absolute and percentage weights of individual studies contributing
#' to common effect and random effects meta-analysis.
#'
#' @param object An object of class \code{met... |
3b1b0fe7b2e949fcbfe46fcb2dc79ba19daf33c82e11ae2583b0726b7b78d864 | R | 3,611 | 114 |
#' Load and attach `hyperSpec` and all installed *R hyperSpec* family (`hySpc.*`) packages
#'
#' This function loads and attaches **hyperSpec** and all installed
#' [*R hyperSpec*](https://r-hyperspec.github.io/) family packages, which
#' share common **`hySpc.`_something_** package name pattern.
#'
#' @param exclude ... |
4ebd6cb86f9790bd323ae9914f8d7b231f296a19fddfd2a2c5ddd4df887d893d | R | 3,612 | 121 | ##----------------------------------------------
## create PCA plot of 1KG and adc NP subjects
##----------------------------------------------
library(data.table)
library(magrittr)
library(ggplot2)
cargs <- commandArgs(trailingOnly = TRUE)
merged_eigenvec_file <- cargs[1]
study <- cargs[2]
study_ids <- fread(paste0(... |
198faf8572c72896764feb3dfa939819118b3f5827da43475e3fd08b57170ee2 | R | 3,615 | 87 | #Set the variables
path = "/m/cs/scratch/networks-pm/effects_externalfactors_on_functionalconnectivity/data/mri/conn_matrix/nback"
beh_path = "/m/cs/scratch/networks-pm/effects_externalfactors_on_functionalconnectivity/data/"
save_path = "/m/cs/scratch/networks-pm/effects_externalfactors_on_functionalconnectivity/resul... |
234cd7a13d2521723d2431298bb87f71df36837afa8e3e96467a0f4cc0d7d833 | R | 3,625 | 87 | #Set the variables
path = "/m/cs/scratch/networks-pm/effects_externalfactors_on_functionalconnectivity/data/mri/conn_matrix/nback"
beh_path = "/m/cs/scratch/networks-pm/effects_externalfactors_on_functionalconnectivity/data/"
save_path = "/m/cs/scratch/networks-pm/effects_externalfactors_on_functionalconnectivity/resul... |
0165475c17d8cee3cef8e0e54dea212496b369ba8cd9ca189f408539a46eb615 | R | 3,627 | 136 | # Set generic ----------------------------------------------------------------
.rmmvnorm <- function(n, mean, sigma) {
if (!requireNamespace("mvtnorm")) {
stop("package 'mvtnorm' needed to generate multivariate normal random data.")
}
.group <- rep.int(seq_along(n), n)
## make indices so that pooled or i... |
b0f3b808ac72acb31aa3f1b85c5bc9579565aa1bb336013c9b32639d0dad891d | R | 3,627 | 94 | ## -----------------------------------------------------------------------------
##
## Somatic variant detection in lesional focal epilepsy
## Variant-level statistics of dNdScv meta-analysis calls versus population
##
## Author: Dr. Christian Bosselmann
##
## Date Created: 2023-09-05
##
## Copyright (c) Christian Boss... |
7cce027e751ed66e51b6e450a3c60f7743d05ddf3c1cb978c9ce43c5eec46188 | R | 3,636 | 89 |
###Script _
#Pseudo Bulk DE analysis
library(Seurat)
library(SingleCellExperiment)
library(scater)
library(MAST)
library(dplyr)
library(future)
library(future.apply)
dt.sct <- readRDS("datasets/5_seurat_neuron_subset.rds")
levels(Idents(dt.sct))
calc_mast_DE <- function(i) {
print(i)
dt.sub <- ... |
c409084a05709eed6dfc2448744a7659404c9f499b1c54d8028e3936161bb9cb | R | 3,638 | 116 | #' Create study labels for forest plot
#'
#' @description
#' Create study labels for forest plot.
#'
#' @details
#' This auxiliary function can be used to create study labels in JAMA
#' or Lancet layout which can be added to a forest plot using argument
#' 'studlab'.
#'
#' @param object An object of class \code{meta... |
45acce9dd5c5a518fcd59f0ccd897611eedc43aa358d5506fc2a462b492f4bb3 | R | 3,640 | 100 |
library(tidyverse)
#net_cols <- c("#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7") # original order
net_cols <- c("#0072B2", "#009E73", "#D55E00", "#56B4E9", "#E69F00", "#F0E442", "#CC79A7") # reordering for 3 colours only
plt_in = '/home/mgell/Work/reliability/input/'
plt_out = '/hom... |
488610e0151b54f00e0741e1d8ae44a822d4af0c1ebb110d7df61151dda24961 | R | 3,654 | 121 | # Plotting settings ==========================================================
# Base plot parameters -------------------------------------------------------
# Note: more knitr settings further down!
knitr::knit_hooks$set(small.mar = function(before, options, envir) {
if (before) {
par(mar = c(4.1, 4.1, 1, .6))... |
0df4c35768f9e86a6b3130f5c59558cc7d2c0c8d9bc43aadd8b968008152ffaa | R | 3,668 | 90 | ---
title: "qscore_analysis"
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(ggplot2)
library(data.table)
```
## Load Genomic SEM output files
```{r loadData}
outDir = ... |
8024145a6cf79f5d12eecd6ab0c77c579c64c5ac2162b90e005bf46962653521 | R | 3,674 | 95 | #' Create stacked effect size plot
#'
#' Note that this is a custom function and will not work in a "universal" way
#' without additional coding.
#'
#' @param x a data.frame object
#' @param group string. From your data frame, specify the variable to be used to group the plots.
#' @param x_axis logical. Defaults to FA... |
dc17dc2d8da076d2d17263a42d453256a152f46090fb97322c79d255509a965f | R | 3,697 | 89 | library(R.matlab)
library(xlsx)
library(car)
library(readxl)
library(zoo)
library(lmPerm)
library(boot)
#set the variables
path = "/m/cs/scratch/networks-pm/effects_externalfactors_on_functionalconnectivity/data/mri/conn_matrix/rs"
result_path <- '/m/cs/scratch/networks-pm/effects_externalfactors_on_functionalconnecti... |
440dc4ea2b5d6bb439e32f70e1c039b6649c2f89344271c61ce1e0fddabe5d95 | R | 3,699 | 103 |
library(tidyverse)
#net_cols <- c("#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7") # original order
net_cols <- c("#0072B2", "#009E73", "#D55E00", "#56B4E9", "#E69F00", "#F0E442", "#CC79A7") # reordering for 3 colours only
plt_in = '/home/mgell/Work/reliability/input/'
plt_out = '/hom... |
f5af1826457548f6abdf7c53f4560addf225ee805091d96f4789f1e5a2e68034 | R | 3,703 | 117 |
# Attempt to recreate table 3.3 from "Elements of statistical learning" 2nd ed
# Written by Jean-Philippe.Vert@mines.org
# Modified by Kevin Murphy (12/2/15)
#http://cbio.ensmp.fr/~jvert/svn/tutorials/practical/linearregression/linearregression.R
####################################
## Prepare data
################... |
791aad8679b79013ed669a4bed9449b8e6dc695112de886ddd5b2d2485061ba8 | R | 3,708 | 123 | library(data.table)
library(ggplot2)
library(ggthemes)
hs <- fread("output/gwas/mega/saige/hs_saig_results.txt")
late <- fread("output/gwas/mega/polmm/late_polmm_results.txt")
bell2022 <-
fread("/data_global/summary_statistics/GCST90027158_buildGRCh38.tsv.gz")
radius <- 2e5L
tmem_lead_snp <- hs[CHR == 7][p.value ==... |
30d97467a4981e7fb61fee2892364fcbb091bd6eba4455a63eed478382670612 | R | 3,709 | 98 | # Dependencies ------------------------------------------------------------
packagesCRAN <- c("remotes", "hdf5r", "glue", "R.utils", "Seurat", "parallel",
"tidyverse", "BiocManager")
package.check <- lapply(
packages,
FUN = function(x) {
if (!require(x, character.only = TRUE)) {
... |
bcc1b08f5cd89170d6ad509e97f7ec336c25bed875714548e5ad74d546466766 | R | 3,720 | 81 | # We have published the information of the union peak set on https://ngdc.cncb.ac.cn/ (BioProject ID is PRJCA015229), and it can be directly accessed.
# Step1: liftOver Macaque Peaks (rheMac10) into hg38
system("liftOver ../Macaque_ATAC/Peak_df/ArchR/Count_Peaks.bed rheMac10ToHg38.over.chain.gz Macaque_Peaks_hg38.bed ... |
b74ce91fd818857e2e1b2348c30b4ee69eec5fe54e6ab54dc2161ffa065b752f | R | 3,723 | 92 | library(dplyr)
library(tidyr)
library(treeio)
library(ggtree)
library(readxl)
library(photobiology)
library(ggplot2)
library(ggnewscale)
library(castor)
library(ape)
with(snakemake@input, {
tree_file <<- tree
metadata_file <<- metadata
})
output_file <- unlist(snakemake@output)
to_treedata <- function(tree) ... |
0aefbda09b1cd78df8ce3dd4b57efd07fd12df9a9b471c454eb00418817c9293 | R | 3,729 | 141 | ---
title: "Figure5_transfer_RocheData"
author: "Fabienne Rössler"
date: '2023-06-08'
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r, message=FALSE, warning = FALSE}
source("../DLCAnalyzer_Functions_v4.R")
source("../UnsupervisedAnalysis_Functions.R")
... |
e2fb6dad11f15f7bafb13b46cc16e80800b1e5e33e92a838859f4eac0cab76e1 | R | 3,735 | 106 | # Attempt to recreate table 3.3 from "Elements of statistical learning" 2nd ed
# Written by Engin Alper
# Modified by Kevin Murphy (12/2/15)
# Info on data is here: http://statweb.stanford.edu/~tibs/ElemStatLearn/datasets/prostate.info.txt
suppressPackageStartupMessages({
library(cvTools)
library(glmnet)
librar... |
26e51d386919699a10bc0849b7d54d1bb81b275c67e8631d5032e8946aa5fbe0 | R | 3,736 | 133 | # Function -------------------------------------------------------------------
.math2 <- function(x, digits) {
validObject(x)
x[[]] <- callGeneric(x[[]], digits)
x
}
#' Mathematical functions for `hyperSpec` objects
#'
#' The functions `abs()`, `sign()`, `sqrt()`, `floor()`, `ceiling()`, `trunc()`,
#' `round(... |
26e02389b4495a86d267dffae54345286b6b7e169eb7a6bb2356af4e8ef271c3 | R | 3,739 | 104 |
library(tidyverse)
#net_cols <- c("#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7") # original order
net_cols <- c("#0072B2", "#009E73", "#D55E00", "#56B4E9", "#E69F00", "#F0E442", "#CC79A7") # reordering for 3 colours only
plt_in = '/home/mgell/Work/reliability/input/'
plt_out = '/hom... |
fe869105e6fdea18da129de146710f5167f12e531d07d5696627a5078beb5388 | R | 3,746 | 105 |
library(tidyverse)
#net_cols <- c("#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7") # original order
net_cols <- c("#0072B2", "#009E73", "#D55E00", "#56B4E9", "#E69F00", "#F0E442", "#CC79A7") # reordering for 3 colours only
plt_in = '/home/mgell/Work/reliability/input/'
plt_out = '/hom... |
02279f8d27b3ad9e2be0cabc8aaad9bc121c158bf9e2c3a7c5581909442d1317 | R | 3,748 | 142 |
#' Sequence generation along spectra or wavelengths
#'
#' This function generates sequences along the spectra (rows) or wavelengths of
#' `hyperSpec` objects.
#'
#' Note that [wl2i()] generates sequences of indices along the wavelength axis.
#'
#' [seq()] had to be implemented as S3 method as the generic has only \dot... |
eb982d50d7ddea933e5ba0834ffde496b3f96cd8689599277734c0da368573dd | R | 3,748 | 92 | library(WGCNA)
load("BrainGVEx_human_brain_AdjustCombatandCovariants.rdata")
load("../tpmoverlapgenes.rdata")
datExpr <- AA_datExpr[genes,]
# Choose a set of soft-thresholding powers
powers = c(c(1:30), seq(from = 20, to=40, by=2))
# Call the network topology analysis function
sft = pickSoftThreshold(t(datExpr), pow... |
1eb4472299f86d5b8a13ff8747a70c9d3803a21240c60902fb98aa2dc69af8eb | R | 3,750 | 92 | test_that("transf handles Freeman-Tukey transformed incidence rates", {
rate <- c(0.1, 0.2, 0.3)
time <- c(10, 20, 30)
expected <- 0.5 * (sqrt(rate) + sqrt(rate + 1 / time))
expect_equal(ir2ft(rate, time), expected)
expect_equal(transf(rate, "IRFT", time = time), expected)
expect_equal(transf(rate, "IRFT... |
3f9f640b036b674e4e105f324f82c48f648f582c51836ab8edf2b380f368cbc4 | R | 3,754 | 80 | ---
title: "Causal Balancing"
author: "Eric W. Bridgeford"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{cb.balancing}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#... |
b6635c6ef4903e1ede390f12e9c09676b997f99bba6038d077186d133fb03002 | R | 3,763 | 117 |
library(tidyverse)
library(ggExtra)
format_cor <- function(test) {
p_value <- format(test$p.value, digits = 2, scientific = TRUE)
conf_low <- round(test$conf.int[1], 2)
conf_high <- round(test$conf.int[2], 2)
result <- sprintf("r(%d) = %.2f, p = %s, 95%% CI [%.2f, %.2f]",
test$param... |
e0a9414b2e6351f2f2aa6086259a3884302e083affb0a71fa0615db8885bca34 | R | 3,768 | 110 | #=============================
# create manhattan plot
#=============================
plot_manhattan <- function(results,
thin=TRUE,
annotate_snps=FALSE,
annotate_labels=FALSE,
highlight=FALSE,
... |
02663af57001b656822e398ac570c9d490a537d090ed31ebe39f6389c68857eb | R | 3,775 | 60 | args <- commandArgs(trailingOnly = T)
filenamex=as.character(args[[1]])
exclude_files <- c("dMDA_101_5Mb_t2t", "Pico_101_250kb_t2t", "Pico_76_250kb_t2t", "PTA_101_500kb_t2t", "PTA_48_500kb_t2t",
'Pico_76_250kb_t2t_q1','Pico_76_250kb_t2t_q10','Pico_101_250kb_t2t_q1','Pico_101_250kb_t2t_q10',
... |
335c6546f058a7d1ce7357a9a8db51420a714e7ba8e7944f5de3a8e9b680e2cb | R | 3,779 | 135 | # Set generic ----------------------------------------------------------------
#' @importFrom lattice latticeParseFormula
setGeneric("levelplot", package = "lattice")
###--------------------------------------------------------------------------~
### levelplot.R - everything that has to do with levelplot-like plottin... |
5f2f050bdfe062926042abbb2925ef811e01b524fec2c88f33e25367b40c0746 | R | 3,779 | 77 | #Trial with harmonisation
#July 2024
library(sva)
library(tidyverse)
library(psych)
#prepare a smaller dataset
data_combat <- retest_Boney%>%dplyr::select(OASISID, sROI_bonecortex03, sROI_bonethickness03,
sROI_headthickness03, tis_head, tismri_volr01, res1)
dat1 <- data_... |
d575794b5c20df40ee13a6093ad2ec546535071107ac03aa6b6eff729ed4f312 | R | 3,785 | 117 |
library(tidyverse)
library(ggExtra)
format_cor <- function(test) {
p_value <- format(test$p.value, digits = 2, scientific = TRUE)
conf_low <- round(test$conf.int[1], 2)
conf_high <- round(test$conf.int[2], 2)
result <- sprintf("r(%d) = %.2f, p = %s, 95%% CI [%.2f, %.2f]",
test$param... |
a6be38cdf297915e36e4eeae20a78ac123d97a62dea6d371cd43fd4a71f8bc8c | R | 3,799 | 124 | read_one= function(ID,
path= getwd(),
start_filename= "subject-",
append_TOBII= "_TOBII_output.tsv",
skip= 7,
separate_behavioral= TRUE){
#get likely adresses
tobii= paste0(path, "\\", start_filename, ID, append_TOBII)
... |
7080fd227cf7b871af0b99ce8280ff91a8fe4ef4e93def6cbc0b3a6185544c9b | R | 3,810 | 105 | bind_SE_with_NA <- function(platforms, sample_id){
# Set the column names of each platform to the universal sample identifier
platforms <- lapply(platforms, function(i) {
colnames(i)<-colData(i)[[sample_id]]
i}
)
# Bind the assay data, order
full_assay <- lapply(platforms, function(i) data.frame... |
e5c226e547ce9a4709ce880018dfefd503ea1fb1d147ca7c3b950dcdb14942d7 | R | 3,818 | 102 | ---
title: "CRS1_LDB_Analysis"
author: "Lukas von Ziegler"
date: '2024-01-26'
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r, message=FALSE, warning = FALSE}
source("DLCAnalyzer.R")
source("BFA_BFF.R")
library(sp) #tested with v1.3-2
library... |
e329e9e5ff82d0ad0aa55f3ddfea7b859887b87700d0237836de99b52262d4d7 | R | 3,826 | 105 | ## -----------------------------------------------------------------------------
##
## Somatic variant detection in lesional focal epilepsy
## This script is used to support therapeutic actionability of the targets
## in this study by their number of ongoing trials and drug assocations
##
## Author: Dr. Christian Bosse... |
d74767ac6e0818ca4ac1a3dfadfb4ee52923fb8ab351fa2883cdc589a0861bc9 | R | 3,832 | 89 | #' Atlas parcellations of fsaverage5
#'
#' A list containing two data frames, 1) listing fsaverage5 vertices and each parcellation number they correspond to, and 2) listing each available atlas and their corresponding labels (1=aparc, 2=Destrieux-148, 3=Glasser-360, 4=Schaefer-100, 5=Schaefer-200, 6=Schaefer-400).
#'
... |
ba3531dd00a62cf1f9d85f5c664271628802552c8e8bfd8155a5638aef648601 | R | 3,838 | 148 | library(abind)
library(glmnet)
library(caret)
library(waveslim)
library(dplyr)
# Parse command-line arguments manually
args <- commandArgs(trailingOnly = TRUE)
# Initialize default values for arguments
train_observations <- 80
test_observations <- 10
align <- FALSE # Default to false (no alignment)
# Loop through a... |
afab843a64fe474faf994103b42fb2f923fc48b76d452a444fb3b36648e73710 | R | 3,839 | 81 | # --------------------------------------------------------------------------------- #
# #
# Hippocampal volumes in UK Biobank are associated with APOE only in older adults #
# ... |
f20031587b6b00e474d3156ef28e3c024400e0db93a7810ee247e25377793d07 | R | 3,847 | 95 |
###Script 17
#MAST DE analysis
library(Seurat)
library(SingleCellExperiment)
library(scater)
library(MAST)
library(dplyr)
library(future)
library(future.apply)
###Pseudo-bulk DE analysis
#Get pseudo-bulk expression data
dt.raw <- readRDS("output/atlas/non_integrated_neuronal_atlas.rds")
dt.sct <- rea... |
6db520885429e3413d0486e62094b98c8368e71352bc9ad843704d30167d6fdc | R | 3,856 | 106 | #### Initialize ----
# zap()
# load libraries
library(maplet)
library(tidyverse)
library(magrittr)
library(dplyr)
source(codes.makepath("autofocus/Backend_Modules.R"))
source(codes.makepath("autofocus/initialize.R"))
#source(codes.makepath("autofocus/ModuleTesting.R"))
####ADNI####
get_adni_R<- function(){
# Lo... |
c228b1b8a556b7b0c4acbb764a52e4ff4717ffc1a6a449d54b52082293649196 | R | 3,862 | 83 | # set thresholds for plotting tile
pointMaxReads <- 40
pointMaxBases <- 200
textLim <- 150
plotPerReadStats <- function(StatData, OrdData, baseDat, boxCenter, arePvals){
all_reg_ids <- unique(StatData$Region)
last_reg_id <- tail(all_reg_ids, 1)
for(reg_i in all_reg_ids){
regDat <- StatData[StatData... |
aa008026b411fe836652b20600897d23a7b24768ffeec6c5bd9d29243e59d4bb | R | 3,865 | 106 | #===============================================
# Create list of duplicates to remove
#===============================================
library(data.table)
library(magrittr)
library(stringi)
related <- fread("tmp/adc_dup.con")
setnames(related, c("ID1", "ID2"), c("IID1", "IID2"))
related[, PI_HAT := (2 * N_IBS2 + N_I... |
328777c2d4002386cadbcd2e4794cd833394f61b5d798dc6f4c0412f73d32d27 | R | 3,873 | 85 | #######################################################
### Deep Brain Stimulation: STN vs GPi.
### Models
### 2023 Katrin Petermann
#######################################################
#######################################################
### Risk Factor Model
###################################################... |
f3b32f7d6515e835438110c72c02ce727b96eafa42e6fe71c937d9239eac8ae9 | R | 3,875 | 107 | library(Seurat)
library(openxlsx)
library(SingleCellExperiment)
library(tidyverse)
library(Matrix)
library(scales)
library(cowplot)
library(RCurl)
library(pryr)
library(RColorBrewer)
library(dplyr)
library(textclean)
seu <- readRDS("directory/Annotated_seu_obj.rds")
MTG <- as.character(seu$MTG_annotation_log_normalis... |
fc7dfecb8240aa6b2209104f87643aa2663388eb7b86698aec5cd4d3a436e991 | R | 3,880 | 109 | #######Calculation of module preservation
load("../ChineseHumanBrain/Chinese-Signed-networkConstruction-auto.RData")
load("../BrainGVEx/Caucasian-Unsigned-networkConstruction-auto.RData")
load("../overlapgenes.rdata")
load("AA-Unsigned-networkConstruction-auto.RData")
color <- moduleColors
#colorGVX <- GVXinformatio$mo... |
31bc88c533bf50747737f351bb8887e4b61b6dab46c639742659df0f1b1ed7d6 | R | 3,884 | 107 | #load 3 matrices.
library(Matrix)
library(MatrixExtra)
library(tidyverse)
setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
#they don't have dim names, so we need to attach the cells and genes in proper order for each
#before continuing.
sathy <- readMM("../raw_data_full/sathyamurthy/matrix_sathy... |
0fe0d8ba1cbc98c3e6cd01d1f3660b78b016a424a6f7677a3f5bf99029b36a7d | R | 3,885 | 92 | ##' An improved version for RRHO, which aims to correct the intepretation for top left region (up in x and down in y) nad bottom right region.
##'
##' We improved the algorithm such that all four regions of RRHO plot are meaningful
##' @title RRHO2
##' @param RRHO_obj RRHO object. See RRHO2_initialize for details.
##' ... |
6ac0702ed9db8dd6e3fc67374cfe1469760aa864c7ed572eaec57e5fd31db7d8 | R | 3,888 | 99 | library(reshape2)
library(ggplot2)
library(gridExtra)
options(stringsAsFactors = FALSE)
args = commandArgs(trailingOnly=TRUE)
parsed_file <- args[1]
hist_file <- args[2]
preseq_out <- args[3]
preseq_in <- args[4]
fasta_file<-args[5]
id_out <- args[6]
count.hist<-read.delim(hist_file,header=FALSE)
flags<-read.delim(... |
81a165551f9e81d79eea7055bbfbd7ebb141c3f322ee4c9b43d1f2a54e78cfa0 | R | 3,889 | 98 | args <- commandArgs(trailingOnly = T)
filenamex=as.character(args[[1]])
standardize_name <- function(name) {
return(gsub('[^0-9a-zA-Z]+', '_', name))}
selectedCells = read.table(file.path('./data/processed/', filenamex, 'analysis'), header=TRUE)
delimiters = ".bowtie|.bt2"
samp <- readRDS("./data/processed/rds/Sampl... |
f1785bfc30853fa30eb743f93678ff83f7749f7927e80014eada009a2f0db383 | R | 3,892 | 88 |
library(Seurat)
library(ggplot2)
library(ggrastr)
library(dplyr)
library(viridis)
dt.sct <- readRDS("output/atlas/integrated_neuronal_atlas.rds")
##################
###Full dataset###
dt.umap.integrated <- dt.sct@reductions$umap.harmony@cell.embeddings %>%
cbind(dt.sct@meta.data %>% select(Region, harm... |
fb74e3dbdba5330be720da4daf274c0cbe79df246ed2395700ff8e41806dc5ed | R | 3,902 | 112 | ---
title: "Optic Nerve Combined: Microglia DEG analysis"
author: "Katie Emberley, Jonathan Nelson, and Jeremiah Reyes"
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_foldi... |
ef68e96e96941024a5a208cc5982b656ae050d5d1e06466b0e243b2dea2d90fa | R | 3,907 | 126 | #' Produce traffic light plot of risk of bias assessment
#'
#' @description
#' Produce traffic light plot of risk of bias assessment
#'
#' @param object An object of class \code{rob}.
#' @param colour Specify colour scheme for the traffic light plot; see
#' \code{\link[robvis]{rob_summary}}.
#' @param psize Size of... |
89131f6a7a22b487a56b11336a2d270a8bfc7176b1136269cd6a3ae736605077 | R | 3,921 | 150 | #' Evaluate function on wavelengths of `hyperSpec` object
#'
#' This is useful for generating certain types of baseline "reference spectra".
#'
#' @param x either `hyperSpec` object or numeric vector.
#' @param ... expressions to be evaluated.
#' @param normalize.wl function to transform the wavelengths before evaluati... |
2d321279e269773e1696cc095d896d06726bfb1dde542d788f6d7e4c45880fed | R | 3,922 | 94 | #' @title Find differential expressed gene
#' @description Find differential expressed gene.
#' @param new_data Data input, single cell expression matrix.
#' @param data_meta Cell type classification result from RunSubclassClassify.
#' @param cell_number Cell type classification result from RunSubclassClassify.
#... |
4bed7370936119b24d403efb75c64e064e3c490769eb2593ac7d7ea3614a4afa | R | 3,944 | 71 | args <- commandArgs(trailingOnly = T)
CNVnamesx= as.character(args[[1]])
source('./scripts/01_Setup.R')
standardize_name <- function(name) {
return(gsub('[^0-9a-zA-Z]+', '_', name))}
Confid_MAD_VariableSize_hg38_xlsx <- readRDS(file.path('./data/processed/rds', paste0(CNVnamesx, ".rds")))
delimiters = ".bowtie|.bt... |
a879d89d7d59348a8b97d6dc23c9c9016443ed80303188a5a19553dff3fc14a2 | R | 3,949 | 134 | ---
title: "GWAMA"
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)
source("https://github.com/baselmans/multivariate_GWAMA/blob/master/Test_Data/N_weighted_GWAMA.function.1_2_6.R?... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.