sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
12d6e15124493883fca1fa9809c900bba316589d5b8fd1b32db8959b772cf811
R
2,196
51
## import package .libPaths("~/R/x86_64-pc-linux-gnu-library/4.2") library(Seurat) library(ggplot2) library(ggpubr) library(sctransform) library(harmony) library(dplyr) library(plyr) ## load all the objects Hypo_integrated <- readRDS("~/Yi_Huang/objects/Hypo_integrated.rds") AgRP_subclusters <- readRDS("~/Yi_Huang/obj...
36364c191ec0e16aab1a2210c55440ccab5cf9c8e5ec2534e2bf5bfd4bfec28f
R
2,203
56
rm(list = ls()) options(stringsAsFactors = F) library(umap) library(ggplot2) library(ggrepel) library(dplyr) library(scatterplot3d) options(rgl.useNULL=TRUE) library(rgl) rgl::setupKnitr(autoprint = TRUE) setwd("~/Documents/Virginia Tech/Project_4_VCU_postmortem_SCZ/RNA_DEseq/UCSD_gtf/glia/") df = read.csv('All_SCZ_Con...
0d3e59b2bd4e764f594993da824ce58ebe5609746a08506b97fa34fc5425d2ef
R
2,218
48
#!/usr/bin/env Rscript #this script gets blastn results as an input, and outputs the coordinates of regions with high intrachromosomal similarity per respective basepairs require(tidyr) require(dplyr) options(scipen=999) args <- commandArgs(trailingOnly = TRUE) file <- args[1] print(file) plotRectangle<-function(spe...
115bfbc48da380c063e866e999397db17c151d167006f8937c3b60a4e87115de
R
2,218
70
library("stars") library("xgboost") library("ALEPlot") set.seed(1) outdir = file.path("data", "rds") if (!dir.exists(outdir)) dir.create(outdir) names = c("elevation", "slope", "stdev", "multitpi", "convexity", "entropy", "openness", "median500", "median1000") reference = list.files("data/raster_maps", pat...
5e320e9f122bae0ac27c352c2b7734cb65306f173a77ca2950df659a4547f0d8
R
2,224
56
library(dplyr) library(reshape2) library(ggplot2) res = readLines("benchmark_res.txt") header = c("Size", "Dataset", "F77time", "F77err", "F77nops", "Cpptime", "Cpperr", "Cppnops") ## Benchmark result for symmetric solver sym_start = grep("eigs_sym", res) + 4 sym_end = grep("========", res)[2] - 1 sym_dat = strsp...
00e5a5a709e490f92096b0da31d3d6297172d6c8fa8cb241716f39990b8f2cea
R
2,226
95
--- title: "Compare firing properties across firing modes classified at the single-trial level" author: "Matt Nolan" date: "01/11/2023" output: html_document --- # Setup ```{r} library(tidyverse) library(lme4) library(emmeans) ``` # load data ```{r} # cells_data <- readRDS(file = "cells_df.Rda") cells_data <- readRD...
5f6da600c873c3516773dd17fcbf174483a3e730b4d9987844f8d2a37283323a
R
2,234
65
# Load necessary libraries library(dplyr) library(tidyr) library(ggpubr) library(rstatix) library(pheatmap) library(RColorBrewer) # Set working directory to Interaction Score files setwd('Interaction_score/') # Read interaction scores and annotations file_names <- list.files(pattern = ".*SUM") interaction_scores <- d...
be477f4b483df09665ef807d01cac23ffbd339ba812b0d15ab559c425b66651f
R
2,247
82
library(Signac) library(Seurat) library(GenomeInfoDb) library(EnsDb.Hsapiens.v86) library(ggplot2) library(dplyr) library(patchwork) library(rtracklayer) library(cowplot) sObj_Filtered <- readRDS("rObjects/sObj_cluster.rds") sampleInfo <- readRDS("rObjects/SampleInfo.rds") names(sObj_Filtered) <- sampleInfo$ID ## re...
76ef12362a1d2282714faee8281fea4c376f8a0af165319a6bfe6a765701c732
R
2,249
59
library(Seurat) library(dplyr) library(tidyr) library(ggplot2) library(ggpubr) library(pROC) library(cowplot) # Load data df <- read.delim2('per_cell_type_annotation.tsv') dat0 <- readRDS("PlateletsOnly_cluster_Anno.rds") # Preprocessing for ROC analysis df <- distinct(df, Sample_ID, Outcome, Severity) dat01 <- dat0@...
b869f8b53c9b7bda58762a68f4f47d16ade38afdec5f593b3b412aecbb71e591
R
2,257
77
## ---Libraries ------ library(Signac) library(Seurat) library(GenomeInfoDb) library(EnsDb.Hsapiens.v86) library(ggplot2) library(dplyr) library(patchwork) library(rtracklayer) library(cowplot) library(BSgenome.Hsapiens.UCSC.hg38) library(JASPAR2020) library(TFBSTools) library(patchwork) ##--- Functions -------- howMa...
9db5e493be339d836f3e9faccf9f21339c7f502d264bfb5df1d0c1e608fa9b1f
R
2,286
45
#dev.off() #rm(list=ls()) library(ggplot2) library(tidyr) library(gridExtra) library(ggthemes) library(qqman) library(dplyr) Data <- read.table("FSTscan_GATK_20vs20_5kb2.5_IT.windowed.weir.fst", header = T) #the same was performed for the SA lineage contrast (input file FSTscan_GATK_10vs10_5kb2.5_SA.windowed.weir.fst)...
02b7154f1a9ab5b96e4403ab7b22711237419f4a7204b1e408836c8e7a8b38c7
R
2,302
98
library(tidyr) library(dplyr) library(base) library(stats) library(r2symbols) setwd('Desktop/Proteomics polyGR/') quant<-readRDS('quant/MSstats_ProtQuantity_Summarization.rds') quant2<-quant$ProteinLevelData quantTNPO1<-quant2%>%filter(Protein=='Q92973') EGFP<-quantTNPO1%>%filter(GROUP=="EGFP") GR<-quantTNPO1%>%filt...
53e0c78f21df5a7bee4c6731266133137d700cef1c1760c8ddf4836160951028
R
2,310
83
## Libraries library(here) library(dplyr) library(parallel) library(here) library(tidyverse) library(DT) pname <- "AMC" cname <- "mTOR" #################################@ ## Compare cohorts ## FCD2a-FCD2b, FCD2a-TSC, FCD2b-TSC ## get data samples <- listSamples(projects = pname , condition = c("mTOR_control")) %>% ...
e69ea6fa3c073f17515cb4378aef64bb34bb258d388e4c3b90205de5096ac526
R
2,320
51
rm(list=ls()) dev.off() library("genoPlotR") library(gridExtra) setwd("C:/Users/Nathalie/Dropbox/WallLizard_NanoporeAssemblies/") ############### Fig. 2D - gene annotations in candidate region (exon level) data <- read.csv("CandidateRegion_Genes_Location_Spa_exons.csv", header = T) dna_data <- dna_seg(...
3a730e940b862091ad459684c3caabc684c9e9be9b8342415ff57e10e4176458
R
2,332
105
master <- read.csv("MasterFrequencies_PCA.csv", row.names = 1) masterscaled <- scale(master) pca <- prcomp(t(masterscaled)) pcs <- data.frame(pca$x) ### Export the PCs to use in graphpad write.csv(pcs, "pcs.csv") plot(pcs$PC1, pcs$PC3) a1 <- data.frame(pcs$PC1[1:5], pcs$PC3[1:5]) a2 <- data.frame(pcs$PC1[6:13]...
b3a2a3a85df79b7beeeb656a33335840fbbb68c51190881dbaf0f220c9aa2290
R
2,348
40
#' pGLS model comparison using phylogenetic analysis of covariance (gls.ancova) #' #' Computes F-ratio test of GLS models that include different sets of indicator variables. #' @param form Model formula. #' @param data a data frame containing the variables in the model. #' @param Sigma Matrix describing the covariance ...
c0fd69b0b49f9686cfed7d74763020450090bd0df97e9869fa549a3d319dafd6
R
2,355
90
# perform T-SNE "tsne" <- function(X, initial_config = NULL, k = 2, max_iter = 1000, min_cost = 0, epoch = 100) { cat("Performing t-SNE.\n") momentum = 0.8 final_momentum = 0.8 mom_switch_iter = 250 epsilon = 500 min_gain = 0.01 initial_P_gain = 4 n = nrow(X) eps = ....
2678f5d421a7ffad411df7e6d7bb35de9697600c2b35e94ed8100f7232afa779
R
2,362
61
# Load necessary libraries library(dplyr) library(SeuratDisk) library(Seurat) library(clusterProfiler) library(org.Hs.eg.db) library(ggplot2) library(RColorBrewer) # Set the working directory to where DEG files are located setwd("~/DEG/Platelets") # Function to process DEG files process_DEG_file <- function(file_name...
b130489b831a3cdd9c40d4d7ba60ecdade6dcae18cd9343fe6f99b809bfc95ef
R
2,394
80
# ----------------------- # UMI-BC report # ----------------------- library(ggplot2) library(dplyr) library(ggseqlogo) library(grid) library(gridExtra) library(stringr) args <- commandArgs(trailingOnly = TRUE) input.csv <- args[1] report.file <- paste(input.csv, '_report.pdf', sep='') x <- read.table(input.csv, sep...
653d269c0ae266747b7e2afebb820b1a5ef715537ae58de01623f1dfebac22f0
R
2,401
124
--- title: "Retina Clusters Eye Samples" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) knitr::opts_chunk$set(echo=FALSE, warning=FALSE, message=FALSE) ``` ```{r, libraries} library(Seurat) library(cowplot) library(SCFunctionsV3) library(dplyr) library(tidyr) library(stringr...
9f491b66bf50d2f727e401911721c7b7613fc7f1d689e18dc6df2f7fc53c2b04
R
2,405
85
library("stars") library("corrr") source("code/misc/getRegion.R") tab = read.csv("data/classification_table.csv") files = list.files("data/digital_maps", recursive = TRUE, pattern = "OK_POWIERZCHNIE_PODSTAWOWE+\\.shp$", full.names = TRUE) res = c(30, 30) if (!dir.exists("data/ras...
ac28b6c52b82c455f02cf7b6bcb4d4adf8ea38c81ffe2eeceb118f407eab6097
R
2,422
78
## input data dataDir <- file.path(allData, sampleName) ## output data sce_output <- paste0(outputDir, sampleName, "_sce.rds") batch_corrected_seurat_output <- paste0(outputDir, sampleName, "_seurat.rds") ## samples filepath <- list.files(dataDir) id <- filepath %>% gsub("results_", "", .) %>% gsub("_Results", "", ....
85c254498fc11c0525c5ab2789fb09dc831406a33cd06880a06e81d74f8492c9
R
2,444
50
--- title: "PyPALM Comparison" output: html_notebook --- Load libraries ```{r} library('permuco') library('dplyr') library('nptest') ``` Load data ```{r} roi_vols = read.csv('~/FUSE-HWNI/dlurie/Projects/timescale_hierarchy/data/resources/BNA_ROI_volumes.txt', header = FALSE, col.names = "Z") ts_data = read.csv('~/FUSE...
2b51250c9552424772f863ebea67bd510c1f57018f33c7b8a7f56621cc99484a
R
2,445
43
--- title: "Spin Test Parcel Rotation Matrix" author: "Audrey Luo" date: "2023-12-01" output: html_document --- This Rmd file using rotate_parcellation to generate 10k rotated permutations of a parcellation, given the coordinates of left and right hemispheres of this parcellation on the sphere. The output is a vector...
5fafb61963a744b0b18e0e1ae157cd7678793fb16b3d22745a7a582a144e0e52
R
2,449
79
sampleName <- paste0(tissue, "_D", day) ## input data dataDir <- file.path(allData, sampleName) ## output data sce_output <- paste0(outputDir, sampleName, "_sce.rds") batch_corrected_seurat_output <- paste0(outputDir, sampleName, "_seurat.rds") ## samples filepath <- list.files(dataDir) id <- filepath %>% gsub("resu...
6269dad0b1db82be613706d8b5235b6e7487ddb5b056f07729d8359f8e77b556
R
2,451
44
# Code for adding metadata by pseudotime and then doing GO or GSEA library(naniar) library(gprofiler2) Feature3D(data.combined, "Pseudotime") UMAP3D(data.combined) # make cutoffs 1-7.5 # Also there are some weird cluster pseudotime issues between 1.1 and 1.5 so i will just remove those clusters as well # Ori...
95495311a1265a70a92af3d6ee49854d67a71f599555f14ce225c5fde5f196d1
R
2,454
39
# Run with Rscript generate_reference.R /tmp/organage-sources OUTPUT.csv # The scoring expressions are read verbatim from the pinned authors' script, # so this oracle does not reimplement the Python port. args <- commandArgs(trailingOnly=TRUE) root <- args[1] output <- args[2] script <- readLines(file.path(root, "scrip...
a66c2edd57cba7feb87c784a2f1c4738a51c725915fd9621f6e5e97d1963b03c
R
2,456
52
### DATA load("bipolar_data_Cell2016.Rdata") # Remove libraries that contain more than 10% mitochondrially derived transcripts mt.genes = grep("mt-", rownames(bipolar_dge), value = TRUE) cells.use = colnames(bipolar_dge)[colSums(bipolar_dge[mt.genes, ])/colSums(bipolar_dge) < 0.1] bipolar_dge = bipolar_dge[, cells.use]...
abc3d4caebc21313fbf13829fdacdb458f69049c92d1102ba77860d1af6b38f4
R
2,459
57
library(DESeq2) library(ggplot2) SampleName = list.files(path = "star/",pattern = "R.bw") SampleName = gsub("_sorted_R.bw","",SampleName) Group = gsub("[0-9]$","",SampleName) sample.meta = cbind.data.frame(SampleName,Group) sample.meta = apply(sample.meta, 2, as.factor) mtx = read.table("genes_expression_expected_count...
065bdcaecb4f3bfd622e46a4ce549d7fbbb7b18a3f5bbc5f9b8efb8f8ea4a333
R
2,461
40
# Run with original source directories and an output directory. No aggregator inputs. # Rscript generate_reference.R <prcPhenoAge checkout> <IntrinClock original directory> <output> args <- commandArgs(trailingOnly=TRUE) prc_source <- args[1] intrin_source <- args[2] out <- args[3] dir.create(out, recursive=TRUE, showW...
30e31e53be92a8e012655909583cd02b129a556cbbd1c5ea27c5cd9cbf536d5b
R
2,467
76
library(dplyr) library(Seurat) library(ComplexHeatmap) library(GSVA) library(GSEABase) library(limma) library(ggplot2) library(ggpubr) library(tidyr) library(rstatix) # Load gene sets genesets <- getGmt("h.all.v7.5.1.symbols.gmt") # Load data and prepare dat0 <- readRDS("Platelets_cluster_Anno.rds") DefaultAssay(dat0...
c340ce22941097f462037fc3352b7ecaadbe5fdc63e4c8acb307c138e4b4ed68
R
2,477
47
### Prepare pathology datasets for analyses savedir <- paste0(params$opdir, 'processed/') dir.create(savedir,recursive = T) # load and format pathology dataset parent_tau <- read.csv(paste0(basedir,"data/TauMLi2_Parent_RemovedFT.csv"), row.names = 1,) # sublaminar pathology (360 regions per hemisphere) parent_tau <- ...
6db4391253d24c015605b7e6135ed0b6421a9aeaa55bfc3caea2d4dedbbf7fcf
R
2,484
62
#!/usr/bin/env Rscript library(plyr) library(tidyverse) library(readr) library(here) args = commandArgs(trailingOnly=TRUE) data_path = args[[1]] data <- read_rds(here(data_path)) data_filt <- data %>% filter(native %in% c("ENG", "English", "ENGLISH", "english")) #I peeked at what people put that semantically maps t...
f624b4050894cd57bb0b70c247acc366aa586510fed472e62f3a3c70b0050ed4
R
2,501
80
R (v4.2.1) #https://www.nature.com/articles/s41593-020-00787-0 #https://research.libd.org/spatialLIBD/articles/spatialLIBD.html library("spatialLIBD") packageVersion("spatialLIBD") #‘1.13.4’ ## Connect to ExperimentHub ###############this code buck was used to delete the old cache (As I downloaded them in R4....
3fcde8dbadf94953f34fbba7d965e91a21b79f417d46b4c23a2c9f77709a4ed2
R
2,507
63
# make_counts() and sig() come from helper-counts.R test_that("ScoreSignatures_UCell accepts count matrix", { m <- make_counts() ref <- ScoreSignatures_UCell(m, features = sig(m), ncores = 1) expect_true(is.matrix(ref)) expect_identical(rownames(ref), colnames(m)) expect_equal( ScoreSignatures_UCell(Matr...
8cbbfab0ea44ababb669a57a396a9dfc7d2c2e53e0c365d229a366655d3c9dd5
R
2,514
84
library("lightgbm") library("yardstick") set.seed(1) df = readRDS("data/dataset.rds") n = round(0.7 * nrow(df)) trainIndex = sample(nrow(df), size = n) train = df[trainIndex, ] test = df[-trainIndex, ] rm(df, trainIndex) # class must be numeric, start with 0 and numbering must be continuous train$class = as.numeric(t...
b95e6bdb7ca79fb2db86f8392755cf96a66548a9643a18cb5238a482d2c30674
R
2,548
70
#### USAGE #### # This file makes correlation plots of simulations based on agrn setting files. # In case you are using Rstudio, just click on "Source" button in the topright corner of this pane! # From command line invoke: `Rscript src/plot.R` or `R -f src/plot.R` #### Installation of neccessary packages #### if(!r...
a25ec02d1b9468d197d30694f50dd2bf6ffa3971cf206fbc37fc92967d23746d
R
2,564
111
--- title: "Individual Clustering" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) knitr::opts_chunk$set(echo=FALSE, warning=FALSE, message=FALSE) ``` ```{r, libraries} library(Seurat) library(cowplot) library(SCFunctionsV3) library(dplyr) library(tidyr) library(stringr) libr...
5766fd4908d9f1ab0fdf26dbf3796e134ba0838bad073ff663f62057a898f02d
R
2,574
66
#' To calculate cell-to-cell similarity matrix on gene (spatially auto-coorelated genes) expression based on Euclidean distance; to build up a K-nearest neighbors (KNN) graph based on the cell-to-cell similarity matrix; then to convert the KNN neighbor relation matrix into an adjacency matrix #' #' @param nk Number of ...
1d235a2e704d9d11dda154b7c809cffbb3b4d1b82ba187e246ada89024fee6b7
R
2,582
59
# Internal helpers, tested directly test_that("check_signature_names fills in missing and duplicate names", { f <- list(1, 2, 3) expect_equal(names(UCell:::check_signature_names(f)), c("signature_1", "signature_2", "signature_3")) names(f) <- c("a", "", "a") # the empty name and the duplicate a...
a314f00cc5f5fbd058cd0e279a7859797f02fa8fb01f6876ee53180dff095971
R
2,583
75
source("/cbica/projects/network_replication/manuscript/code/scripts/sensitivity_analyses/computeConnectivityMetrics_restOnly.R") ################## # Set Variables ################## args <- commandArgs(trailingOnly = TRUE) dataset = args[1] ################## # Set Directories ################## config_data <...
2bc024fea0cb4a94282cecebcce7f1f816372439bc7469e69bbba8b9b6a50e3a
R
2,585
59
library(dplyr) library(tidyr) library(ggpubr) library(rstatix) file_names <- list.files(pattern = ".*T_cell_interaction_score.txt") data <- do.call("rbind",lapply(file_names,FUN=function(file_names){read.delim2(file_names)})) plot_interaction_scores <- function(data, group_by_var, file_name) { # Prepare data dat...
bfeea98af855edc181f3e8ca1013f68f9e87e93a31d1348976a948173d0623b4
R
2,585
78
#!/usr/bin/env Rscript options(width=200) ######################### # # Loading Data and Libraries # ######################### args <- commandArgs(trailingOnly=TRUE) cliargs <- args[-(1:2)] options('warn'=1) #report non-convergences, etc library(mgcv) # library(languageR) library(optimx) library(ggplot2) #The below...
3045754d5d706b73a9a6aff79eb341863b4aba702f69d125f5f4172fcd857a57
R
2,591
68
# Group Comparison 4-Fold Bilateral EC library(ggplot2) library(gridExtra) library(ggprism) library(ggpubr) library(lsr) # Load the Df #SC---- SC_EC_Subj<-read.csv('/Volumes/ROBBOT/Projects/GridMagination/Tables/02_QuadratureFilter/SC_CombinedROI_Subj.csv') SC_EC_Subj$SubjectID<-factor(SC_EC_Subj$SubjectID) SC_EC_...
f84f69debfaddd0aeacd0d8393a965b7d164192b3d8771867c89945cb8d96ef9
R
2,596
50
npr <- c('Oxtr', 'Avpr1a', 'Avpr1b', 'Avpr2', 'Tacr1', 'Mc1r', 'Mc3r', 'Mc4r', 'Oprl1', 'Tacr3', 'Gpr83', 'Galr1', 'Npy1r', 'Npy2r', 'Npy4r', 'Npy4r2', 'Npy5r', 'Sstr1', 'Sstr2', 'Sstr3', 'Mchr1', 'Oprd1', 'Oprk1', 'Oprm1', 'Trhr', 'Hcrtr1', 'Hcrtr2', 'Qrfpr', 'Npffr1', 'Npffr2'...
f6ea4f2e5f2170f5e51ca309cf3af49ae4610b032e09902799a875a2698829f8
R
2,599
97
#' Start monitor ram usage in linux #' #' Create a log file in the working directory that then is elaborated by get_max_ram_used #' #' @param log_name Character string that will be given to the log file saved on the disk #' @return Log file on the disk with the ram usage #' @export start_monitor_ram=function(log_name){...
e43055602567eeb0d57c43708950b9a0db9da4ffd4acf16393e48bd7d03e7dae
R
2,603
62
suppressMessages(source("../scripts/helper.R")) library("zoo") # list of species to compare com_list = list( c("Xboc","Isopu"), c("Xboc","Spur"), c("Xboc","Hmia"), c("Xboc","Nvec") ) order_xboc = c("Xboc_GUT","Xboc_EPIDERMIS","Xboc_CILIATED_CELLS","Xboc_PHARYNGEAL","Xboc_PIGMENT","Xboc_GLAND1","Xboc_GLAND2","Xboc_GLA...
c6cccf98e3817feb1d2b5c08dc9440ded4437280ebd3634d066bd4d58bd706f9
R
2,615
66
### DATA # Human cerebral organoids + fetal neocortex # SMARTer # Camp JG, Badsha F, Florio M, Kanton S et al. Human cerebral organoids recapitulate gene expression programs of fetal neocortex development. Proc Natl Acad Sci U S A 2015 Dec 22;112(51):15672-7. PMID: 26644564 # GSE75140 ann <- read.table("Camp_Neurons_S...
8a2356e321e2ae3bd0db330d8a206a0aabc3e62dc0cfb5b94ff536c9d8c38a2b
R
2,619
47
rm(list=setdiff(ls(),c('params'))) basedir <- params$basedir # make this whatever you like, end with / setwd(basedir) source('code/aba/aba_fxns.R') source('code/misc/miscfxns.R') source('code/misc/plottingfxns.R') abadir <- paste0(basedir,'data/aba/') dir.create(paste0(abadir,'atlas'),recursive=TRUE) load(file=paste0(a...
3ece848417a195f96f3cd2fe7a2a93f651961eed52c28fe674861ebc1742f9ed
R
2,621
133
--- title: "QC - ATACseq" output: html_document: df_print: paged --- ```{r global_options, include=FALSE} knitr::opts_chunk$set(echo=FALSE, warning=FALSE, message=FALSE) ``` ```{r, libraries} library(Signac) library(Seurat) library(GenomeInfoDb) library(EnsDb.Hsapiens.v86) library(ggplot2) library(dplyr) li...
9db3cb57967268991107fc63e6e1601e33a1e87d34d551726ae104e66cbf742a
R
2,623
71
library(tidyverse) library(dplyr) library(tidyr) library(ggplot2) library(ggpubr) library(rstatix) dat01 <- read.delim2('per_cell_type_annotation.tsv') dat <- dat01 %>% filter(label != "") dim(dat) n_cells_01 <- dat %>% dplyr::group_by(Sample_ID, label) %>% dplyr::count(label) %>% tidyr::spread(label, n) #...
2c14203073d8f749a836884aad0095f62bb8e90ef9e9dd4515c12d239efc92a5
R
2,648
95
library(Seurat) library(harmony) library(ggplot2) library(dplyr) ### Functions howManyCells <- function(sObj){dim(sObj)[2]} ## downsample to 4000 downsample <- function(sObj, no_cells = 4000){ if (howManyCells(sObj) > no_cells){ set.seed(1234) s <- sample(1:howManyCells(sObj), no_cells, replace = FALSE) ...
5c70064e2bb6a4acf57e43407f87e4f473dc4d9a89258eee426948ff6875da41
R
2,650
121
### THIS SCRIPT REQUIRES SAGA GIS AND GDAL TO BE INSTALLED ### ## the extent of original DEM is much greater than the borders of Poland ## DEM must be in "tmp" subfolder (it will be cut to the borders later) output = file.path("data", "variables", "tmp") DEM = file.path(output, "01_ELEVATION.tif") ## SLOPE system( ...
c69ac03131f963d38193c757782062f381975f296ba28861ec0246cd08732231
R
2,658
74
# Load required libraries library(SeuratDisk) library(dplyr) library(Seurat) library(ggplot2) library(stringr) library(GO.db) library(org.Hs.eg.db) library(KEGGREST) library(HGNChelper) library(tidyr) library(ggpubr) library(rstatix) # Load dataset df <- readRDS("Platelets.rds") DefaultAssay(dat0) <- "RNA" # Functio...
5e52249f600f70c448da516f7ec889d7955a496d09ff57e17f8ad035cfd99add
R
2,668
54
################################################################################ # affectDefaultValuesSwath.R 1.0.0 # # Authors: Alexandre Sta (Institut Curie) # # Contact: myproms@curie.fr ...
0e240589efb8821d9b539904194342f26dd080632300e7bd94ec8e7ddcbaaa19
R
2,697
67
# Load required libraries library(readxl) library(dplyr) library(VennDiagram) # Read the data from Excel file data <- read_excel("/data/mayerlab/Github/Dvoretskova_et_al_2023-DATASETS/Table_S4_E16_clusters_DE.xlsx") # Get column titles of the data column_titles <- colnames(data) # Assuming your data frame is named "...
adf651fe906807d171f9fff486ff2505678df3ba4b0378410e828d13a6c3f597
R
2,702
68
# Plot regression models with clinical scores library(ggplot2) # Load models setwd("/Users/huser/Documents/analysis") load(file="updrsmods.RData") a.labels <- c("Rate", "Length", "Interval", "Amplitude", "1/f offset", "1/f exponent", "Alpha power", "Alpha centre freq.", "Beta power", "Beta centre fr...
a4bcb212841dfbf866c0dca3136a6d75b52eceb52b151cf32e5f1adf0941fb4f
R
2,706
47
crossbait_contamination = function() { samples_df = tlx_read_samples("~/Workspace/Datasets/HTGTS/samples/All_samples.tsv", "~/Workspace/Datasets/HTGTS/TLX") %>% dplyr::filter(grepl("concentration", experiment)) %>% dplyr::mutate(run=dplyr::case_when( grepl("PW103|PW104|PW105|PW106|PW107|PW108|PW109|PW11...
9029816ddf7e1fd1879efdd64b43ca2d3eaa1ea0ffbed850dd29bc936aaefa20
R
2,717
124
# A is the similarity matrix by SIMLR # X is the data of size nxp "SIMLR_Feature_Ranking" <- function( A, X ) { # traspose X X = t(X) # start the computation res = lapply(1:100,FUN=function( x ) { cat(x,"\n") index = sample(1:nrow(A)) index = index[1:round(nrow(A)*0.9)]...
8d25a54c3ef331fe3ac4ea21cbdb7df34e6aa24c877b9fcd1bc1fed26369aff8
R
2,718
88
--- title: "figure 5" author: "Pavitra Roychoudhury" date: "2023-07-16" output: html_document --- Panels for figure 5 ```{r} rm(list=ls()) library(Seurat) library(tidyverse) options(dplyr.width=Inf) library(cowplot); options(scipen = 999) all3<-readRDS('./seurat_analysis_all3.rds') ``` TSNE showing LAT expression ``...
7671f047113aad87f131961d7f73680bf60a708c4b04e577ea0a985e0917de8b
R
2,726
62
# Load required library library(data.table) library(ggplot2) library(gridExtra) # Create an empty list to store the data.frames data_list <- list() # Get a list of all directories in the specified path path_to_directories <- "/Users/elleke/SURFdrive/Projects/MOSTest/Results/Discovery/cFDR/pleioprs" dirs <- list.dirs(...
cd5eb10116cb4a36f14ec15e7b20e18e6adc96cfa0dba349a2fa7cf5a80d9243
R
2,730
82
setwd('/work/AnneSophiaHartebrodt#6698/ms-project/') require(rhdf5filters) require(rhdf5) require(Rhdf5lib) renv::activate('/work/AnneSophiaHartebrodt#6698/ms-project/r-single-cell') renv::repair() set.seed(11) library(harmony) require(data.table) require(SingleCellExperiment) library(cowplot) library(rsvd) library(Rt...
7f5619c7709973521f0b9a4c954bfc7958e8e54747c0d60341f0cd59b7fa12e4
R
2,739
49
#' Selecting tuning parameters for sparse CCA #' #' @references We adapted and modified the code from the CCA function in the PMA package to be compatible and scalable with single-cell multimodal integration through parallel computing. #' #' @param x Expression-driven adjacency matrix #' @param z Spatial-driven adjacen...
bcdf4210e794ff1dc97a3d9b936c3d997cd248750474acc6de796de484f51891
R
2,744
76
#' @title Wrapper for clUMAP with Thresholding and Plotting #' #' @description This function applies thresholding to granule scores within a specified object and column, #' inverts the thresholding if a specific miscellaneous name is provided, and then calls clUMAP #' for plotting based on the thresholded values. #' #'...
3b3cb79f22db83a644f83215fe963f8f4bca47a1724992f9d74a126fb32d0c46
R
2,753
66
library(SingleCellExperiment) library(scater) create_sce_from_counts <- function(counts, colData, rowData = NULL) { if(is.null(rowData)) { sceset <- SingleCellExperiment(assays = list(counts = as.matrix(counts)), colData = colData) } else { sceset <- Sing...
a1772345e1610c9d4f7829b46d2234f83e3deea6fd97533a9cc5c78efcd96ef6
R
2,768
55
### This code creates Fig. 3A and fig. S5 dev.off() rm(list=ls()) library(ggplot2) library(tidyr) library(gridExtra) library(dplyr) Data_depth_ind <- read.table("Read_Depth_Per_Ind", header = T, sep="\t") #can also be done with Read_Depth_Per_Ind_post Data_depth_ind[,c(2:150)] <- sapply(Data_depth_ind[,c(2:150)], as....
24239e902619878dee935a36b1d6eed0324408f93225ea5cc16a7b75040e4c83
R
2,790
59
################# ### Load data ### ################# rm(list=setdiff(ls(),c('params','grp','treatment','injection.site'))) print(grp) print(treatment) basedir <- params$basedir setwd(basedir) savedir <- paste0(params$opdir,'modelcomparison/bootstrap/',paste0(injection.site,collapse='-'),'/') dir.create(savedir,recur...
ead6b68dfccea2bb71f5735ea033acfe0ec08654e1e86f0a3bde10e3f84f0780
R
2,799
79
#SR_TAU_CELL .libPaths("/data/user/jfisher7/.conda/envs/SR_TAU_CELL/lib/R/library") #make sure the environment is clean rm(list=ls()) args <- commandArgs(trailingOnly = TRUE) num1<- args[1] num2<- args[2] library(MASS) library(parallel) library(signatureSearch) library(tidyverse) library(HDF5Array) library(Summar...
725ed39b1c2c6041bfc250a4e0d72b6c489f06002a605277656f95902fbb55b0
R
2,800
76
#SR_TAU_CELL .libPaths("/data/user/jfisher7/.conda/envs/SR_TAU_CELL/lib/R/library") #make sure the environment is clean rm(list=ls()) args <- commandArgs(trailingOnly = TRUE) num1<- args[1] num2<- args[2] library(MASS) library(parallel) library(signatureSearch) library(tidyverse) library(HDF5Array) library(Summari...
91f5feab37a781511c449bdf57bada072e4937b62b556c17ba9c5e2868258b7b
R
2,800
76
#SR_TAU_CELL .libPaths("/data/user/jfisher7/.conda/envs/SR_TAU_CELL/lib/R/library") #make sure the environment is clean rm(list=ls()) args <- commandArgs(trailingOnly = TRUE) num1<- args[1] num2<- args[2] library(MASS) library(parallel) library(signatureSearch) library(tidyverse) library(HDF5Array) library(Summari...
aad98997e7319dfeae738ddc744781c8f7d81e62783d20451ba69981e85c888f
R
2,800
76
#SR_TAU_CELL .libPaths("/data/user/jfisher7/.conda/envs/SR_TAU_CELL/lib/R/library") #make sure the environment is clean rm(list=ls()) args <- commandArgs(trailingOnly = TRUE) num1<- args[1] num2<- args[2] library(MASS) library(parallel) library(signatureSearch) library(tidyverse) library(HDF5Array) library(Summari...
50ecfc6f7030b1c75aeff7432028c12eed412e80b32a17c40fc54c9d3a17b1ec
R
2,801
96
# Canonical Correlation Analysis # # Script for canonical correlation analysis to investigate the relationship # between behavioral changes and neurobiological variables # # Author: Rafael Naime Ruggiero 2022 library(lme4) library(CCA) #facilitates canonical correlation analysis library(CCP) #facilitates che...
e130a2e321d67d14ae4226f58943321522f47141dddc5e38ce12d787adfe331d
R
2,801
104
urlfile="https://raw.githubusercontent.com/NathanSkene/ALS_Human_EWCE/master/Data/Raw/GSE67196_Petrucelli2015_ALS_genes.rawcount_EXP.csv" ALS_patients<-read_csv(url(urlfile)) write.csv(ALS_patients, "ALS_patients-NatNeuro.csv") ALS_patients = read.csv("ALS_patients-NatNeuro.csv", header=T) colnames(ALS_patients)[1]<-"...
09d7177bb8d82d26677a10f11991bafb16568c4f5deff62698a0057ac7839ea3
R
2,802
95
importfiles <- function(name) { namesoffiles <- list.files() importedlist <- lapply(namesoffiles, read.csv) unlisted <- unlist(importedlist) numberofsamples <- as.numeric(length(namesoffiles)) numberofrows <- numberofsamples * 2 numberofbarcodes <- as.numeric(length(unlisted) / numberofsamples / 2) dim(unlisted) <- ...
3a3e18f6cb95358455ecc8d22a092dd26ef4f18b3687e0b93f5af4f3448c4451
R
2,802
76
#SR_TAU_CELL .libPaths("/data/user/jfisher7/.conda/envs/SR_TAU_CELL/lib/R/library") #make sure the environment is clean rm(list=ls()) args <- commandArgs(trailingOnly = TRUE) num1<- args[1] num2<- args[2] library(MASS) library(parallel) library(signatureSearch) library(tidyverse) library(HDF5Array) library(Summari...
06cd0e0fda176141941e2132101199419b139dc0b76a3028a382715abeb06a61
R
2,803
78
#SR_TAU_CELL .libPaths("/data/user/jfisher7/.conda/envs/SR_TAU_CELL/lib/R/library") #make sure the environment is clean rm(list=ls()) args <- commandArgs(trailingOnly = TRUE) num1<- args[1] num2<- args[2] library(MASS) library(parallel) library(signatureSearch) library(tidyverse) library(HDF5Array) library(Summar...
68a3944b87820e14567eda0f0127c0e3265a3ebccd956f2927945888092cfeb6
R
2,828
52
################################################################################ # goHierarchCluster.R 1.0.0 # # Authors: Valentin Sabatet (Institut Curie) # # Contact: myproms@curie.fr ...
80dde3124ffdd4b1c766977a2e05929cfddab0c2d344a647b9fbe6a7a6ea1059
R
2,862
86
# Plot the left EC six fold group comparison library(ggplot2) library(lme4) library(gridExtra) library(ggprism) library(ggpubr) library(coin) library(car) # Load the dataframe # SC ----- SC_LeftECSubj<-read.csv('/Volumes/ROBBOT/Projects/GridMagination/Tables/02_QuadratureFilter/SC_LeftEC_Subj.csv') SC_LeftECSu...
e8e53f7984f156ad941925e9800c082b90f70adb5841d27d6b04025b1290b890
R
2,879
86
### DATA # iPS = induced pluripotent stem cells (day 0) # HE = hepatic endoderm (day 8) # LB = liver bud = hepatic endoderm + supportive mesenchymal and endothelial cells # MH = mature hepatocyte-like (day 21) # DE = definitive endoderm (day 6) # IH = immature hepatoblast-like (day 14) # EC = endothelial cells # HUVEC ...
a764a952ea8dc90328786a39ed5e64f0cf399b09c2a5107bdfbdbccdf1688de2
R
2,881
87
library("stars") library("ggplot2") library("cowplot") library("ggnewscale") dem = read_stars("data/variables/01_ELEVATION.tif", proxy = TRUE) dem = st_downsample(dem, 15) # downsample to 480 m dem[[1]] = as.integer(dem[[1]]) names(dem) = "dem" tmp = tempfile(fileext = ".sdat") system( paste( "saga_cmd ta_light...
e3824d7eeb132569d3ab37c4e858031523bafcd080dfe0730dac1fb8132773e1
R
2,886
34
--- title: "About" output: workflowr::wflow_html: toc: false editor_options: chunk_output_type: console --- # Transient galanin expression shapes peripheral‑to‑central connectivity in the somatosensory thalamus during whisker development This repository contains code and output of the analysis of single-nucle...
9902a335123505001784cf15bdb3f87c79ddff9f530b623cfdb01cfd25870ca5
R
2,900
84
# this is a toy example to illustrate how to use the BAUM package # data is available under the same folder # metabolites network, features, and potential matchings are a part of the # covid-19 metabolomics data # for details, please look at our paper: # Guoxuan Ma, Jian Kang and Tianwei Yu. (2023+). Bayesian Function...
118b2199d4c8db5829323f5cda1178435cb9c16dac9461db002fa596162fae9d
R
2,905
80
if (!requireNamespace("BiocManager", quietly = TRUE)) { install.packages("BiocManager") } BiocManager::install("celda") library(celda) library(SingleCellExperiment) setwd("/data/mayerlab/cmayer/meis2_paper/results") P7GE_sub <- readRDS("/datastore_share/Users/mayho/meis2_paper/seurat_objects/P7GE_sub.rds") DimPl...
3d0ab61b58682aeb7ae25a18ab2936774685568907379431408ac3b71400d4f0
R
2,905
77
source("/cbica/projects/network_replication/manuscript/code/scripts/main_analyses/computeConnectivityMetrics.R") ################## # Set Variables ################## args <- commandArgs(trailingOnly = TRUE) dataset = args[1] ################## # Set Directories ################## config_data <- fromJSON(fil...
141fde2f914032243bc7859134a307b11c04e256f246c631f2a7ad679e8bf80f
R
2,929
110
#' @importFrom utils packageVersion #' @noRd .onAttach <- function(libname, pkgname) { if (!grepl(x = R.Version()$arch, pattern = "64")) { warning("The StellarPath package requires running R on a 64-bit systems as it is dependent on torch from ptyhon; and you're system is not 64-bit.") ...
652514a04873cc59445986f361a50312c1ef2ea53d8d2903c7b4898bc6d05b06
R
2,929
102
importfiles <- function(outputfilename) { namesoffiles <- list.files() namesoffiles <- namesoffiles[grep("mapping", namesoffiles)] importedlist <- lapply(namesoffiles, read.csv) unlisted <- unlist(importedlist) numberofsamples <- as.numeric(length(namesoffiles)) numberofrows <- numberofsamples * 2 numberofbarcodes <...
362cb5e091265f9649484bd0447fcfd6abe96310bc3c270dcef1ec344daf75d5
R
2,931
72
# Check whether the activity in IPC durign Clock Navigation Experiment correlates with Path Integration Performance library('ggplot2') library("ggpubr") library(ppcor) library(rstatix) library(ggprism) #SC ----- # Load the Df SC_PI_IPC<-read.csv('/Volumes/ROBBOT/Projects/GridMagination/Tables/03_Correlations/SC_PICo...
00abfaa843d795d24982fa9ad507b5394f1745c264f6d88e7204aafc0c8f0085
R
2,934
89
##DE Analysis expr.c<-read.csv("~/Desktop/Rhythmicity Code and Output/Example_data.csv", row.names = 1) clin_ctrl<-read.csv('~/Desktop/Rhythmicity Code and Output/Example_clinical.csv', row.names = 1) n<-nrow(expr.c) Symbols<-row.names(expr.c) TOD<-clin_ctrl$TOD night.index.neg<-which(TOD < 0) night.index.pos<-which(...
75eb4fae24601c99315830dd1707e31af611b8201f73d6b740bd303434a91309
R
2,942
106
####install libraries#### # { # install.packages("nlme") # install.packages("data.table") # install.packages("emmeans") # install.packages("lmerTest") # install.packages("lattice") # install.packages("plyr") # install.packages("ggplot2") # install.packages("Renext") # install.packages("ggsn") # ins...
4937e8986df8b5bf2d516fcc2231de9e4b4b05b5cf81cd39d63949a50034d231
R
2,945
79
library(pso) library(dplyr) library(ggplot2) devtools::load_all('~/Workspace/breaktools/') load("~/Workspace/Everything/DSB_Paper/data/data_matices.rda") load("~/Workspace/Everything/DSB_Paper/data/training_parameters.rda") mtx_source <- do.call(cbind, data_matrix) mtx_target <- do.call(cbind, repliseq1_data_matrix) ...
f4f657cb08d25cc51c67ebfb38497f8ec537b1fbc49625e9cd2e05a3f3fa8853
R
2,945
53
### DATA Nestorowa = read.table("coordinates_gene_counts_flow_cytometry.txt", header=T) Anno = read.table("all_cell_types.txt", header=T) Anno <- Anno[order(rownames(Anno)),] rownames(Anno) <- gsub("-",".",rownames(Anno)) ### ANNOTATIONS expr_mat = t(Nestorowa[,28:length(Nestorowa[1,])]) #rownames(expr_mat) <- ensg2sy...
ccf37694d5ca3ca819d0a38a93551e83e5bd4db447d5e25631796d21576bdc76
R
2,962
97
######################################################################################### # R script to calculate and plot a 2-dimensional t-SNE (Barnes-Hut-SNE) projection map # from a 13-dimensional mass cytometry data set ("Marrow1" from Amir et al. 2013, see # Figure 1b), using Rtsne package # # References: # # Am...
9fc60c1bb1fb21465a904670ed0e0ddd66cf046e0afc0ad24d856bb40ba9a7fa
R
2,993
100
test_that("consensusGRanges() works with minimum.width defined", { # Testing by an artifical GRanges. # NOTE - if the artifical GRanges described here changes, # We need to save the `.rds` file again! gr <- makeGRanges( tibble::tribble( ~start, ~end, ~seqnames, 1, 1...
d9fd47fe4741442b0481df224fa88546991e7c0841b132e4b16f73104e4a3ff6
R
3,014
72
# Set directory to source file loaction setwd(paste0(figureDirectory, "Figure6-candHeatmap" ) ) library(pheatmap) library(stringr) library(grid) library(RColorBrewer) load("geneCandidates.RData") candGenes_biolFunction_summary <- read.csv("candGenes_biolFunction_summary_validation.csv") rownames(candGenes_biolFu...
ca3acba21997ee89aed3e6b4eb5711ba2e2f045da7d0616ec0b7d5f4ba2dffec
R
3,016
81
rm(list = ls()) options(stringsAsFactors = F) library(tidyverse) library(AnnotationForge) library(stringr) librarywd="build" setwd(librarywd) egg <- rio::import('out.emapper.annotations.tsv',fill=TRUE) names(egg)[1]<-"query_name" egg[egg==""] <- NA egg[egg=="-"] <- NA # colnames(egg) gene_info <- egg %>% dplyr::s...
a43e9345874d7c8d5c908c38e11a95b56d81843835a43490581401843e163a11
R
3,018
80
source("/cbica/projects/network_replication/manuscript/code/scripts/main_analyses/computeConnectivityMetrics.R") ################## # Set Variables ################## args <- commandArgs(trailingOnly = TRUE) dataset = args[1] ################## # Set Directories ################## config_data <- fromJSON(fil...
3a45ddd5dd276bbb83801b99aa99f1147a9a1203665e2e936beeab7ec7447182
R
3,019
90
bestModelSelection <- function(aGeneIndex,expressionMatrix,covariables3,Diagnosis,UniqueID,VariableListOne,VariableListTwo){ library(lme4) curGeneExpression = as.numeric(expressionMatrix[aGeneIndex,]) ## mixed model with adjusting for covariates basicFormula = update(curGeneExpression ~ Diagnosis+(1|Uniqu...
8711a6c1878ab15f40bec7f77b075b1de18f4f23c9bb78a4dba8a22e20233c3f
R
3,020
80
source("/cbica/projects/network_replication/manuscript/code/scripts/main_analyses/computeConnectivityMetrics.R") ################## # Set Variables ################## args <- commandArgs(trailingOnly = TRUE) dataset = args[1] ################## # Set Directories ################## config_data <- fromJSON(fil...
5eac208de7c2bc056ace34b568344b9368631c87f97253e99f6f8008ba3ef0f7
R
3,027
70
# required external packages for SIMLR library("Matrix") library("parallel") # load the igraph package to compute the NMI library("igraph") # load the palettes for the plots library(grDevices) # load the SIMLR R package source("./R/SIMLR.R") source("./R/compute.multiple.kernel.R") source("./R/network.diffusion.R") s...
28a225787c0935a7d1a2603c0bcc306513bad96e1d56bb4a6c56f70455e80f85
R
3,028
82
source("/cbica/projects/network_replication/manuscript/code/scripts/main_analyses/computeConnectivityMetrics.R") ################## # Set Variables ################## args <- commandArgs(trailingOnly = TRUE) dataset = args[1] ################## # Set Directories ################## config_data <- fromJSON(file...