sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
da7a907d76e57344257fd35845bd5332a4dd8b3a8cac5c0b8fccdb0e36796b42 | R | 2,868 | 102 | ---
title: "Saldana, Montano, et al. -- scRNA-seq: 02_integration of the whole dataset using Seurat"
author: "Luis Montano"
date: '2023-07-18'
output: html_document
params:
inputdata: '~/path/to/input_data/'
plotpath: '~/path/to/plots/'
cachedir: '~/path/to/cachedir/'
---
```{r setup, include=FALSE}
knitr::op... |
b99ee3ea0ca95497f2015effc85fc93f38d899abbb55fd479610c0731b6298fd | R | 2,879 | 88 | #' Format number Geom
#'
#' @param digits integer indicating the number of decimal places (round) or
#' significant digits (signif) to be used, the default value is 2.
#' @param nsmall the minimum number of digits to the right of the decimal
#' point in formatting real/complex numbers in non-scientific formats,... |
06003dbf5d32bd28a5205f1777dcef9fe883088353092d454fb07ce30f140e5b | R | 2,887 | 50 | ################################################################################
# Written by Loïc Labache, Ph.D. #
# Holmes Lab, Department of Psychiatry - Rutgers University #
# January 30, 2024 ... |
479c989108a5365e41e34337f3d1ebd480c0daad9967df15cc4730493d9222fe | R | 2,892 | 96 | # Print current working directory, which should contain the scripts,
# matrix and trees.
getwd()
# If getwd() does not contain the relevant files, set wd to working directory
wd <- "./"
outgroup <- c("Tubiluchus") # Specify taxa on which to root tree
source(paste0(wd, "/common.R"))
source(paste0(wd, "/plot.R... |
02a1f5cc7d21f3298d641b0ab20552b52a77cf024dda068aee95122c3332ff42 | R | 2,904 | 68 | ## Generate circlized plot
suppressPackageStartupMessages({
library(dplyr)
library(circlize)
library(ComplexHeatmap)
})
extract_bed <- function(tissue){
fn <- paste0("../../summary_table/_m/",
"differential_expression_interaction_jxn.txt")
bed <- data.table::fread(fn) %>%
... |
96616297263276d8507583f0b7310044ed0db435edc2264b5659dba8db803703 | R | 2,907 | 73 | #' Print model-fits (mean LOOIC or WAIC values in addition to Akaike weights) of hBayesDM Models
#'
#' @param ... Model objects output by hBayesDM functions (e.g. output1, output2, etc.)
#' @param ic Which model comparison information criterion to use? 'looic', 'waic', or 'both
#' @param ncore Number of corse to use wh... |
d62333616303015ff5a232855611e4f532f8ff5b51f21ff34dc15f29cb442bd5 | R | 2,907 | 53 | #' @templateVar MODEL_FUNCTION pstRT_ddm
#' @templateVar CONTRIBUTOR \href{https://github.com/hydoh/}{Hoyoung Doh} <\email{hoyoung.doh@@gmail.com}>, \href{https://github.com/sanghoon-kang/}{Sanghoon Kang} <\email{sanghoon.kang@@yale.edu}>, \href{https://jihyuncindyhur.github.io/}{Jihyun K. Hur} <\email{jihyun.hur@@yale... |
716fe1b2e69a5a2fb5fe3626320b8bf3b42d6d65eebfb79318347d05ce67c5ad | R | 2,914 | 58 | source("funcsToUpdate_1_2017.R")
source("old_function.R")
load("AllExamples.RData")
#Vaccine data used in CellCODE paper
allPaths=combinePaths(bloodCellMarkersIRISDMAP, svmMarkers, canonicalPathways)
#for larger datasets litvakSigs may also be useful
#allPaths=combinePaths(bloodCellMarkersIRISDMAP, svmMarkers, canon... |
65c767562339544076d4541b39541786a3f456fe08a177562c64c5700c675702 | R | 2,919 | 77 | suppressPackageStartupMessages({
requireNamespace("jsonlite")
requireNamespace("DESeq2")
requireNamespace("tibble")
requireNamespace("dplyr")
})
deseq2_analysis <- function(
count_data,
col_data,
deseq2_settings,
output_directory,
feature_column = "feature",
results_callback = NULL
) {
dir.create... |
537ea1eb7188de740416d9af7e5e414c2919e5461f13dcc7ccbbdcbc88490670 | R | 2,924 | 64 | #!/usr/bin/env Rscript
# /users/k1642468/commonmind/Rodrigo/TWAS_HERVs_SCZ/repopulate_pheno_info_for_fam_files.R
# This script is gonna extract pheno info from a table and populate unknown Sex/Pheno fields in fam file.
library(data.table)
library(dplyr)
args = commandArgs(TRUE)
# args=list() # ${CHIP}_genotypes ${CHIP... |
af1d99daca462e2907a1cf8fe8e09df3dea2286c7583f63e1e04647c7a4b6e0f | R | 2,929 | 93 | #' Export \code{mids} object to Mplus
#'
#' Converts a \code{mids} object into a format recognized by Mplus, and writes
#' the data and the Mplus input files
#'
#' This function automates most of the work needed to export a \code{mids}
#' object to \code{Mplus}. The function writes the multiple imputation datasets,
#' ... |
0884eaaffe995510b5be83c9a17806978edf0b67ec5930054f15b2a8694181c9 | R | 2,944 | 103 | ---
title: "sc2marker with HCA-BM (Human)"
author: "sc2marker"
date: "`r format(Sys.time(), '%d %B, %Y')`"
output:
html_document:
toc: yes
toc_depth: 3
toc_float:
collapsed: false
smooth_scroll: false
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
suppressMessages(library(... |
abe64174352590d41dbca612a940a4cde215a6378ed6aeaea5bed74623fb0f8a | R | 2,948 | 100 | source('~/scripts/single_cell/atac.R')
source('~/scripts/single_cell/wrapper.R')
source('~/scripts/single_cell/markers.R')
source('~/scripts/single_cell/celltype.R')
source('~/scripts/single_cell/de.R')
source('~/scripts/single_cell/graphs.R')
source('~/scripts/grn/models.R')
library(ArchR)
library(parallel)
addArchRT... |
020ea35ab64ca272e152de7b73a4063c48d59d80fe1d30368eac67cf74da3eca | R | 2,963 | 140 | #' @noRd
xrange <- function(.plot) {
stopifnot(inherits(.plot, "gg"))
if(is_dplot(.plot)) {
class(.plot) <- setdiff(class(.plot), "dplot")
}
ggplot_build(.plot)$layout$panel_params[[1]]$x.range
}
#' @noRd
yrange <- function(.plot) {
stopifnot(inherits(.plot, "gg"))
if(is_dplot(.plot)) {
class(.plot... |
688174cdebc3a4b40659c9f9ce8f1cc3088b8b353e106c846f1443ab37a4d001 | R | 2,964 | 94 | ---
title: "Comparison of DEGs with RR3 bulk RNAseq data, hypergeometric test for gene overlap"
author: "Yuvarani Masarapu"
date: "2023-10-20"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Read the 825 DEGs from the multiomics clusters
```{r}
library(readxl)
degs <- re... |
aeda5389337dbc48c8a5ae560495a526893b857b34c76e86e34a29e9d71f8399 | R | 2,965 | 87 | #' Growth of Dutch boys
#'
#' Height, weight, head circumference and puberty of 748 Dutch boys.
#'
#' Random sample of 10\% from the cross-sectional data used to construct the
#' Dutch growth references 1997. Variables \code{gen} and \code{phb} are ordered
#' factors. \code{reg} is a factor.
#'
#' @name boys
#' @docTyp... |
3b02fa804c5ae7bbdd399a4afd56f07e4b7245a7882dd95b67c01b5f9e572cb3 | R | 2,981 | 76 | library(Inapp)
context("morphy.length")
test_that("right counting compared to inapp", {
## Tree
tree <- read.tree(text = "((((((1,2),3),4),5),6),(7,(8,(9,(10,(11,12))))));")
## Data
characters <- c("23--1??--032", # 0
"1---1111---1", # 1
"1100----1100", # 2
... |
4e61453fb402b751abbc44f816637b7952146314f7bc32d9af4ab38878de28fc | R | 2,985 | 86 | #' Compare two nested models using D1-statistic
#'
#' The D1-statistics is the multivariate Wald test.
#'
#' @param fit1 An object of class \code{mira}, produced by \code{with()}.
#' @param fit0 An object of class \code{mira}, produced by \code{with()}. The
#' model in \code{fit0} is a nested within \code{fit1}. The de... |
e422db1f77bd2402784edf47e4ad70d52ac543cb3a12a4bcaf85ab569b4338f0 | R | 2,995 | 69 | library(ggplot2)
library(dplyr)
### set the working directory
if (rstudioapi::isAvailable()) {
setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
} else{
# If running as a script, finding the file is harder
# https://stackoverflow.com/a/55322344/10930590
this_file <- commandArgs() %>%
tibble::enfr... |
46255a809b9cba407ac2bbe99dab43022a97bb77a061c423918ac860525acff2 | R | 3,000 | 113 | ---
title: "Context stats"
output: html_document
---
# **Full context stats**
<br>
<br>
This page details the context stats that have been generated as a result of running the bamstats tool.
<br>
<br>
```{r total_context, echo=FALSE}
library(knitr)
library("RSQLite")
library("DBI")
library(stringr)
library("rmar... |
3507a538c551df2f5eea280a666b4cc3bda2d38dd867dd11bc5b718f8fad15fb | R | 3,004 | 99 | source('~/scripts/single_cell/de.R')
source('~/scripts/single_cell/atac.R')
source('~/scripts/perturbator/de.R')
library(Pando)
library(destiny)
library(dtw)
filter <- dplyr::filter
select <- dplyr::select
setwd('~/projects/cutntag/')
#### Read data ###
marks <- read_rds('data/all_marks_list_v3.4lines.rds')
####... |
ec98e2c1426f8b8a415eed022a9357269e01d62b67590f00673ce84dc703409d | R | 3,007 | 73 | #'#################################################################################
#'#################################################################################
#' Analyze BRCA
#'#################################################################################
#'##############################################... |
cda43bf27386a36074acbc86b4735e68e895a856a52295942745592f2b4df2ae | R | 3,030 | 118 | mice.edit.setup <- function(
data,
setup,
user.visitSequence,
allow.na = FALSE,
remove.constant = TRUE,
remove.collinear = TRUE,
remove_collinear = TRUE,
...
) {
# legacy handling
if (!remove_collinear) {
remove.collinear <- FALSE
}
# edits the imputation model setup
# When it detec const... |
e39d82332987c4450837eb39cd6f4489966bd8f794f378474cd76b30abcf8452 | R | 3,036 | 106 | ---
title: "Saldana, Montano, et al. -- scRNA-seq: 02_integration of the whole dataset using Seurat"
author: "Luis Montano"
date: '2023-07-18'
output: html_document
params:
inputdata: '~/path/to/input_data/'
plotpath: '~/path/to/plots/'
cachedir: '~/path/to/cachedir/'
---
```{r setup, include=FALSE}
knitr::op... |
255d78193efd6d822c7c7f582f1c75392260cac500aa127e20caf829f6cdd316 | R | 3,037 | 52 | #' @templateVar MODEL_FUNCTION ts_par6
#' @templateVar CONTRIBUTOR \href{https://ccs-lab.github.io/team/harhim-park/}{Harhim Park} <\email{hrpark12@@gmail.com}>
#' @templateVar TASK_NAME Two-Step Task
#' @templateVar TASK_CODE ts
#' @templateVar TASK_CITE (Daw et al., 2011)
#' @templateVar MODEL_NAME Hybrid Model, with... |
0fbfe0d388b3654915c94da9d65ec23739109baeb9dac638166df22bd444eb8e | R | 3,063 | 52 | #' @templateVar MODEL_FUNCTION dbdm_prob_weight
#' @templateVar CONTRIBUTOR \href{https://ccs-lab.github.io/team/yoonseo-zoh/}{Yoonseo Zoh} <\email{zohyos7@@gmail.com}>
#' @templateVar TASK_NAME Description Based Decison Making Task
#' @templateVar TASK_CODE dbdm
#' @templateVar MODEL_NAME Probability Weight Function
#... |
03a2b08ea06e4e7c4ceee0fb75574e4643ed815c36239bc18dfbbb8b516f061c | R | 3,073 | 85 | library(data.table)
library(stringr)
### will want genes to also have prior info so...
long_ppi <- fread("C:/STUDIES/RESEARCH/ODE_project_local_old/breast_cancer_data/otter_clean_harmonized_PPI.csv")
long_prior <- fread("C:/STUDIES/RESEARCH/ODE_project_local_old/breast_cancer_data/otter_clean_harmonized_full_prior.cs... |
317f34231f31d0c989c95dd7bfae717bfce26f7908fdfc515d4408f64f868992 | R | 3,090 | 52 | #' @templateVar MODEL_FUNCTION ts_par4
#' @templateVar CONTRIBUTOR \href{https://ccs-lab.github.io/team/harhim-park/}{Harhim Park} <\email{hrpark12@@gmail.com}>
#' @templateVar TASK_NAME Two-Step Task
#' @templateVar TASK_CODE ts
#' @templateVar TASK_CITE (Daw et al., 2011)
#' @templateVar MODEL_NAME Hybrid Model, with... |
a46156060f19029dd58fbdfd8a904ee13c723b5fb87b97d020867b0a2b560a3f | R | 3,092 | 76 |
setwd('~/Projects/PHOENIX_data/GSE100441_RAW/')
timepoints <- c('00', '01', '02', '04', '07', '15')
data_U1 <- do.call(cbind, lapply(1:length(timepoints), function(i)
{
timepoint <- timepoints[i]
id <- 2683114 + i
dat <- read.table(paste0('GSM',id,'_U',timepoint,'_RTX_genes.fpkm_tracking'), header=T, sep='\t... |
7d8ebf9d13265d5fcaff5c9fd9ba5c6a9d3f347814796dbc17d9249baee6e809 | R | 3,093 | 69 | #'#################################################################################
#'#################################################################################
#' Process GSE57945 gene expression for deep learning
#'#################################################################################
#'########... |
2ff1a9c3ce8f7a8cb9877418bb0169a8edfd3b522ab87e2da326cc208a1afab0 | R | 3,094 | 83 | #' Colour scales for correlation plot
#'
#' @description This set of scales defines new fill scales for correlation matrix plot
#' equivalent to the ones already defined by ggplot2.
#'
#' @return A ggproto object inheriting from `Scale`
#' @inheritParams ggplot2::scale_fill_gradient2
#' @param colours,colors vector of ... |
3420cfccd3a920fd28ff916460aa23712e5b2dbe70b573085175a5ddd9963e3f | R | 3,114 | 71 | #' Create an object of class "mira"
#'
#' The mira() functions constructs an S3 object representing a set of
#' multiply imputed repeated analyses (mira). The default workflow generates
#' the \code{mira} object using the \code{with()} function.
#'
#' The \code{as.mira()} function takes the results of repeated
#' compl... |
c3272ae0f70db7d2c586af8abbe2121f8f847e12e6830c01ed397697edfd1b9e | R | 3,118 | 53 | #' @templateVar MODEL_FUNCTION ts_par7
#' @templateVar CONTRIBUTOR \href{https://ccs-lab.github.io/team/harhim-park/}{Harhim Park} <\email{hrpark12@@gmail.com}>
#' @templateVar TASK_NAME Two-Step Task
#' @templateVar TASK_CODE ts
#' @templateVar TASK_CITE (Daw et al., 2011)
#' @templateVar MODEL_NAME Hybrid Model, with... |
f4707e41d1f5889128fffffc267783cb60c2e9e77b7b6e4540fde66f4198f923 | R | 3,123 | 92 | ## This script plots example boxplots
suppressPackageStartupMessages({
library(ggpubr)
library(dplyr)
})
ggplot_save <- function(p, fn, w=7, h=7){
for(ext in c('.png', '.pdf')){
ggsave(p, filename=paste0(fn, ext), width=w, height=h)
}
}
get_sex_de <- function(){
fn <- here::here("differen... |
886620a6ba8f6970e0cf8e2da6b19eeec27bc7e8e5cffe534c3bd71688968569 | R | 3,128 | 58 | library(tidyr)
transition_to_fragment <- function(proteome_long,
fragment_annotation_column = 'aggr_Fragment_Annotation',
fragment_intensity_column = 'aggr_Peak_Area'){
print(names(proteome_long))
print(fragment_annotation_column %in% names(prote... |
397812b4eeef59c437fd8fe52da78ed4e5e2b9827362b817bdbe62e0f1ae2c24 | R | 3,129 | 93 | #' Imputation by indirect use of lasso logistic regression
#'
#' Imputes univariate missing data using logistic regression following a
#' preprocessing lasso variable selection step.
#'
#' @aliases mice.impute.lasso.select.logreg lasso.select.logreg
#' @inheritParams mice.impute.pmm
#' @param nfolds The number of folds... |
7827bfbdc50e470e19dd30f687236942820ad12464ef71ad132fb2c818f5b74b | R | 3,139 | 85 | #' Create calltype of the imputation model
#'
#' The helper `make.calltype()` creates a vector that identifies per block if
#' the imputation model is taken from `predictorMatrix` or `formulas`. The
#' function is used internally by `mice()`.
#'
#' @param calltype A character vector of length equal to the number of blo... |
1fab48f17c67197d95ca09198638293158b73e832202fe1c8bfcc651960da7b1 | R | 3,142 | 97 | #' Build coding segments
#'
#' @description Constructs CDS information on transcripts from custom annotation
#' using reference-based approach.
#'
#' @details
#' This function will firstly identify custom transcripts with identical
#' exon structures as those in the reference annotation. If these reference
#' transript... |
5b244d640e1fb76dd8b5e5e63e11865e6275e6b666295870bee4c937ae276fde | R | 3,143 | 72 | library(coin)
library(dplyr)
library(ggplot2)
library(ggsignif)
library(ggpubr)
library(pracma)
dat.dir = ''
load(paste0(dat.dir,'data/data.RData'))
cpalette = c('#bebebe','#ff9900','#99ff00','#ff3333','#3366ff')
ns = max(data$sbjno)
include = !is.na(data$esttd*data$conf.esttd*data$estgr*data$conf.estgr)&(data$estt... |
2bace8e0fc02e35365bd50f3abc642900bbec5c427457743b0d13fbd492dfa24 | R | 3,155 | 83 | #! /usr/bin/Rscript
args1 <- commandArgs(trailingOnly=TRUE)[1] # sample2condition.txt
args2 <- commandArgs(trailingOnly=TRUE)[2] # target2gene.txt
dir.create('output')
# DESeq2、tximportのインストール・読み込み→Dockerfileへ。
#if (!requireNamespace("BiocManager", quietly = TRUE))
# install.packages("BiocManager")
#BiocManager::i... |
d7bb9324bc108b6f08ba04f84765451f1671b5b6c112318cc45f9796093d3dcc | R | 3,158 | 72 |
library("gamlss")
library("ggplot2")
x <- read.csv('withinDispersion.csv')
centile <- data.frame(
age = seq.int(8, 89, length.out = 1000)
)
within_gamlss_t <-array(0,dim=c(1,7))
within_gamlss_p <-array(0,dim=c(1,7))
quantiles <-c(0.5,0.75,0.25)
centile_names <-c("mid","high","low")
min_age <-min(x$age)
... |
ada0de6e6e27191e238a720aaddfcc1561e77732b2b65a7cf9795bf4533f1c03 | R | 3,174 | 60 |
#Let's see if it worked:
setwd("~/Documents/Microarray Gen/Angela_HRLR_EE_Stress/NAcc_Remove2outliers/11_FGSEA/UpdatedGMT_20210325/GMTs_Rat")
GMT_ForRats<-gmtPathways("BrainCellTypes_V1_Rat_GMT.gmt.txt")
str(GMT_ForRats)
# List of 289
# $ Astrocyte_All_Cahoy_JNeuro_2008 : chr... |
6fd22b28403c95748c837921b3cacac598992cdc468c048f9abff2196a0afd10 | R | 3,176 | 60 | library(tidyverse)
#replace with location for your source data from the CamCan data repository
data_dir = "/Volumes/Research/lazarm03lab/labspace/AD/camcan995/source_materials"
### pulling all spreadsheets into BIDS compliant participants.tsv ###
standard_data = read_csv(file.path(data_dir, "standard_data.csv"))
appr... |
d22f61bc45ef5335588c6e4e03715c912642238bc472703ec6e1daf289224912 | R | 3,176 | 91 | #' Imputation of most likely value within the class
#'
#' Method \code{2lonly.mean} replicates the most likely value within
#' a class of a second-level variable. It works for numeric and
#' factor data. The function is primarily useful as a quick fixup for
#' data in which the second-level variable is inconsistent.
#'... |
5433caf8e22576afcfd94db3982daebbf658ee51b5bf8efa80b15c40209bd1a9 | R | 3,182 | 80 | options(warn=-1)
suppressPackageStartupMessages({
library(tidyverse)
library(optparse)
})
option_list = list(
make_option(c("-a", "--abundance"), type="character", default=NULL, help="input NORMALISED abundance file: gene_normalised_abundance.txt [REQUIRED] [default= %default]", metavar="character"),
make_op... |
a31e8b6861ae19bf485a1f112a3d0e8fc249c9d14efeeff699ec14b5cab2a0a1 | R | 3,182 | 120 | .testplot <- function(object, x, y = "count",
x.set = NULL, y.set = NULL,
geom = "auto",
x.lab = NULL, y.lab = NULL,
x.lim = NULL, y.lim = NULL,
group.by = NULL, group.pos = "dodge",
min.e... |
f3861783ff1b5acf13bf3ce35f9359d8cef9a9700a9fbb68768982cad9285a97 | R | 3,182 | 76 | # script for running WGCNA on biocluster
args <- commandArgs(trailingOnly = TRUE)
library(WGCNA)
# The following setting is important, do not omit.
options(stringsAsFactors = FALSE)
###############################################################################
#### STEP 2. Automatic construction of the gene netw... |
94a85efbde1f5b385be325f98863fbc1f67c82e1cc5db3766e1796f06d6ab8e1 | R | 3,186 | 84 | #@Time : 2023/7/22 20:38
#@Author : Biao Zhang
#@Email : littlebiao@outlook.com
#@File : genomic_findmarkers.r
#@Description: This file is used to find marker genes with Seurat findMarker
#source('./genomic_functions.R', local = TRUE)
library(sceasy)
library(anndata)
library(Seurat)
library(Matrix)
library(reticulate... |
43e1539ed20a5be94ec0253ef87740506421e2c8459da5856ee7a503546b04d5 | R | 3,201 | 97 | args = commandArgs(TRUE)
eta=as.numeric(args[1])
max_depth=as.numeric(args[2])
gamma=as.numeric(args[3])
min_child_weight=as.numeric(args[4])
nrounds=as.numeric(args[5])
i=as.numeric(args[6])
idx=as.numeric(args[7])
data_folder=as.character(args[8])
sex_split=try(as.logical(args[9]))
HyperParameterSearchCV = functio... |
a8971e8dfcad3692d9c478bd2124bc3707bc797e7e808b6be000b2a2738a04ad | R | 3,208 | 101 | #!/usr/bin/env Rscript
suppressPackageStartupMessages({
library("dplyr")
library("ggplot2")
library("naniar")
library("readr")
library("tibble")
library("tidyr")
})
models <- tibble::tribble(
~name, ~dir_name,
"sod1", "SOD1-mouse",
"tdp43", "TDP43-mouse",
"c9", "C9orf72-mouse",
"fus", "FUS-mous... |
a6b3d9d3a39b1e6200ccf73873579971bae53365238e0761565f803079d70748 | R | 3,218 | 108 | skip_if_not_installed("dplyr")
library(dplyr)
suppressWarnings(RNGversion("3.5.0"))
# load data
dat <- mice::nhanes
# add indicator training and test
# first 20 for training, last 5 for testing
dat$set <- c(rep("train", 20), rep("test", 5))
# Make prediction matrix and ensure that set is not used as a predictor
pre... |
bbf81e58dbd0f13fcdd18db7b59327f1f7f83ebcf5f55ccf96b6b84341d39555 | R | 3,220 | 52 | #' @templateVar MODEL_FUNCTION cgt_cm
#' @templateVar CONTRIBUTOR \href{https://ccs-lab.github.io/team/nate-haines/}{Nathaniel Haines} <\email{haines.175@@osu.edu}>
#' @templateVar TASK_NAME Cambridge Gambling Task
#' @templateVar TASK_CODE cgt
#' @templateVar TASK_CITE (Rogers et al., 1999)
#' @templateVar MODEL_NAME ... |
c48ffbd359e5c2a4f05eee5f22705b31dad3e89603aade3eb260ab883fb384fb | R | 3,223 | 94 | library(data.table)
library(stringr)
### will want genes to also have prior info so...
long_prior <- fread("C:/STUDIES/RESEARCH/ODE_project_local_old/breast_cancer_data/otter_clean_harmonized_full_prior.csv")
all_prior_affiliated_genes <- unique(c(long_prior$from, long_prior$to))
### start cleaning
full_data <- frea... |
4f09b55480eb300eaa4d84b7e60b4ecefab808d367aa3d70ed3801c4a4cd9149 | R | 3,238 | 103 | ---
title: "Cell marker identification with seurat samples"
author: "Ronghui"
date: "`r format(Sys.time(), '%d %B, %Y')`"
output:
html_document:
toc: yes
toc_depth: 3
toc_float:
collapsed: false
smooth_scroll: false
---
```{r echo=FALSE, message=FALSE, warning=F}
library(Seurat)
library(ggplo... |
9bedc8a9860934e7821e5a9011b85e1b2c3cf1db0c57c67b809a888383181e4a | R | 3,241 | 94 | #' Make rand dataset
#' @title Make dataset
#' @param rows,cols number of rows and columns.
#' @param vars number of variables.
#' @param obs number of observation.
#' @param reorder reorder the dataset at random.
#' @param row.names,col.names row/column names.
#' @param type one of "perlin", "cubic", "simplex", "value... |
c5231a9216689cceb510b4b1c286a08485c6fe1f4066241c551e62464dad89fa | R | 3,242 | 75 | library(readxl)
library(dabestr)
library(dplyr)
library(tidyr)
#1. load excel or csv file containing n-NRF magnitudes "both_sites_magnitudes.xlxs"
both_sites_magnitudes <- read.csv("both_sites_magnitudes.csv")
#2. create dataframes for UCL and Exeter magnitudes separately
UCL_magnitudes <- both_sites_magnitudes[both_... |
927ba57581057b5ca67b5ad6bb7b15fb5003f91bd1781f12c64c00bd32148188 | R | 3,251 | 73 | #' Export \code{mids} object to SPSS
#'
#' Converts a \code{mids} object into a format recognized by SPSS, and writes
#' the data and the SPSS syntax files.
#'
#' This function automates most of the work needed to export a \code{mids}
#' object to SPSS. It uses \code{haven::write_sav()} to facilitate the export to an
#... |
7b283d106193f517b28a6e1cd17c4ec8c6e24cbc26e29f37b3b45d8eb03bf0e6 | R | 3,261 | 79 | #5 Assortativity analysis
# Setup---------------------------------------------------------------
rm(list = ls()) ; gc() ; gc()
set.seed(1234)
wdir <- 'set your working directory'
setwd(wdir)
save.path <- 'object folder path'
# load library
easypackages::libraries(c('Seurat','tidyverse','SPATA2','semla'))
# Create ... |
a781ce61c8bbabd801abffb068bba9a57b1c9ca5410178a12b7a14dbe62e7fbe | R | 3,264 | 95 | #' Imputation by indirect use of lasso linear regression
#'
#' Imputes univariate missing data using Bayesian linear regression following a
#' preprocessing lasso variable selection step.
#'
#' @aliases mice.impute.lasso.select.norm lasso.select.norm
#' @inheritParams mice.impute.pmm
#' @param nfolds The number of fold... |
659c016a9c4a24a8d3fd4dabb5ce743ae223772ce1575b0213f2947a17e07d9a | R | 3,267 | 97 |
#Publication information from ISI:
setwd("~/Documents/SideProjects/BrainGMT/ISI")
BrainMicroarrayPubs<-read.csv("BrainMicroarray_savedrecs_CompiledwCitationReport_forR.csv", header=TRUE, stringsAsFactors = FALSE)
str
#Adding some filters:
dim(BrainMicroarrayPubs[BrainMicroarrayPubs$Publication.Year<2012 & BrainMi... |
f494b7d32c4d24e0e3cccf59742e614bbf101c84edbd1c737c91e714742e434c | R | 3,269 | 89 | ###############################################################################
# GO BP enrichment for DEGs of selected cell types from the DEA results
#
# Reads all *_all_DEGs.csv files and, for the three neuronal cell types
# (GABAergic neurons / Glutamatergic neurons / Immature neurons), runs GO
# Biological Process... |
1254a5f2b292fe9de3ea41e48b6bdd45a2a8ca15a2b6f01354d7535929f92ddc | R | 3,280 | 99 | library(Seurat)
library(corrplot)
library(pheatmap)
library(dplyr)
# 1. 加载数据
brain_ileum <- readRDS("06_manual_annotate/Brain_new.rds")
output_dir <- "./07_plot/"
# 2. 计算每个细胞类型的平均表达(log1p标准化后的数据)
avg_exp <- AverageExpression(brain_ileum,
assays = "RNA",
sl... |
0e30328b7f20ddeb325df6e08fe0b0d5133300d123a5ef136515dc0ac58c66ce | R | 3,290 | 97 | library(relaimpo)
library(tcltk)
perm_count <- 5000
u <- 1:perm_count
k <- 1:8
res <- array(0, dim = c(8, perm_count))
res_real <- array(0, dim = c(8, 1))
p_perm <- array(0, dim = c(8, 1))
r <- array(0, dim = c(1,perm_count ))
x <- read.csv('receptor data.csv')
#########################################... |
8a40ac6178c700f546305eb756512250066177cb04cd78fb58257201e95dea2e | R | 3,299 | 76 | ##' @title Correlation plot of two genes/miRNAs
##' @description Scatter plot showing the expression correlation
##' between two genes/miRNAs
##' @param gene1 an Ensembl gene id or miRBase v21 mature miRNA id
##' @param gene2 an Ensembl gene id or miRBase v21 mature miRNA id
##' @param rna.expr \code{\link[limma]{... |
60f5912765a862cf0351cf664ab4b3a019eeb1bf5a266f1456d6cae5590c31aa | R | 3,308 | 95 | ## This script plots example boxplots
suppressPackageStartupMessages({
library(ggpubr)
library(dplyr)
})
ggplot_save <- function(p, fn, w=7, h=7){
for(ext in c('.png', '.pdf')){
ggsave(p, filename=paste0(fn, ext), width=w, height=h)
}
}
get_de <- function(){
fn <- paste0("../../summary_ta... |
e4f1a5504f6a9c2f169e6e83e9a412ed86745f414ce467f7e756f13d7938362b | R | 3,313 | 83 | library(ashr)
library(mashr)
library(gplots)
library(viridis)
library(ggplot2)
library(corrplot)
library(rmeta)
set.seed(2020)
current = getwd()
setwd(current)
folder = "7_WOS_effects"
CORR_TYPE <- "withCorr"
MODEL_FOLDER <- "WOS_associated_QN"
MODEL_TYPE <- c("WOS_associated_QN")
COV_TYPE <- c("canonical_and_dataDri... |
50de93490e58e53a3351b4679f286d4fe339b2908983e9fdcc80236c152c3e6d | R | 3,317 | 55 | BrainInABlenderDatabase_All_JustSymbols_HumanOrthologs_NoNA
BrainInABlenderDatabase_All_JustSymbols_RatOrthologs_NoNA
BrainInABlenderDatabase_All_JustSymbols_MouseOrthologs_NoNA
BrainInABlender_Mouse_Temp<-list()
BrainInABlender_Rat_Temp<-list()
BrainInABlender_Human_Temp<-list()
names(table(BrainInABlenderDatabase_A... |
d52678681c7aa27522d14a822ab24be6d6fadef735c2c3fd7ff03a6571106697 | R | 3,319 | 110 | #' Shade Geom
#'
#' @param sign scalar numeric value. If less than 0, add shade on cells with
#' negtive \code{r} values. If larger than 0, add shade on cells with positive
#' \code{r} values. If equals 0, add shade on cells except where \code{r} values
#' equals 0.
#' @inheritParams ggplot2::layer
#' @inh... |
aadde148ed3ca68455ac374e3117d7519281e3c0adbef6dffa628b4931e806c8 | R | 3,320 | 51 | InternalizingBehavior_Mouse_Temp<-list()
InternalizingBehavior_Rat_Temp<-list()
InternalizingBehavior_Human_Temp<-list()
names(table(InternalizingBehaviorGeneSets_RatOrthologs_NoNA$DatasetName))
for(i in c(1:length(names(table(InternalizingBehaviorGeneSets_MouseOrthologs_NoNA$DatasetName))))){
InternalizingBehav... |
64123a82c4056d9f069ffbeda6f317125cb07dccb7d4a6d8622772b648e13c1a | R | 3,322 | 124 | #' Conditional imputation helper
#'
#' Sorry, the \code{ifdo()} function is not yet implemented.
#' @aliases ifdo
#' @param cond a condition
#' @param action the action to do
#' @return Currently returns an error message.
#' @author Stef van Buuren, 2012
#' @keywords internal
ifdo <- function(cond, action) {
cat("Fu... |
76f380a8b55973e75e61e2d6363537bfb56c6289fa7bb210203d9a8dd10b234d | R | 3,337 | 99 | # Title: Ancestral state estimation
# Name: Heather White
# Date created: 02/12/21
# Last modified: 25/10/22
# License: MIT license
# Estimation of the ancestral state using ML for total suture closure scores
#######################################################################################################
... |
b0bc10f4e442a54e5f708aaadf0751725b78696c0544ea4a11b6086de36bb1c4 | R | 3,338 | 70 | # NOTE:
# File with the sample distributions
# /mnt/BioAdHoc/Groups/RaoLab/Edahi/Projects/09.TimeCourse5hmC/ForFerhatGit/FCDNN//data/sample_groups.csv
# Sconda conda activate TensorFlow_CPU_01; cd /mnt/BioAdHoc/Groups/RaoLab/Edahi/Projects/09.TimeCourse5hmC/ForFerhatGit/FCDNN/results/prediction_accuracy_per_quartile; R... |
9e0125b6d44138877e62dc41de64a025305121ae2ece341d7ec413b3f7f50877 | R | 3,345 | 74 |
library("gamlss.dist")
x <- read.csv('betweenDispersion.csv')
centile <- data.frame(
age = seq.int(8, 89, length.out = 1000)
)
between_gamlss_t <-array(0,dim=c(1,21))
between_gamlss_p <-array(0,dim=c(1,21))
quantiles <-c(0.5,0.75,0.25)
centile_names <-c("mid","high","low")
min_age <-min(x$age)
max_age <-... |
a85225bc4355e26a99be154cc9faa770cd52e0153b7480a5365a3f475ad53144 | R | 3,347 | 66 | library(dplyr)
library(data.table)
library(getopt)
command<-matrix(c(
'help', 'h', 0,'logical', 'help.',
'exp_ma_file', 'e', 1, 'character', 'input GWAS .ma file.',
"snp_file",'s',1,'character','colocalized SNP list file.',
"ref_genotype",'r',1,'ch... |
e851e06113c48e2efff337526ebc42f39fd25f6d86af87c52450e8537767a4e9 | R | 3,353 | 80 | #' Create a correlation plot
#' @description This function is the equivalent of \code{\link[ggplot2]{ggplot}}
#' in ggplot2. It takes care of setting up the position of axis and legend for
#' the plot based on the plot type.
#' @param data cor_tbl object.
#' @param mapping NULL (default) or a list of aesthetic ... |
899a4e68242a0d6bf4d72f23c131a81bf4319773076ceb2292b641c7cee9ee1d | R | 3,355 | 131 | #' @importFrom tibble as_tibble
#' @export
as_tibble.cor_tbl <- function(x, ...)
{
class(x) <- setdiff(class(x), "cor_tbl")
attrs <- attributes(x)
excludes <- attrs[setdiff(names(attrs), c("names", "class", "row.names"))]
if(length(excludes) > 0) {
for (nm in names(excludes)) {
attr(x, nm) <- NULL
... |
b2318450efb47897b80d5620331647f7d5d908283e1cc8719fc66392ffbff381 | R | 3,356 | 102 | ---
title: "vignette"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{vignette}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
```{r setup}
library(sc2marker)
```
# load data
```{r Seu... |
190991bb49a8d43bf86cc77b478e2ca667d1afc0e1a283edd835e18dd1e1584e | R | 3,360 | 75 | library(data.table)
library(stringr)
### Read in name files
otter_gene_names <- fread("C:/STUDIES/RESEARCH/ODE_project_local_old/breast_cancer_data/otter_gene_names_desmedt_conv.csv")
otter_tf_names <- fread("C:/STUDIES/RESEARCH/ODE_project_local_old/breast_cancer_data/otter_tf_names_desmedt_conv.csv")
### Clean val... |
1eef80d997b6987a98b427618d3bdfd18240cc31a6acd099865b949ea649df5b | R | 3,363 | 50 | ---
title: 'GDCRNATools: integrative analysis of protein coding genes, long non-coding genes, and microRNAs in GDC'
author: 'Ruidong Li and Han Qu'
date: "Last update: `r format(Sys.time(), '%d %B, %Y')`"
vignette: >
%\VignetteIndexEntry{'GDCRNATools: integrative analysis of protein coding genes, long non-coding gen... |
40ebb40fa528d889e5430a3bfc6d3a621da9aef1e8a0f010a76e355b584edd0e | R | 3,370 | 90 | #!/usr/bin/Rscript
## Import Libraries
library("DESeq2")
library("ggplot2")
## Import counts matrix
cts_transcript <- as.matrix(read.csv("../../../data/bernardo/processed/04.deseq2/transcript_counts_unfiltered.tsv", sep="\t", row.names="transcript_id"))
cts_gene <- as.matrix(read.csv("../../../data/bernardo/process... |
d8cda0012a1da5ba4b2e48cbc314380b9ea31621faacd2cbd666c50e999d2d82 | R | 3,376 | 109 | #' Fix coefficients and update model
#'
#' Refits a model with a specified set of coefficients.
#'
#' @param model An R model, e.g., produced by \code{lm} or \code{glm}
#' @param beta A numeric vector with \code{length(coef)} model coefficients.
#' If the vector is not named, the coefficients should be
#' given in the ... |
856d4270121efdb31f77e132e28cd9ce7d7d77e91460f243a119b9a658ccbb08 | R | 3,381 | 95 | # Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
legendre <- function(x, p) {
.Call(`_mice_legendre`, x, p)
}
matcher <- function(obs, mis, k) {
.Call(`_mice_matcher`, obs, mis, k)
}
#' Find index of matched donor units
#'
#' @param... |
cc0231b39d48f71ca471e484bc3a1c8f75765307078d99fae538ae2f9e6b848f | R | 3,391 | 90 | #!/usr/bin/Rscript
## Import Libraries
library("DESeq2")
library("ggplot2")
## Import counts matrix
cts_transcript <- as.matrix(read.csv("../../../data/bernardo/processed/04.deseq2/transcript_counts_unfiltered.tsv", sep="\t", row.names="transcript_id"))
cts_gene <- as.matrix(read.csv("../../../data/bernardo/process... |
8e0b9321ce9213e84b0d89d244230acf7635d900f7b8b66db05cd621c66a81f7 | R | 3,393 | 90 | #!/usr/bin/Rscript
## Import Libraries
library("DESeq2")
library("ggplot2")
## Import counts matrix
cts_transcript <- as.matrix(read.csv("../../../data/bernardo/processed/04.deseq2/transcript_counts_unfiltered.tsv", sep="\t", row.names="transcript_id"))
cts_gene <- as.matrix(read.csv("../../../data/bernardo/process... |
978c921f7dd5a517da851247bb7ddb4d678064d587e246686e5cb363f2d97423 | R | 3,398 | 111 | #' Random forests
#' @title Random forests
#' @param spec,env a data.frame object.
#' @param byrow a logical value, if TRUE, the 'spec' on the rows.
#' @param seed a integer value.
#' @param x a rand_forest object.
#' @param ... extra parameters.
#' @return a rand_forest object.
#' @rdname random_forest
#' @examples \d... |
1b8320ca603202f067f720af84b5c3f86078fe47069d5cbe352a68483017cfb5 | R | 3,403 | 99 | ---
title: "sc2marker with MCA-spleen (Mouse)"
author: "sc2marker"
date: "`r format(Sys.time(), '%d %B, %Y')`"
output:
html_document:
toc: yes
toc_depth: 3
toc_float:
collapsed: false
smooth_scroll: false
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
suppressMessages(libr... |
b1580dd3435b7d9b202e201de4b683c8e4a3656dd79b3f67b9b3ea876b108664 | R | 3,403 | 76 | library(data.table)
library(stringr)
### Read in name files
otter_gene_names <- fread("C:/STUDIES/RESEARCH/ODE_project_local_old/mias_bcell_data/otter_gene_names_mias_conv.csv")
otter_tf_names <- fread("C:/STUDIES/RESEARCH/ODE_project_local_old/mias_bcell_data/otter_tf_names_mias_conv.csv")
### Clean validation chip... |
cd44301ed35d19e5feb37f3bfb686fb681a75ba4a00e9e24c66a975894410e0f | R | 3,415 | 90 | #!/usr/bin/Rscript
## Import Libraries
library("DESeq2")
library("ggplot2")
## Import counts matrix
cts_transcript <- as.matrix(read.csv("../../../data/bernardo/processed/04.deseq2/transcript_counts_unfiltered.tsv", sep="\t", row.names="transcript_id"))
cts_gene <- as.matrix(read.csv("../../../data/bernardo/process... |
fc9549716a968a602fd596921906e1b0e251e46ab2a5f1295dde9a15789d9773 | R | 3,415 | 56 | #!/usr/bin/env Rscript
# /users/k1642468/commonmind/Rodrigo/TWAS_HERVs_SCZ/annotate_rsids_in_bim_file.R
# This script is gonna extract genomic coordinates to create a temporary SNP name (chr_bp), and it will match this information to a non-redudant database of genomic coordinates containing rsids, based on snp151.
lib... |
7d395e0a14dfe9c06f4e0eafbb5a2499fa5ea31042813ab981e01fa23c905ec1 | R | 3,418 | 90 | #!/usr/bin/Rscript
## Import Libraries
library("DESeq2")
library("ggplot2")
## Import counts matrix
cts_transcript <- as.matrix(read.csv("../../../data/bernardo/processed/04.deseq2/transcript_counts_unfiltered.tsv", sep="\t", row.names="transcript_id"))
cts_gene <- as.matrix(read.csv("../../../data/bernardo/process... |
5cd3668f1cb3812c8b6a062e371ae94e4bf7dc96a811dad036369865e95c5bba | R | 3,427 | 78 | #!/usr/bin/env Rscript
# Read in metadata
meta.technical = read.delim('cayo_brain_bulk_metadata_technical_final.txt',stringsAsFactors=FALSE)
meta.animal = read.delim('cayo_brain_bulk_metadata_animals_final.tsv',stringsAsFactors=FALSE)
# Split dataset by sex and scale ranks for each sex
meta.animal.split = split(meta.... |
8acc04c7e73cdf9def2fbb840f951a1b97f85b7f2e4b63086d595106d0265c47 | R | 3,433 | 92 | library(DESeq2)
library(gplots)
library(tibble)
args <- commandArgs(trailingOnly = TRUE)
jobID <- args[1]
tablePath <- args[2]
inputFolder <- args[3]
outputFolder <- paste("./tmp/", jobID, sep = "")
sampleTable <- read.csv(tablePath, sep = "\t")
for (readType in c("exonic", "intronic"))
{
print(paste("Analyzin... |
86abc9c5a745be20a3fadede3bf56351db7840247ffe31490531e66a2d45319f | R | 3,434 | 90 | #' Imputation by multivariate predictive mean matching
#'
#' Imputes multivariate incomplete data among which there are specific relations,
#' for instance, polynomials, interactions, range restrictions and sum scores.
#' @aliases mice.impute.mpmm mpmm
#' @param data matrix with exactly two missing data patterns
#' @pa... |
e7bbec74263853592207a081bf3a371030cd8dee12e8e48ba217a782dc1aa5f9 | R | 3,443 | 90 | #!/usr/bin/Rscript
## Import Libraries
library("DESeq2")
library("ggplot2")
## Import counts matrix
cts_transcript <- as.matrix(read.csv("../../../data/bernardo/processed/04.deseq2/transcript_counts_unfiltered.tsv", sep="\t", row.names="transcript_id"))
cts_gene <- as.matrix(read.csv("../../../data/bernardo/process... |
3d1c3df475ba94754e966a29e904596bd3ad3e5d43e6554ba7c8bcd6e0392c9e | R | 3,447 | 92 | #' Fetch online genome annotations from Ensembldb database
#'
#' @param EnsDb_annotations (EndsDb object) - Ensembldb database (default: EnsDb.Hsapiens.v86::EnsDb.Hsapiens.v86
#'
#' @return gene_range (GRanges object) - Genome annotations
#' @export
#'
#' @examples gene_range = get_genome_annotations(EnsDb.Hsapiens.v8... |
2a7e514669fd60a9eaa4146ebac6239aba5c332c449f8161c9946719fac62356 | R | 3,455 | 92 | #' Impute multilevel missing data using \code{pan}
#'
#' This function is a wrapper around the \code{panImpute} function
#' from the \code{mitml} package so that it can be called to
#' impute blocks of variables in \code{mice}. The \code{mitml::panImpute}
#' function provides an interface to the \code{pan} package for
... |
2c7926e23c58e2c1ba007fee6a6143a38c660f4d3a8f687b313d6fc6e2d126eb | R | 3,455 | 94 | #' Plot exon and domain architectures
#'
#' @param object factR object class
#' @param x Feature to plot. Can be the following:
#' \itemize{
#' \item{gene_id: }{ID of gene to plot}
#' \item{gene_name: }{Name of gene to plot}
#' \item{transcript_id: }{ID of transcript to plot}
#' \item{AS_id: }{ID of alternative spl... |
1280941211cf82538641e85d8a5edf4a84e088e5e37d51058516d730740060c8 | R | 3,462 | 81 | library(tidyverse)
library(biomaRt)
library(ggpubr)
# Get DEA Info
Ctx_DEA_Res <- read.csv("allctx.AllSamps.SexFilt.CompModel.csv")
Ctx_DEA_Res <- Ctx_DEA_Res %>%
dplyr::mutate(Ranks = abs(log2FoldChange)*(-log10(pvalue))) %>%
dplyr::mutate(Significance = (-log10(pvalue))) %>%
dplyr::arrange(desc(Ranks)) %>%... |
d2b552e8f5efb4506fc04612042740e5c9bf4e11539095e3244e818e632bb140 | R | 3,464 | 90 | #!/usr/bin/Rscript
## Import Libraries
library("DESeq2")
library("ggplot2")
## Import counts matrix
cts_transcript <- as.matrix(read.csv("../../../data/bernardo/processed/04.deseq2/transcript_counts_unfiltered.tsv", sep="\t", row.names="transcript_id"))
cts_gene <- as.matrix(read.csv("../../../data/bernardo/process... |
bcf1b5806140d2b5274c7287e8480501036467b2f94bc96dfb28f563b9205c4b | R | 3,467 | 126 | library(readxl)
library(dplyr)
library(DESeq2)
library(ggplot2)
library(EnhancedVolcano)
############################################
# Plot Function
library(scales)
numColors <- 2 # How many colors you need
getColors <- scales::brewer_pal('qual', palette = "Set1")
names(myPalette) <- c("env", "other")
############... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.