sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
f5a684b12bcf36349e7c18afdbf7791758daa65787da2e680ddbc1fc3d9df5f1 | R | 51,224 | 1,054 | intervals.centers <- function(inv){
inv[,2:3]<-floor((inv[,2]+inv[,3])/2)
inv[,3]<-inv[,3]+1
return(inv)
}
intervals.2d.centers <- function(inv){
inv[,2:3]<-floor((inv[,2]+inv[,3])/2)
inv[,3]<-inv[,3]+1
inv[,5:6] = floor((inv[,5]+inv[,6])/2)
inv[,6] = inv[,5] + 1
return(inv)
}
intervals.expand <- funct... |
99767a1a3f19ae08b978c27df3a109199f075224797f2267d5760256e34fbdc3 | R | 51,520 | 802 | ---
title: "FIGURE 2 ANALYSIS"
output: html_notebook
---
NOTES:
- Cluster category names in the paper are different from what appears in the final paper, cluster category names are labeled in the paper according to the number of cells in the category (ie H108), rather that the original clustering (ie. K116)
- Brian g... |
d4c5ea1818f5a456ab29aebc5c2f454fbcedd0f0da1204fd79af7b66f7e6a2fe | R | 51,727 | 1,231 | ############################################
### Analysis to examine scaling relative
### to whole brain volume. This might provide
### even better understanding of the data.
###
### There are 7 main analyses:
### 1. Q: Check outliers in BrainVol. Also see how constant ratios (vs. BrainVol) are intraspecifically. A: N... |
13c9c0ac9cb75d533a21f93df565a8320a69e97e2a5968c55e4f6d34efa0fb35 | R | 52,326 | 726 | ## Author: Youtao Lu <luyoutao@sas.upenn.edu>
## Copyright (c) 2017-2023, Youtao Lu and Junhyong Kim, Department of Biology, University of Pennsylvania
## Copyright (c) 2017-2023, James Eberwine, Perelman School of Medicine, University of Pennsylvania
## All Rights Reserved.
## This Source Code Form is subject to th... |
ade06699bc7834cacd04dc2c5f69d8b303343a61ca29802849e92794f9af69c5 | R | 52,954 | 1,025 |
palette.breaks = function(n, colors, breaks){
colspec = colorRampPalette(c(colors[1],colors[1]))(breaks[1])
for(i in 2:(length(colors)) ){
colspec = c(colspec, colorRampPalette(c(colors[i-1], colors[i]))(abs(breaks[i]-breaks[i-1])))
}
colspec = c( colspec,
colorRampPalette(c(colors[length... |
3d6c4ab5dba7cf5270ecb105f55ac8c359e4258a051e5ff4d8a5118a0e5eb3ec | R | 53,078 | 726 | ## Author: Youtao Lu <luyoutao@sas.upenn.edu>
## Copyright (c) 2017-2023, Youtao Lu and Junhyong Kim, Department of Biology, University of Pennsylvania
## Copyright (c) 2017-2023, James Eberwine, Perelman School of Medicine, University of Pennsylvania
## All Rights Reserved.
## This Source Code Form is subject to th... |
db1f75432e44753feacef06767490d2643a86d4e0c955549b1eb670d94f2dde0 | R | 53,865 | 2,087 | ---
title: "Day 0 to Day 36 Inner Ear Organoid scRNA-seq"
author: "Matt Steinhart"
date: "1/19/2021"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r load libraries, include=FALSE}
library(Seurat)
library(dplyr)
library(cowplot)
library(harmony)
library(SingleCellE... |
7dceae6f9a96b70202120750429b691eeff653e7f3576fea033f330920fba1d6 | R | 54,016 | 1,304 | ---
title: "Primary_GCN_ukbec"
author: "Amy Hicks"
date: "15/12/2021"
output:
html_document:
code_folding: hide
toc: true
toc_float: true
df_print: paged
---
```{r setup, include=FALSE, results = FALSE}
library(CoExpNets)
library(CoExp10UKBEC)
library(biomaRt)
library(tidyverse)
library(knitr)
librar... |
a8b454effd587bab5fab783b055841d423d143c10d4260e9f391fae309697e2e | R | 54,118 | 1,016 | library(tidyverse)
library(gg3D)
library(ggpubr)
library(patchwork)
#Process function to add condition ids and duplicate ids
process_embeddings <- function(embbedings,dataInfo,sampleInfo){
dataInfo <- dataInfo %>% select(sig_id,cmap_name,duplIdentifier) %>% unique()
sampleInfo <- suppressMessages(left_join(samp... |
16e8707b75dcf09ec074181c3de15ea0991321cc8a207da3337541f4cd89aef7 | R | 54,370 | 1,239 | library(dplyr)
GenerateTrainingData <- function(m, Nk, training_prefix, logThetaMin, logThetaMax, logAlphaMin, logAlphaMax, logSigmaSqMin, logSigmaSqMax, empiricalFile) {
library(mvtnorm) # For multivariate Gaussian distribution
scenarios <- c("redundant", "unique")
conditions <- seq(1, m)
# m condition... |
960aea050b47026c46af3e31ea2c225a08f2fcfe20f461e5ad4227d7260d4249 | R | 54,458 | 1,190 | # cell proportion
# all cell
merFISH_integrated = readRDS(file = "./RDS/merFISH_final.0827.RDS")
merFISH_integrated$CT = as.character(merFISH_integrated$CellType)
merFISH_integrated$CT[!merFISH_integrated$CT %in% c("Ext", "Inh")] <- "Non-neuron"
plot_cell_proportion = function(obj, label){
cell_prop = as.data.fra... |
ed731df0b80c94b5166b060d378f6eb56a9254f762e6ddac0a8347c873d514be | R | 54,603 | 992 | ## to replicate conda environment used in paper, install conda, and then call the following in terminal: conda env create -f environment_droplet.yml - yml file here: https://github.com/brianherb/HumanHypothalamusDev/blob/main/environment_droplet.yml
library(SingleCellExperiment)
library(Seurat)
library(scDblFinder)
li... |
fbf8f0ce3ea7711dbd2d5cac1e9605b12ed14d0b49ce983894a1b15004dc9945 | R | 54,935 | 1,354 | ## to replicate conda environment used in paper, install conda, and then call the following in terminal: conda env create -f environment_droplet.yml - yml file here: https://github.com/brianherb/HumanHypothalamusDev/blob/main/environment_droplet.yml
library(Seurat)
library(limma)
library(plotly)
library(htmlwidgets)
l... |
2471d2d26ca2135d03365f751dcf4eb6d7df96b025935eeaf10d866e26cb7467 | R | 54,967 | 1,217 | ---
title: "CoExp_brain"
author: "Amy Hicks"
date: "15/10/2021"
output:
html_document:
code_folding: hide
toc: true
toc_float: true
df_print: paged
---
```{r setup, include=FALSE}
library(CoExpNets)
library(CoExpGTEx)
library(CoExp10UKBEC)
library(biomaRt)
library(tidyverse)
library(knitr)
library(gg... |
321ce4f09c9a2a6630a33847ae9bdc59280f90f423b310bf983f3bfdb5e9e8f9 | R | 55,149 | 1,223 | ---
title: "CoExp_brain"
author: "Amy Hicks"
date: "15/10/2021"
output:
html_document:
code_folding: hide
toc: true
toc_float: true
df_print: paged
---
```{r setup, include=FALSE}
library(CoExpNets)
library(CoExpGTEx)
library(CoExp10UKBEC)
library(biomaRt)
library(tidyverse)
library(knitr)
library(gg... |
c38890d24962899f5cd02e18b565772ce68d0a69d264dba8e5b16b9d9ad809ad | R | 55,570 | 1,080 | options(gganimate.renderer = gifski_renderer())
server <- function(input, output, session) {
safe_min_age <- function(df, fallback) {
if (nrow(df) == 0) return(fallback)
return(min(df$Age))
}
# Instantiate progress bar
updateProgressBar(session, id = "pbRun", value = 0, title = "Awaiting input..."... |
300f5830c41af1b449b634fbd8433329740fcb50cde8988271634b10dcca8341 | R | 55,783 | 1,246 | #' draw an oncoplot
#' @description takes output generated by read.maf and draws an oncoplot
#'
#' @details
#' Takes an \code{\link{MAF}} object as an input and plots it as a matrix. Any desired clincal features can be added at the bottom of the oncoplot by providing \code{clinicalFeatures}.
#' Oncoplot can be sorted e... |
c4bb6f9d06c8649604a6189d71df56c37f871af358ac3b74c4bc04f30081e052 | R | 56,587 | 942 | ---
title: "maftools : Summarize, Analyze and Visualize MAF Files"
author: "Anand Mayakonda"
date: "`r Sys.Date()`"
output:
html_document:
toc: true
toc_depth: 3
toc_float: true
number_sections: true
self_contained: yes
css: corp-styles.css
highlight: pygments
vignette: >
%\VignetteInde... |
ef3c49fff887cb004ecb141c2de17fcee673ce57fbb76709def592647e3d42a3 | R | 56,621 | 1,013 | # mpra tools
# Stephen P. Plassmeyer
# updated March 31, 2020
##########################################################################################################################################################
# To Do's
# * get all the functions on board with the proper data nomenclature
#
# * beautify the code... |
b027b07e0dd4ee62a3bb93a9eca27540d5cd288b3616b45e4dbba198a239447c | R | 56,974 | 1,325 | ---
title: "ARACNe_analysis"
author: "Amy Hicks"
date: "15/12/2021"
output:
html_document:
code_folding: hide
toc: true
toc_float: true
df_print: paged
---
```{r setup, include=FALSE}
library(biomaRt)
library(tidyverse)
library(CoExpGTEx)
library(CoExp10UKBEC)
library(CoExpNets)
library(knitr)
librar... |
0be3ac0bd16f5060a7a9a0b86cacbc3f58ecfdbb78ea741142cb6ecf18fbf27f | R | 57,003 | 1,326 | ---
title: "ARACNe_analysis"
author: "Amy Hicks"
date: "15/12/2021"
output:
html_document:
code_folding: hide
toc: true
toc_float: true
df_print: paged
---
```{r setup, include=FALSE}
library(biomaRt)
library(tidyverse)
library(CoExpGTEx)
library(CoExp10UKBEC)
library(CoExpNets)
library(knitr)
librar... |
a40dec6c0d57b5c3d3b146bd04c6af6fa22cc1d40913e0adefa4c7f0ad924a12 | R | 60,037 | 1,454 | ## LOAD PACKAGES ----------
# Data manipulation
library(tidyverse)
library(rlist)
library(readxl)
# Plots and visualizations
library(grid)
library(viridis)
library(ggrepel)
library(ggpubr)
library(svglite)
# Statistics
library(rstatix)
# library(emmeans)
# library(multcomp)
# library(multcompView)
# ENSEMBL
libra... |
405ec5ee0884825aab027b8f97c8b3a90c32ef4a18295b5355c5c1aaf890e63e | R | 60,165 | 814 | ######################################################################################################################
## ANOVA / DiffEx Functions
##
## parANOVA.dex() - output ANOVAout dataframe for all pairwise comparisons of each cleanDat gene product (row)
## among specified sample groups i... |
71de28f6a89eafbed08061dbb74dcc3bb88b28b6caf2a2c29753701465eb29be | R | 60,165 | 1,620 | # Libraries
library(patchwork)
library(Seurat)
snapshot <- "/lab-share/RC-Data-Science-e2/Public/DST_software/pipeline_R_snapshot/r4.1-20220803-bch-dst-v1/"
.libPaths(snapshot)
library(SeuratDisk)
library(ggplot2)
library(Nebulosa)
library(pbapply)
library(ggrepel)
library(harmony)
library(dplyr)
tpColors <- tenColor... |
0876e3c47d075b7b71c0411ea48da593b0ad7b459b0ffc6882d02b4ea76be71a | R | 62,534 | 1,553 | library(Hmisc)
palette.breaks = function(n, colors, breaks){
colspec = colorRampPalette(c(colors[1],colors[1]))(breaks[1])
for(i in 2:(length(colors)) ){
colspec = c(colspec, colorRampPalette(c(colors[i-1], colors[i]))(abs(breaks[i]-breaks[i-1])))
}
colspec = c( colspec,
colorRampPalette(c... |
acb1dcdeba6d8f7b4cbd3d470a9387ae63698cafebe4e1962b5de1b17f2d6fcf | R | 62,557 | 1,553 | library(Hmisc)
palette.breaks = function(n, colors, breaks){
colspec = colorRampPalette(c(colors[1],colors[1]))(breaks[1])
for(i in 2:(length(colors)) ){
colspec = c(colspec, colorRampPalette(c(colors[i-1], colors[i]))(abs(breaks[i]-breaks[i-1])))
}
colspec = c( colspec,
colorRampPalette(c... |
d4eeaa0ac6d5f9174dcb7e550baf5de2f2b8da6f5a8b1e3d1201548fe517c10f | R | 62,616 | 1,553 | library(Hmisc)
palette.breaks = function(n, colors, breaks){
colspec = colorRampPalette(c(colors[1],colors[1]))(breaks[1])
for(i in 2:(length(colors)) ){
colspec = c(colspec, colorRampPalette(c(colors[i-1], colors[i]))(abs(breaks[i]-breaks[i-1])))
}
colspec = c( colspec,
colorRampPalette(c... |
c13bfe657daa407b35ca16210edb1e8e3a0439e3167c3a72939182288a13c935 | R | 65,745 | 1,268 |
### ------------------------------------------- ###
# Statistics and visualization of the raw
# (i.e., non-phylogenetically corrected) data
# Roberto Toro, Katja Heuer 2018
# Script adapted by N. Magielse for inclusion of
# cerebellar data and additional visualizations/
# normality checks - 2022
### ---------------... |
6614b9346218d0d537cde151d97dec6a2ad5e3a1d56f2a76d225014946293b83 | R | 66,398 | 1,520 | ---
title: "Sec_GCN_gtex"
author: "Amy Hicks"
date: "16/12/2021"
output:
html_document:
code_folding: hide
toc: true
toc_float: true
df_print: paged
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(tidyverse)
library(ggplot2)
library(devtools)
library(CoExpNets)
library(CoEx... |
df14cf378b2c10e3a17c0e7ccf6d9b70a79e4ac46f15a68465de208590adb88d | R | 67,252 | 1,622 | # run merFISH basic analysis
setwd("/nfs4/chaozhang/proj/Neuron/Aritra/merFISH/script")
# init
source("merFISH_pipeline.R")
source("functions.R")
update_geom_defaults("point", list(shape = 16))
### run pipeline per sample
#
merFISH_mouse0.1 = merFISH_pipeline("../data/20210911_PFCL1", "mouse0.1")
merFISH_mouse0.2... |
5152eea842310c4ee461de0ec0b3d69b5edf6e17c5873237dcedab184538390f | R | 67,920 | 1,547 | ---
title: "Sec_GCN_gtex"
author: "Amy Hicks"
date: "16/12/2021"
output:
html_document:
code_folding: hide
toc: true
toc_float: true
df_print: paged
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(tidyverse)
library(ggplot2)
library(devtools)
library(CoExpNets)
library(CoEx... |
e678819df74164b8eaee3f57bb9bc51d86781a2aea8ceacda5549c6c2553d4af | R | 67,991 | 2,055 | ---
title: "Systematic Functional Dissection of Common Genetic Variation Affecting Red Blood Cell Traits"
output: html_document
---
<br></br>
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
Scripts to reproduce the analyses presented in:
Jacob C. Ulirsch, Satish K. Nandakumar, Li Wang, Felix C. G... |
a6cbee2cce19e4e3c8382a75eef7b25a1fa239a840392749794842b60d9f6b52 | R | 70,450 | 1,223 | require(magicaxis)
archr_colors <- ArchR::ArchRPalettes
clusters_image <- function(data, clust, fig.fn, K, shades=colorRampPalette(c("blue", "black", "yellow")),
shade_count=3, zlim=c(0,1),
image_to_file=T, width=600, height=1400,label=NULL)
{
if (is.null(dim(data))) {
mat = as.m... |
d5f3b2e1711942ef061a0858eae317c10248d761ce11c0262f67c32278732254 | R | 72,127 | 1,876 | ---
title: "HCP racial identity structural analysis"
author: "daniel atilano"
date: "30/4/2022"
output:
rmdformats::material:
highlight: kate
---
```{r setup2, include=FALSE}
library(readr)
library(tidyr)
library(dplyr)
library(ggplot2)
library(rmdformats)
library(gtsummary)
library(gt)
library(lmPerm)
library(gg... |
69814103059b7840fb6f795a2979171ddbdeb4600605a10622c00a180211202f | R | 74,398 | 2,022 | # Libraries
library(patchwork)
library(Seurat)
snapshot <- "/lab-share/RC-Data-Science-e2/Public/DST_software/pipeline_R_snapshot/r4.1-20220803-bch-dst-v1/"
.libPaths(snapshot)
library(SeuratDisk)
library(ggplot2)
library(Nebulosa)
library(pbapply)
library(ggrepel)
library(harmony)
library(dplyr)
tpColors <- tenColor... |
bb4927f3dd27f323e7991713acbdb2648e9926230b7ba5bb02df0231178ec3dc | R | 74,681 | 2,061 | # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# PlotTwist: Shiny app for plotting and comparing continuous data, with a focus on time-dependent data
# Created by Joachim Goedhart (@joachimgoedhart), first version 2018
# Takes non-tidy, spreadsheet type data as input assuming fir... |
332bf592be5afec882c6047ef39fb8b224c3ba50a6c54c15deb791e35fd7c622 | R | 76,578 | 1,947 | ---
title: "Filtering dataset and DEA iPSC-DA BFP sorting and MPP treatment"
author: "J Monzón Sandoval"
date: 'Last update: `r date()`'
output:
html_document:
theme: lumen
toc: yes
number_sections: true
toc_float:
collapsed: yes
smooth_scroll: yes
---
```{r setup, includ... |
a8869206c1f35f4b0882aa6b109edfd6bff73cdb6e68a4b09ef7c230e50755e1 | R | 76,756 | 1,742 | ---
title: "Primary_GCN_gtex"
author: "Amy Hicks"
date: "15/12/2021"
output:
html_document:
code_folding: hide
toc: true
toc_float: true
df_print: paged
---
```{r setup, include = FALSE, results = FALSE}
library(CoExpNets)
library(CoExpGTEx)
library(CoExp10UKBEC)
library(biomaRt)
library(tidyverse)
l... |
15e51349cddcebd2e31b6c41b7c5143ec388b48ee8a1dc4720ce60f5d246026b | R | 78,935 | 918 | #####################################################
####Project prenatal infection/multimodal imaging####
#####################################################
#Project: Long-term effects of prenatal infection on the human brain: a prospective multimodal neuroimaging study (in the Generation R cohort)
#Author: Anna... |
1563a8f6921be24cfd5d217ac5a19c50a6390f721a83c1b67ee4a9f3aae442ea | R | 81,013 | 2,235 | ---
title: "DCN - Stage2 Analyses"
author: "<h3>by Michael Demidenko</h3>"
date: "`r format(Sys.time(), '%B %Y')`"
output:
html_document:
theme: united
highlight: tango
toc: yes
number_sections: yes
toc_depth: 2
toc_float:
collapsed: yes
smooth_scroll: yes
code_folding: hide
... |
283bbbba37422193ceb8a79c191921c76adce9aea7cb6353a1bb3beeffbde3f7 | R | 81,034 | 1,896 | # Script from: How hibernation in frogs drives brain and reproductive evolution in opposite directions
#
# Wen Bo Liao1,2,3, Ying Jiang1,2,3, Long Jin1,2,3 & Stefan Lüpold4
#
# Affiliations:
# 1 Key Laboratory of Southwest China Wildlife Resources Conservation (Ministry of Education), China West Normal Universi... |
2e28b2383895258dbacbe16b0aa199cbc8848e9593ee832ee9ffef487a3ade3d | R | 81,938 | 2,248 | ---
title: "DCN - Stage2 Analyses"
author: "<h3>by Michael Demidenko</h3>"
date: "`r format(Sys.time(), '%B %Y')`"
output:
html_document:
theme: united
highlight: tango
toc: yes
number_sections: yes
toc_depth: 2
toc_float:
collapsed: yes
smooth_scroll: yes
code_folding: hide
... |
548b00a82d7d3f48efbdfa81e56a18954f98218647a4d445327ae2e36bb5686b | R | 82,830 | 1,516 | require(magicaxis)
archr_colors <- ArchR::ArchRPalettes
clusters_image <- function(data, clust, fig.fn, K, shades=colorRampPalette(c("blue", "black", "yellow")),
shade_count=3, zlim=c(0,1),
image_to_file=T, width=600, height=1400,label=NULL)
{
if (is.null(dim(data))) {
mat = as.m... |
f643b0f75e9842c8704d1b80af329839a5e542538d1f5bfe0aca497ce588a690 | R | 84,044 | 1,515 | ##########################################################################
#' Classify domains based on trans contacts into k number of compartments
#'
#' \code{analyzeCompartments}
#'
#' This function calculates the trans contacts between domains and clusters them into k number of compartments as described by Nagano ... |
298815a03ed67470ef3fbc070d27c8df5ab8db94a4869ce6469c9a7474abb83c | R | 84,715 | 1,518 | ##########################################################################
#' Classify domains based on trans contacts into k number of compartments
#'
#' \code{analyzeCompartments}
#'
#' This function calculates the trans contacts between domains and clusters them into k number of compartments as described by Nagano ... |
9a2729058fb3d032b0806c793207e0d0108bdc0fe7016087943fb6207a7fc24a | R | 86,658 | 1,557 | intervals.centers <- function(inv){
inv[,2:3]<-floor((inv[,2]+inv[,3])/2)
inv[,3]<-inv[,3]+1
return(inv)
}
intervals.2d.centers <- function(inv){
inv[,2:3]<-floor((inv[,2]+inv[,3])/2)
inv[,3]<-inv[,3]+1
inv[,5:6] = floor((inv[,5]+inv[,6])/2)
inv[,6] = inv[,5] + 1
return(inv)
}
intervals.expand <- funct... |
040e9e42c52810d17256f0c71c1f7de6052746822b994c2d5f5252c220a6d0c5 | R | 87,799 | 1,664 | ---
title: "Evaluating Effect of DNA Replication on N2a TRAP Results"
author: "Stephen P Plassmeyer"
date: "10/13/2020"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
source('../../code/mpra_tools/mpra_tools.r')
library(ggpubr)
library(patchwork)
library(onewaytests)
library... |
fb4e02b8c40cf2b98dc522c36c8eaaf22aa6a5932efa7e44f4495db7eed05872 | R | 92,537 | 2,848 |
# helper functions ---------------------------------------------------------------------
#' Prints progress of files in list of files
#'
#' @param item item in for loop
#' @param list_of_files list, where the item comes from
#' @param start Sys.time() of start, used to calculate the time difference
#' @param str... |
447a96cf3f4df888aff25866c26107ab534176c958764caf419775440ab643e2 | R | 92,581 | 2,848 |
# helper functions ---------------------------------------------------------------------
#' Prints progress of files in list of files
#'
#' @param item item in for loop
#' @param list_of_files list, where the item comes from
#' @param start Sys.time() of start, used to calculate the time difference
#' @param str... |
4baf265c693d337e638ab5cc05661cf3388a87f3bff9e78429d6a150d761686a | R | 92,657 | 2,849 |
# helper functions ---------------------------------------------------------------------
#' Prints progress of files in list of files
#'
#' @param item item in for loop
#' @param list_of_files list, where the item comes from
#' @param start Sys.time() of start, used to calculate the time difference
#' @param str... |
42339e3a92c5f3f605fbf98f0e9e7580f1c059a5a727adde9a6a238b66292674 | R | 93,082 | 2,509 | # Libraries
library(patchwork)
library(Seurat)
snapshot <- "/lab-share/RC-Data-Science-e2/Public/DST_software/pipeline_R_snapshot/r4.1-20220803-bch-dst-v1/"
.libPaths(snapshot)
library(SeuratDisk)
library(ggplot2)
library(Nebulosa)
library(pbapply)
library(ggrepel)
library(harmony)
library(dplyr)
tpColors <- tenColor... |
10951fe93a8a4e9b74e844649349cbb122185e5962029c707d0405b68935ab7d | R | 95,233 | 1,944 | library(tidyverse)
library(caret)
library(Rtsne)
library(factoextra)
library(ggplot2)
library(ggpubr)
library(ggpattern)
library(ggridges)
library(ggVennDiagram)
library(umap)
library(corrplot)
library(reshape2)
library(EGSEAdata)
library(fgsea)
library(topGO)
library(AnnotationDbi)
library(org.Hs.eg.db)
library(cluste... |
b383e6576b36dd303eb654a96f78878a2312b243360c51f706a1d621321f1feb | R | 95,478 | 1,708 | intervals.centers <- function(inv){
inv[,2:3]<-floor((inv[,2]+inv[,3])/2)
inv[,3]<-inv[,3]+1
return(inv)
}
intervals.2d.centers <- function(inv){
inv[,2:3]<-floor((inv[,2]+inv[,3])/2)
inv[,3]<-inv[,3]+1
inv[,5:6] = floor((inv[,5]+inv[,6])/2)
inv[,6] = inv[,5] + 1
return(inv)
}
intervals.expand <- funct... |
e7855dea590d2e17f6d66720a06e36450df24fe4a52d29fa04e82d328ab5c512 | R | 100,995 | 2,302 | library(coin)
library(vegan)
# Microbiome scripts
# by: Ranko Gacesa, UMCG
# ==============================================
doMicrobiomeAdonis <- function(inDF,
idCol = "ID",
permNR = 10000,
adonisVarsTouse,
... |
89ced33b4c4fe6d75eade153bd87eb2d1441796fab08b5d64c5241e9551b3c02 | R | 104,059 | 2,861 | # Libraries
library(patchwork)
library(Seurat)
snapshot <- "/lab-share/RC-Data-Science-e2/Public/DST_software/pipeline_R_snapshot/r4.1-20220803-bch-dst-v1/"
.libPaths(snapshot)
library(SeuratDisk)
library(ggplot2)
library(Nebulosa)
library(pbapply)
library(ggrepel)
library(harmony)
library(dplyr)
tpColors <- tenColors... |
c835073267884b70fc0236faa5fa8cd5fda0f8e9e27f6370a9f23da5c4ee1253 | R | 106,200 | 1,851 | #### Master Script 03: Visualise study results for manuscript ####
#
# Shubhayu Bhattacharyay
# University of Cambridge
# email address: sb2406@cam.ac.uk
#
### Contents:
# I. Initialisation
# II. Figure 2: Distributions of TIL and alternative scales.
# III. Figure 3: Associations of TIL and alternative scales with othe... |
3f25339a0913992d8ec0fdf39dffa18e034f48a032b4ec6f4ad1910b8d53bc02 | R | 106,679 | 2,460 | # =========================================================
# by R.Gacesa (UMCG, 2019)
#
# MISC FUNCTIONS for plotting, microbiome stuff ...
#
# NOTE:
# > also includes some functions written by Dr. Alexander Kurilshikov (UMCG)
# =============================================================================
li... |
32273515c848a903e949180197a572c4a9015d86ceaef7fc26acc76c826691dd | R | 146,021 | 2,817 | # Machine Learning scripts for microbiome analysis
#
# by: Ranko Gacesa,
# Weersma Group,
# UMCG (2019)
# ==============================================
library(caret)
library(plotROC)
library(pROC)
# helper function for exctracting best tuning prediction data from Caret model
# =================... |
942a03d12ef7ad6d36b87fa19eb7df966b3d7796434936f4b1d095d8087d0b03 | R | 149,519 | 2,471 | # mpra tools
# Stephen P. Plassmeyer
# updated November 18, 2020
##########################################################################################################################################################
# To Do's
# * get all the functions on board with the proper data nomenclature
# * get_count... |
dd85d7599a0f47b4e332ee435bc0137ad493870a0954c685d8ead168db173818 | R | 152,504 | 3,183 | ####
##################################################################
# README
#
# Helper functions to streamline the QC and covariate analysis
#
# can be used with the output from step2 or step3
#
# I STRONGLY RECOMMEND RUNNING THIS TO AN EMPTY DIR AS
# IT ISN'T GUARRANTEED THAT OLD RESULTS ARE OVERWRITTEN... |
49a3891e907fc0c3f12a58ecca20844571471f9839b12efa2394e33c7988dce8 | R | 176,065 | 3,353 | ---
title: "Liostenogaster flavolineata analysis"
author: "Benjamin Taylor"
date: "2020/11/13"
output:
html_document:
code_folding: hide
self_contained: FALSE
fig_width: 10
fig_height: 10
pdf_document: default
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = F, message = F, warning =... |
7c4f6be5251c758bfab4b784d093f7bae470b1fd719eff7ac255bf21003dd195 | R | 200,014 | 4,183 | ---
title: 'Temporal Dynamics of Normalization Reweighting'
author: |
| Daniel H. Baker, Daniela Marinova, Richard Aveyard, Lydia J. Hargreaves, Alice Renton,
| Ruby Castellani, Phoebe Hall, Miriam Harmens, Georgia Holroyd, Beth Nicholson,
| Emily L. Williams, Hannah M. Hobson & Alex R. Wade
date: "Department o... |
b17384b458d70fe2ba30d102be9c023caf9730cebf813441355fc3f6848de76c | Rust | 32 | 1 | pub use seqpro_core::ragged::*;
|
2ca4b4fbb8e95cbc3a5c40037f647062f9cffbe5b5c3272abb9847b424ea35a3 | Rust | 40 | 2 | pub mod ragged;
pub use ragged::Ragged;
|
dda6d6ce30ecfb90f57899de8a3b930174bfdc591ddd2e6f2818566ec9c0431e | Rust | 66 | 3 | use std::result;
pub type Result<T> = result::Result<T, String>;
|
ab5f7ea080dd2a938fe7f0fe21439a62abd27acd73a4289ec827aaa264de681b | Rust | 150 | 12 | extern crate libc;
extern crate wkwrap;
mod ffi;
mod util;
mod macros;
mod wkw;
pub use ffi::*;
pub use macros::*;
pub use util::*;
pub use wkw::*;
|
c906d25cf2e776fbe980097da1e2c69f24da277b0931c8c2e400342e90905fc2 | Rust | 233 | 10 | use std::env;
fn main() {
let link_paths = env::var("EXTRALINKPATHS")
.expect("EXTRALINKPATHS not set");
for link_path in link_paths.split(";") {
println!("cargo:rustc-link-search={}", link_path);
}
}
|
e074e71e707b51f7df83767930cec40f764f3b0bbba8d0216058c7932bd04021 | Rust | 363 | 20 | // public modules
pub mod dataset;
pub mod file;
pub mod header;
pub mod mat;
pub mod morton;
pub mod result;
pub mod vec;
// private modules
mod lz4;
// convenience
pub use dataset::Dataset;
pub use file::File;
pub use header::{BlockType, Header, VoxelType};
pub use mat::Mat;
pub use morton::{Iter, Morton};
pub use ... |
2637ac83af7715eb021743a57e0a9071a36067a30c820eb806e444b1faf117d0 | Rust | 525 | 21 | extern crate wkwrap;
#[macro_use]
extern crate wkw_mex;
use wkw_mex::*;
use std::slice;
use std::path::Path;
mex_function!(_nlhs, _lhs, nrhs, rhs, {
let rhs = match nrhs == 2 {
true => slice::from_raw_parts(rhs, nrhs as usize),
false => return Err("Invalid number of input arguments".to_string())
... |
cd7992662d4eb3c395c415d543df2308777e17a71c74817e7e72eb8cdbe6f7c5 | Rust | 754 | 31 | extern crate wkwrap;
#[macro_use]
extern crate wkw_mex;
use wkw_mex::*;
use std::slice;
use std::path::Path;
mex_function!(_nlhs, _lhs, nrhs, rhs, {
let rhs = match nrhs == 3 {
true => slice::from_raw_parts(rhs, nrhs as usize),
false => return Err("Invalid number of input arguments".to_string())
... |
432284ff54bc0fd8621886ce96a3972c4353d59bd4ab06071d50170581a440ca | Rust | 1,006 | 30 | use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion};
use ndarray::Array2;
use seqpro::kshuffle::k_shuffle;
fn make_batch(n_rows: usize, len: usize) -> Array2<u8> {
let mut arr = Array2::<u8>::zeros((n_rows, len));
for (i, mut row) in arr.rows_mut().into_iter().enumerate() {
... |
8609344b1d38bba0e0a3d6e9fe0a13b5d7a906805872efbb9db2c2ec50422c23 | Rust | 1,425 | 48 | extern crate wkwrap;
#[macro_use]
extern crate wkw_mex;
use wkw_mex::*;
use std::slice;
use std::path::Path;
mex_function!(nlhs, lhs, nrhs, rhs, {
let rhs = match nrhs == 2 {
true => slice::from_raw_parts(rhs, nrhs as usize),
false => return Err("Invalid number of input arguments".to_string())
... |
17193fc7e73d59e3ba7e303c48cb2e822eb1e3173832f934328c45acfce7e5cd | Rust | 2,015 | 66 | extern crate lz4 as lz4_crate;
use self::lz4_crate::liblz4;
use Result;
pub fn compress_bound(input_size: usize) -> usize {
unsafe { liblz4::LZ4_compressBound(input_size as i32) as usize }
}
pub fn compress(src_buf: &[u8], dst_buf: &mut [u8]) -> Result<usize> {
let src_size = src_buf.len() as i32;
let dst... |
8ce66cc0fc2af4ccc5ada37542defbc4e79387869aa8f007f779ba02c9af8355 | Rust | 2,090 | 58 | /*
MATLAB expects there to be (at least?) two symbols in a .mexa64 file. (Note that I'm only
considering linux here.) These are:
mexFunction, containing the user-defined code. The expected signature of this function is
publicly documented on MATHWORK's website. See
http:// mathworks.com/help/matlab/apiref/mexfunction.... |
8d3cc3d5b37f29f550ef726b6d91901e583b3bb3c32ca723d9d396ea3ff9bf7e | Rust | 2,105 | 72 | extern crate wkwrap;
#[macro_use]
extern crate wkw_mex;
use wkw_mex::*;
use std::slice;
use std::path::Path;
unsafe fn new(nrhs: c_int, rhs: *const MxArray) -> Result<()> {
let rhs = match nrhs == 5 {
true => slice::from_raw_parts(rhs, nrhs as usize),
false => return Err("Invalid number of input a... |
cb16f34e69429156d41205497e6d65cb059eab5932b1d5038fcad35d08a59390 | Rust | 2,240 | 64 | pub use std::os::raw::c_char;
pub use libc::{c_void, c_uchar, c_int, c_uint, c_double, size_t};
// HACK(amotta): There is no guarantee for this
#[allow(non_camel_case_types)]
type c_bool = bool;
pub enum MxArrayT {}
pub type MxArray = *const MxArrayT;
pub type MxArrayMut = *mut MxArrayT;
// HACK(amotta): This is onl... |
c12fd05fdae5b65558d347ac9ec2a707e880482bdede1dfe2a7646d1db41fac5 | Rust | 3,097 | 88 | //! Rolling integer encoder for k-mers over an arbitrary byte alphabet.
//!
//! The encoder maps each (k-1)-byte window of a sequence to a `u32` integer
//! in `0..alphabet_size.pow(k-1)`. A 256-entry byte-to-code table allows
//! arbitrary alphabets (DNA = ACGT, RNA = ACGU, protein, etc.).
/// Build a 256-entry table... |
9ba1b89d46b3cf1a9ca7aabcba48025e9f3e28cc825e5cf90f58c10bdb308814 | Rust | 3,291 | 91 | use ndarray::prelude::*;
use numpy::{IntoPyArray, PyReadonlyArray1};
use pyo3::exceptions::PyValueError;
use pyo3::prelude::*;
use rayon::prelude::*;
use digest::Digest;
use rapidhash::v1::{rapidhash_v1, rapidhash_v1_seeded, RapidSecrets};
/// Hash each delimited byte run with a RustCrypto `Digest` (md5, sha256, ...)... |
3e0833103271ea393d9d2c60d785f3c2ca083467a5d7f44f6ddfd91323e78d9a | Rust | 3,734 | 102 | use ::ffi::*;
use ::util::*;
use ::wkwrap;
fn f64_slice_to_wkwrap_vec(buf: &[f64]) -> Result<wkwrap::Vec3> {
match buf.len() == 3 {
true => Ok(wkwrap::Vec3 {
x: as_nat(buf[0]).or(Err("Invalid X value".to_string()))? as u32,
y: as_nat(buf[1]).or(Err("Invalid Y value".to_string()))? a... |
e342ece8c115bf47ede393d89abdbfc5e55f095bed35cd94d37a0ccaf7c8fd14 | Rust | 3,928 | 178 | use std::cmp::{max, min, Ordering};
use Result;
#[derive(Copy, Clone, PartialEq, Debug)]
pub struct Vec3 {
pub x: u32,
pub y: u32,
pub z: u32,
}
#[derive(Copy, Clone, PartialEq, Debug)]
pub struct Box3 {
min: Vec3,
max: Vec3,
}
impl Box3 {
pub fn new(min: Vec3, max: Vec3) -> Result<Box3> {
... |
fbeec90724b4cdafe36461cefcbf706f0ada7f6169c7658f3f1fee2dd7267019 | Rust | 4,574 | 158 | use ::ffi::*;
use std;
use std::slice;
use std::ffi::CStr;
pub type Result<T> = std::result::Result<T, String>;
pub fn as_nat(f: f64) -> Result<u64> {
if f <= 0.0 {
return Err("Input must be positive".to_string())
}
match f % 1.0 == 0.0 {
true => Ok(f as u64),
false => Err("Input... |
a353bb976dfbf838dc74a9359922c706d7d45d21ca457c0342c4ab0e5e6236c6 | Rust | 5,962 | 242 | use std::cmp;
use {Box3, Result, Vec3};
#[derive(PartialEq, Debug)]
pub struct Morton(u64);
fn shuffle(v: u64) -> u64 {
// See https://github.com/Forceflow/libmorton/blob/24b63e34b1b3b5591fd10575c89ef1e5d1bb3e2a/libmorton/morton3D.h#L229
// take first 21 bits
let mut z = v & 0x00000000001fffff;
z = (z... |
e50ba6ace778d363b6fb3e4897dd967ebc3cb33b7c31e63e2a59bc9f329cd0a8 | Rust | 7,409 | 254 | extern crate wkwrap;
use wkwrap as wkw;
#[macro_use]
extern crate lazy_static;
use std::ffi::{CStr, CString};
use std::os::raw::{c_char, c_int, c_ulong, c_void};
use std::path::Path;
use std::sync::Mutex;
pub enum Dataset {}
#[repr(C)]
pub struct Header {
pub version: u8,
pub block_len: u8,
pub file_le... |
2189682a061af58d48421b7620de288f8ff20a93fd0f67dd5438347bc6328d8e | Rust | 7,564 | 270 | use derive_builder::Builder;
use rand::{seq::SliceRandom, Rng, SeedableRng};
use rayon::prelude::*;
use std::collections::HashMap;
use xxhash_rust::xxh3::Xxh3Builder;
use anyhow::{bail, Result};
use ndarray::prelude::*;
use rand::rngs::SmallRng;
#[derive(thiserror::Error, Debug)]
pub enum KShuffleError {
#[error(... |
a5f2ae57652e83779c41341844734744f4b8634267c6f858eb22581452384608 | Rust | 8,917 | 270 | pub mod hashing;
pub mod kmer_encode;
pub mod kshuffle;
#[cfg(test)]
#[allow(dead_code, clippy::all)]
mod kshuffle_ref;
pub mod ragged;
pub mod translate;
use ndarray::prelude::*;
use numpy::{IntoPyArray, PyArray, PyReadonlyArray, PyReadonlyArray1, PyReadwriteArray1};
use pyo3::exceptions::PyValueError;
use pyo3::prel... |
a327d16c6f359f6fb8f7be9c4d908eb0de8f32961e9856e156937626819552f3 | Rust | 9,030 | 247 | use std::fs;
use std::path::{Path, PathBuf};
use {Box3, File, Header, Mat, Result, Vec3};
#[derive(Debug, Clone)]
pub struct Dataset {
root: PathBuf,
header: Header,
}
static HEADER_FILE_NAME: &str = "header.wkw";
impl Dataset {
pub fn new(root: &Path) -> Result<Dataset> {
if !root.is_dir() {
... |
e0e86f02b49d53da6e2b57a123a3226af0c1dd22d1aa129038f0b843e4c5151c | Rust | 10,379 | 356 | use lz4;
use result::Result;
use std::io::{Read, Write};
use std::{fs, mem, slice};
#[repr(C)]
#[derive(Debug)]
struct HeaderRaw {
magic: [u8; 3],
version: u8,
per_dim_log2: u8,
block_type: u8,
voxel_type: u8,
voxel_size: u8,
data_offset: u64,
}
#[derive(Copy, Clone, Debug, PartialEq)]
pub... |
88916b1ebd627f6cf8469d89ba85910ef4cd289653c26b99dab95deb3dccf119 | Rust | 11,812 | 340 | use std::ptr;
use {Box3, Result, Vec3, VoxelType};
#[derive(Debug)]
pub struct Mat<'a> {
data: &'a mut [u8],
pub shape: Vec3,
pub voxel_size: usize,
pub voxel_type: VoxelType,
pub data_in_c_order: bool,
}
pub fn linearize(channel: usize, x: usize, y: usize, z: usize, stride: &[usize]) -> isize {
... |
4cdaebef2225ac4b0a31010744b6b95b7c3353b54036209ae9061f2e8be0e577 | Rust | 13,403 | 415 | use lz4;
use std::io::{Read, Seek, SeekFrom, Write};
use std::{fs, path};
use {BlockType, Box3, Header, Iter, Mat, Morton, Result, Vec3};
#[derive(Debug)]
pub struct File {
file: fs::File,
header: Header,
block_idx: Option<u64>,
disk_block_buf: Option<Box<[u8]>>,
}
impl File {
fn new(file: fs::Fil... |
5b4c6c9a5c3417602fa86f20ed679ec23ade67e94572713ae10d52cd9eb50c53 | Rust | 20,148 | 548 | //! Codon-stride translation for `AminoAlphabet.translate`. Reads a flat `u8`
//! nucleotide buffer in `codon_size` strides and emits one AA byte per codon.
//! The standard ACGT/k=3 path uses a 64-entry LUT keyed by the same bit-hash
//! as Python `_pack_codon_index`; non-standard alphabets use a linear scan.
/// Cro... |
53825b42deca82f4146dd9fd173b036be11bb590a213a2b6f9534185f23fb273 | Rust | 21,485 | 697 | use rand::{seq::SliceRandom, Rng, SeedableRng};
use rayon::prelude::*;
use std::collections::HashMap;
use xxhash_rust::xxh3::Xxh3Builder;
use anyhow::{bail, Result};
use ndarray::prelude::*;
use rand::rngs::SmallRng;
use crate::kmer_encode;
const MAX_LUT: u32 = 16_384;
/// Returns `Some(α^(k-1))` if `DirectLut` fit... |
a9e8c632eeb4d1a6f96a3a68d3baef76466002463db51b37422f30f82b4b95c1 | Rust | 29,094 | 810 | use ndarray::prelude::*;
/// Borrowed, zero-copy view of a single-axis ragged array over a flat byte buffer.
/// `offsets` are in element units (length n_rows+1); `data` is the packed bytes;
/// `elem` is the byte size of one logical element.
pub struct Ragged<'a> {
pub offsets: &'a [i64],
pub data: &'a [u8],
... |
e5bb4b07156875f67bd94a60899d1183a5bddb2fa39c481946d71125cc53df44 | Scala | 234 | 8 | package com.scalableminds.webknossos.wrap.util
import scala.language.implicitConversions
import net.liftweb.common.{Box, Empty, Full}
trait BoxImplicits {
implicit def bool2Box(b: Boolean): Box[Unit] = if(b) Full(()) else Empty
}
|
6b8a6e52c8cf2a41df7706ac9d7668a182f7712e89d76768d7ba80036af70a4c | Scala | 799 | 29 | package com.scalableminds.webknossos.wrap.util
import net.liftweb.common.Box
import net.liftweb.common.{Failure => BoxFailure}
import net.liftweb.util.Helpers.tryo
import scala.util.Using.Releasable
import scala.util.{Success, Using, Failure => TryFailure}
object ResourceBox {
def apply[R : Releasable](resource: ... |
0f352917267e57c0a515f7ee5bdf2eb8a61f47f4ae340f00d4c6264a90a67550 | Scala | 1,178 | 32 | import scala.io.Source
import scala.collection.immutable._
import java.io._
case class Cell(barcode: String, clusterId: Int)
case class ClusterSum(head: Tuple2[String, String], cells: List[Cell])
def loadClusterSumFromFile(file: String, sep:String = ","): ClusterSum = {
val lines= Source.fromFile(file).getLines.toL... |
ae0d9c0ea009d9c5f85a071672155b7b2da4d97e1ca0d836fa89fd7a18b7fdad | Scala | 1,302 | 39 | package com.scalableminds.webknossos.wrap.util
import java.nio.MappedByteBuffer
import net.liftweb.common.{Box, Failure, Full}
import net.liftweb.util.Helpers.tryo
class ExtendedMappedByteBuffer(mappedData: MappedByteBuffer) {
def capacity: Int = mappedData.capacity
def copyTo(offset: java.lang.Integer, other:... |
aa4fe86e130ba7b93ce6aff7a4dafe84d674ac981499c317572181f02ad416f9 | Scala | 6,573 | 169 | package com.scalableminds.webknossos.wrap
import com.google.common.io.{LittleEndianDataInputStream => DataInputStream}
import com.scalableminds.webknossos.wrap.util.{BoxImplicits, ResourceBox}
import org.apache.commons.io.IOUtils
import java.io._
import java.nio.{ByteBuffer, ByteOrder}
import net.liftweb.common.{Box,... |
458a7a4a2e8aa11439223286bb04aa293fdc19ddc889c2dfc3ff67108dbb72b9 | Scala | 12,265 | 321 | package com.scalableminds.webknossos.wrap
import java.io._
import java.nio.channels.FileChannel
import java.nio.file.{Files, Paths, StandardCopyOption}
import org.apache.commons.io.IOUtils
import com.google.common.io.LittleEndianDataInputStream
import com.scalableminds.webknossos.wrap.util.ExtendedMappedByteBuffer
im... |
5df4b5183b4cddcb14d1dad343948c1798cbf32a71015bef4d0134a4a8f7803a | Shell | 10 | 1 | hugo serve |
9ab8fabc8c72bfa0416414631e26bd71b01f9dfae98dcf4656b1e2d78307876a | Shell | 15 | 2 | #!/bin/sh
true
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.