sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
b3324a20243e6386217a8f4979a79de2db97ec44a0afa2abe5f881991f1b751a
R
901
26
#' OpenSRA #' #' Open SRA file into FASTQ file. The script will create new directory called FASTQ with the fastq files. #' @param File The Path to the SRA File #' @param Library_Type "Paired" or "Single" #' @param SRAPath path for the SRAtools BIN directory (example: SRAPath = "~/SRAtoolkit/sratoolkit.2.5.4-ubuntu64/bi...
6e5711e915bd7382c4d0fb3892bc16f1bb45d9042bd1787100634f8ed8da590d
R
908
26
#' Prejudice Remover #' @description Prejudice remover is an in-processing technique that adds a discrimination-aware regularization term to the learning objective #' @param eta fairness penalty parameter #' @param sensitive_attr name of protected attribute #' @param class_attr label name #' @usage prejudice_remover(et...
99b00a8043d767e30a6fddc6b0d785df82f79ea198dc6977fe3ceb4e473348ab
R
908
37
# ѰÕÒintergenicÇøÓòÉϵÄÔöÇ¿×Óλµã setwd(dir = "D:/R_project/UCR_project/") rm(list = ls()) library(rtracklayer) library(BiocManager) BiocManager::install("Biostrings") library(Biostrings) # ¶ÁÈ¡bedÎļþ intergenic <- read.table(file = "01-data/10-GO_enrichment_analysis/intergenic_UCR_neighboring_gene.bed") interge...
120e961cb3920ba8b727c7989b8f8f338612ecb1c22c965d1c7a61915b42c678
R
913
25
#Integrate all samples ########################################################################################### #Load library library(Seurat) #Create directory to store integrated samples dir.create("3_integrated_samples", showWarnings=T) #List input files input_files = list.files(path="2_results_norm", pattern="...
89e35ed839da676be872710ff2d82b3b08974afb8bf443fadb2317c8539396fc
R
923
30
#' Function to download fetal midbrain atlas #' #' Function to download a seurat object containing the fetal midbrain atlas from the zenodo repository #' #' @param file path to save the file #' @param mini True to download a downsampled atlas which contains 10\% of the cells in the fetal midbrain atlas. Default is FAL...
29cf9bd52090c9aee510fa5bd102e33b050207ac89ac1ceaedace9c1ed10764f
R
935
21
rm(list = ls()) source('CVASL_RELIEF.R') library(MASS) library(Matrix) options(repos = c(CRAN = "https://cran.r-project.org")) install.packages("denoiseR", dependencies = TRUE, quiet = TRUE) library(denoiseR) ins...
33f9c024f89040dba1fff4793d328f7dcc5d11c0a7dc4a176757e480b00975b5
R
936
30
#' Function to download fetal whole brain atlas #' #' Function to download a seurat object containing the fetal whole brain atlas from the zenodo repository #' #' @param file path to save the file #' @param mini True to download a downsampled atlas which contains 10\% of the cells in the fetal whole brain atlas. Defau...
60881548ea913288a16cb3187f9bb022c74e54a52af6b1d5c342000c1214c6f2
R
940
25
# Load required packages required_packages <- c("ggplot2", "readr") for (pkg in required_packages) { if (!requireNamespace(pkg, quietly = TRUE)) install.packages(pkg) library(pkg, character.only = TRUE) } # Load data data <- read_csv("Data/shared_compound_data.csv") # Generate bubble plot shared_comp_plot <- ggpl...
9ffce3889fee5c5adcc7975dbee02918f38371bbbea6d3b437ed2c2d135fb76f
R
941
28
### MNT add 18Jun2021 ======= # Check Read 1 files for discrepant read lengths, as seen with the original Br5182-NAc: # Should be exactly 28bp = 16 [BC] + 12 [UMI] library(ShortRead) library(jaffelab) FASTQ.dir <- "/dcs04/lieber/lcolladotor/rawDataTDSC_LIBD001/raw-data/2021-10-15_Tran2021_published/Br5182_NAc_res...
fd88bc62d56b7f113d9924b46f209a818591156ce8a2c008a3492a17cbc6437f
R
942
30
# libraries --------------------------------------------------------------- #Load libraries library(tidyverse) library(Seurat) #devtools::install_github('satijalab/seurat-data') library(SeuratData) library(BayesSpace) library(patchwork) # read in data ------------------------------------------------------------ # read...
fab909592fa9a96e69dc13cdc06c576b6065f1bb6fb340ded7c7a751942b4416
R
944
37
# FairAdapt called from R wrapper <- function(train_data, test_data, adj_mat, res_vars = NULL, prot_attr, outcome) { prot_attr <- gsub("-", ".", prot_attr) outcome <- gsub("-", ".", outcome) train_data <- as.data.frame( lapply(train_data, function(x) { if (is.ordered(x)) class(x) <...
ae362a09a7b4375300b25676534708d40e9a663440a99b041a6fa062170bf1c3
R
945
37
library(GenomicPlot) library(TxDb.Dmelanogaster.UCSC.dm6.ensGene) bed_file <- "/Volumes/T9/drosophila_nanopore/DRS_basic/results/control_m6A_loci_sort.bed" names(bed_file) <- c("control") bed_file2 <- "/Volumes/T9/drosophila_nanopore/DRS_basic/results/meclip_m6A_loci.bed" names(bed_file2) <- c("control2") suppre...
181fdbd812e576c2e44cb73e10f4f897edd62b6c27c9d1c221081ac25be6bfcb
R
949
20
# createConfirmedCityTreemap <- function(dataset) { # parent <- "県名" # child <- "市名" # value <- colnames(dataset)[ncol(dataset)] # setnames(dataset, value, "累計") # dataset %>% # e_charts() %>% # e_treemap(県名, 市名, 累計, # upperLabel = list(show = T, color = "#222"), # left = "1%", right = "1%...
0192d57cc0043715e95b254f8a718ee1478a3d7932952d63861088894ddea00e
R
967
32
library("argparse") library("ggplot2") library("patchwork") library("tidyverse") library("Seurat") # Command line arguments ---- parser <- ArgumentParser(description = "Differential expression analyses") parser$add_argument('--seurat', '-s', help = 'Seurat object') parser$add_argument('--results'...
1c07ca09a44773cae23014203efd1afade599faea10333b4d3620bb5c2823e2c
R
967
23
library(misha.ext) options(timeout = 900) # Download and extract the core IQ paper data first download.file("https://iq-paper.s3.ap-south-1.amazonaws.com/IQ-paper-data.tar.gz", "IQ-paper-data.tar.gz") untar("IQ-paper-data.tar.gz", exdir = ".") # Create genome databases gdb.create_genome("mm10", here("data")) gdb.cre...
73952af1392b709accac543c51b17e130c3d7d34955388f12b956b04b2fdf974
R
967
26
# 総計検査人数Sparkline ==== output$pcrSparkLine <- renderSparkline({ sparkline( tail(mhlwSummary[, .(cumsum = sum(検査人数, na.rm = T)), by = "日付"][, .(diff = cumsum - shift(cumsum))], n = 28)[[1]], type = "bar", width = 100, barColor = "white" ) }) output$confirmedSparkLine <- renderSparkline({ value <- rowSums...
146c9becb5fceb4e01f3b9e1b52c99d930b158b1079e968b60cbe41e30b669d3
R
973
44
# ÔÚ¸»¼¯·ÖÎöÖ®ºó£¬²é¿´all coding genesÔÚËùÓÐÆ÷¹Ùµ±ÖеÄpattern # ·¢ÏÖÔÚ´óÄÔµ±ÖÐAS pathwayµÄ»ùÒòÓÐspecific pattern£¨ÕâÀïÎÒÏë»æÖÆÒ»¸öÈÈͼ£¬²»Õ¹Ê¾»ùÒòÃû£¬ÒòΪ»ùÒòÌ«¶à£© # ÔÚmouse¡¢ratµÄbrainµ±Öв鿴AS pathwayµÄ»ùÒòµÄpattern setwd(dir = "D:/R_project/UCR_project/") rm(list = ls()) library(tidyverse) library(pheatmap) libr...
37fc39c65cf7cceb63d126e733285f96e4912d676cc18184ef6b37aa875daa54
R
974
41
# count the % of ASoC SNPs that resides within peaks # that also falls into MicroC bait intervals whose target # resides in TSS region (-2 kb ~ +1 kb) # use separate npglut peak sets (0/1/6) # this will not be necessary since ASoC SNPs are always inside peaks # Siwei 16 Feb 2024 # init #### library(Seurat) library(S...
9dbf106bf7c15326cbccc9d851e8cf8f954ff352ef4205b9aae0742c15995e44
R
975
18
setwd("MERFISH_Moffit/") library(Seurat) library(Matrix) MERFISH <- read.csv(file = "data/MERFISH/Moffitt_and_Bambah-Mukku_et_al_merfish_all_cells.csv", header = TRUE) MERFISH_1 <- MERFISH[MERFISH['Animal_ID']==1,] MERFISH_1 <- MERFISH_1[MERFISH_1['Cell_class']!='Ambiguous',] MERFISH_meta <- MERFISH_1[,c(1:9)] ...
c280adb1032e1deeca2b54685f161966804ae40834afb2e1846a7488f99bd868
R
981
29
# load packages require(tidyverse) require(Seurat) # load Seurat object and gene names sdata.align <- readRDS('sdata_align_RefF_prelim.rds') gene.names <- read_csv('gene_names.csv') # set default assay to 'RNA' DefaultAssay(sdata.align) <- 'RNA' # reduce object size sdata.align[['integrated']] <- NULL # check, use ...
ace43f83898c9bc1b59dac2ef60f3b7b4309dd403c997572850c850eaec2d743
R
988
20
library(Seurat) library(Rmisc) load("CNVfiltered.IntegrateData.RData") get.id = function(y){y = paste0("^",y,"-ENSG");grep(pattern = y,x = rownames(embryo.integrated_CNVdefined@assays$RNA@counts),value = T)} chrom.state = c("E",paste0(c(1:22,"X","Y"),"T"),paste0(c(1:22,"X"),"M")) term.names = c("Apoptotic","Stress res...
6c2fc6383ff32362aec42096faae506b70ba68bcbf5f42bd12278473dc26ea82
R
995
33
args=(commandArgs(TRUE)) library(dplyr) library(survival) library(survminer) setwd(args[5]) table <- paste(args[1], args[4], "survival", sep="_") label1 <- paste(args[4], "Low", sep="_") label2 <- paste(args[4], "High", sep="_") heading1 <- paste("Kaplan-Meier curve", args[3], "in", args[2], sep=" ") heading2 <- past...
a8766239f98b280a184599988ee52c7330b34acfd4b65e6616028a16b9ff6f60
R
999
48
# Siwei 16 Jan 2024 # plot fig. 6b use plotly # init #### library(ggplot2) library(RColorBrewer) library(readxl) library(stringr) library(plotly) # load data #### df_raw <- read_excel("Fig6b_12.xlsx") # Fig 6b #1 ##### df_to_plot <- df_raw[, c(1, 2)] df_to_plot$Gene <- factor(df_to_plot$Gene, level...
958a18582192d6bc5442a501f41513e0508ad83423336f006cb1132ec3bccb77
R
1,003
35
#!/usr/bin/env Rscript library(DESeq2) df <- read.table('data/ercc.tsv', header=T) sample_df <- data.frame(samplename = names(df)[2:ncol(df)]) sample_df$sample <- substr(sample_df$samplename, 1,1) sample_df$batch <- substr(sample_df$samplename, 3,3) row.names(sample_df) <- sample_df$samplename sample_df$sample <- f...
f2094ac776aeba613c5736e043b5b4109a5a63c65145418bd06400066b9f535a
R
1,006
28
library(zellkonverter) library(here) library(tidyverse) library(SingleCellExperiment) library(sessioninfo) sce_ad_path = "/dcs04/lieber/lcolladotor/spatialDLPFC_LIBD4035/spatialDLPFC/raw-data/psychENCODE/version6/CMC_update_Feb2023/CMC_annotated.h5ad" meta_path = '/dcs04/lieber/lcolladotor/spatialDLPFC_LIBD4035/spatia...
8b1b16c5b04b207e2055eb6adc1479a7e9638d756898b3dd7c959e08815e739d
R
1,010
43
getLatestWeekValue <- function(data, type = "week") { if (type == "day") { span <- 1 } else if (type == "week") { span <- 6 } else { stop("Unknown span type.") } index <- (nrow(data) - 6):nrow(data) indexBefore <- index - 1 value <- colSums(data[index, 2:ncol(data)]) valueBefore <- colSum...
ee4734884e9abd9727c3142fe91479ce6354a3b103232e01fe1d04e6f57cda9c
R
1,011
23
setwd("/project2/xinhe/xsun/neuron_simulation/2.torus") df_snp <- readxl::read_xlsx("data/SNPs_for_Torus.xlsx",sheet = 3) colnames(df_snp)[(ncol(df_snp)-2):ncol(df_snp)] <- c("chr","start","end") df_snp <- df_snp[complete.cases(df_snp$chr),] index <- seq(2,nrow(df_snp)*2, by =2) chr <- unlist(strsplit(df_snp$chr, sp...
8ecc009c2cc4a27bd570899be1597c104ccc5a035c703a523a27caad35c66063
R
1,013
47
library("SingleCellExperiment") library("rafalib") library("iSEE") library("pryr") library("here") library("whisker") library("usethis") library("withr") library("sessioninfo") load(here("rdas", "regionSpecific_DLPFC-n2_SCE_cellTypesSplit-fromST_Apr2020.rda"), verbose = TRUE) source(here("shiny_apps", "00_clean_funct...
0f070670b5735fe3a7d2a4f88b3f0afa1ac06c18cdb702f3afc6e79bdc1058fa
R
1,021
40
library(here) # params # load #------ # paths #------ # project proj.dpath <- "Human_DLPFC_Deconvolution" save.dname <- "008_revisit-halo-settings" save.dpath <- file.path(here(), proj.dpath, "processed-data", save.dname) # new halo data halo.new.dname <- "Algorithm_Check_20220920" halo.dpath...
e0628476215af72815e7c16d55f3b823d61a82d77e808cdd0d85eb1e3c58fee7
R
1,025
52
library(fgsea) library(tidyverse) library(xlsx) files <- list.files(# pattern="*all_genes.csv", full.names = TRUE, recursive = FALSE) i <- 0 for(file in files) { print(file) res <- read_csv(file) celltype <- sub("./", "", str_split(file, "_")[[1]][1]) res2 <- res %>% dplyr::s...
0d55fa73f5cd636baaf44fde2c7d706a2935d509d45b27ef741b9d264a3ff810
R
1,027
27
library(stats) path2data = '/Volumes/server/Projects/attentionpRF/derivatives/amplitude_data' #path2data = '/Users/ekintuncok/Desktop' data_tbl = read.csv(paste(path2data, "amplitude_data_for_ANOVA.csv", sep = '/')) data_tbl$id <- as.factor(data_tbl$id) data_tbl$ROI <- as.factor(data_tbl$ROI) data_tbl$Location <- as.f...
3b44a5a7310aaa76204b7e0687053b36824e7316f3fe25331e732ff6e9fef618
R
1,027
29
# load packages require(tidyverse) require(Seurat) # load Seurat object (pre-doublet identification) and gene names sdata.align <- readRDS('sdata_align_snRNA-seq_prelim.rds') gene.names <- read_csv('gene_names.csv') # set default assay to 'RNA' DefaultAssay(sdata.align) <- 'RNA' # reduce object size sdata.align[['i...
f5b9c4f4bd60389ec58c1ce35647fc812f67602c3603ac3e745811fa6ff08fbc
R
1,028
31
#!/usr/bin/env Rscript suppressPackageStartupMessages({ library(dplyr) library(optparse) }) # importing option_list = list( make_option(c("-i", "--input"), type="character", default=NULL, help="input JWR output file"), make_option(c("-j", "--JAQ"), type="numeric", default=NULL, he...
8eb0fb1e7c7fc53d1c8bf8a44fc74633a9bab8c3e0040bfaaadacdb27c4d4d6d
R
1,029
21
##' @importFrom utils packageDescription .onAttach <- function(libname, pkgname) { pkgVersion <- packageDescription(pkgname, fields="Version") msg <- paste0(pkgname, " v", pkgVersion, " ", "For help: https://dingruofan.github.io/xQTLbiolinks/", "\n\n") # if (capabilities("libcurl")) { # dl.m...
3bdcf7160fdc234dde4c755eff8a9f77288941d9aaed9a568bc020ea5a1afa02
R
1,030
27
#' Disparate Impact Remover #' @description Disparate impact remover is a preprocessing technique that edits feature values increase group fairness while preserving rank-ordering within groups #' @param repair_level Repair amount. 0.0 is no repair while 1.0 is full repair. #' @param sensitive_attribute Single protected...
b4ccb58d7304291bdc66b8b570f65d06e9616b40f64cc0e80437ea5a0f846dba
R
1,030
13
#!/usr/bin/env Rscript ### title: Load results of rctd pipe line for all spatial data, and convert their cell type assignments into txt format ### author: Yiping Wang date: 03/29/2022 pats = c("MBM05_rep1_slide","MBM06_slide","MBM07_slide","MBM08_slide","MBM11_rep1_slide","MBM18_slide","MBM13_slide","MPM08_pre_slide"...
c8a6e57a00a3f115bb2696b30d6ab97f9031323be9da4f2523eca5b3aed0e8f4
R
1,030
41
options(digits=15, scipen=999) # Example 3.3.2 from Brockwell and Davis ar_params = c(1, -0.25) ma_params = c(1) print(ARMAacf(ar_params, ma_params, lag.max=9)) # Custom example 1 ar_params = c(1, -0.25) ma_params = c(1, 0.2) print(ARMAacf(ar_params, ma_params, lag.max=9)) # Custom example 2 ar_params = c(1, -0.25) ...
9aa0c17b1d110992e5e8ebb7dbaab5ea4d7344ea1645534d51f580b677a967b7
R
1,036
29
# load packages require(scDblFinder) require(Seurat) require(tidyverse) # load Seurat object sdata.align <- readRDS('sdata_align_snRNA-seq_label.rds') # set Idents to scDblFinder-compatible cluster names Idents(sdata.align) <- sdata.align$seurat_clusters <- sdata.align$integrated_snn_res.0.5 # convert Seurat object ...
c3d6769096428ef5d47b44e7f729d07d77e1a01c56015e604dd317223e8b7ac0
R
1,038
43
#' List of Subjects #' #' Get subid and sesid of a set of subjects, given a csv. TODO: Add filtering by conditions? #' #' @description This function takes a table of subjects in csv format and returns a list of (subid, sesid) tuples(lists) #' #' @param table: input table #' #' @return list of lists with the duple (subi...
a2c7cb5798c34b0e6acf2663b16a65842d54fea136f4a12e0545d76029d93d45
R
1,040
50
# organize the classification of UCR setwd(dir = "D:/R_project/UCR_project/") options(stringsAsFactors = FALSE) rm(list = ls()) library(tidyverse) library(ggplot2) codingUCR <- read.table( file = "02-analysis/16-New_classification/01-UCR_from_protein_coding_gene.bed", sep = "\t" ) length(unique(codingUCR$V4)) #...
b068156a6cb2e6176e9c54eff97de38f86a9bd681a383e334c7d60219978fb13
R
1,043
34
# this script exports the counts matrices to CSV files for collaborators # output is sent to a temporary dir as we do not need to keep these long-term library(DESeq2) library(tidyverse) dds <- readRDS("results/DESeqDataSet/dds_gene_regular.rds") # get the gene names gene_meta <- rowData(dds) |> as_tibble(rownames...
db877940a71eb77644992265d26562f37bb264f1df9e176fa2c41d025a3764dc
R
1,049
40
library(glmnet) library(R2nparray) # Run the glmnet lasso (elastic net) on all the test data sets data = read.csv("lasso_data.csv", header=FALSE) ik = 0 rslt = list() for (n in c(100, 200, 300)) { for (p in c(2, 3, 5)) { endog = data[1:n, 1] exog = data[1:n, 2:(p+1)] exog = as.matrix(ex...
75b12c1008aaf982110a38c7f2528cf358b1a743bc7c2cac65041aea81032e45
R
1,053
29
# This script was run interactively to investigate whether MuSiC involved # randomness (and thus must be run with a seed for reproducibility). It does # not involve randomness. library(MuSiC) library(SingleCellExperiment) GSE50244.bulk.eset = readRDS(url('https://xuranw.github.io/MuSiC/data/GSE50244bulkeset.rds...
7fec32ffcfd420339fa46456a10373270c2e495bf9d5634e84b9dc359c815d1d
R
1,053
19
# script to divide log files properly library(tidyverse) # figure out which files need to be converted fl.path = paste('/home/emba/Documents/EMBA', 'BVET', sep = "/") # file path fls.log = list.files(path = fl.path, pattern = "*\\.log$", full.names = F) # get all log files fls.log = substr(fls.log...
663e11ded50dbb972adaa57e6c7a1e2d72fbc692c59ced4173fe05bbf902f2f5
R
1,055
67
# ClinPred Score setwd(dir = "/home/wangxiangting/baiyun0216/projects/UCR/data/41-SNPsPathogenicityEvaluation") options(stringsAsFactors = FALSE) rm(list = ls()) library(tidyverse) library(stringr) ## load all SNPs info # load("passed_UCR_SNPs.Rdata") # load("passed_UCR_left_SNPs.Rdata") # load("passed_UCR_right_SNP...
e50b9217291cae30221c3d615bbf329661c0898e64ccfb4b9b58a991a6810c06
R
1,059
34
#S2 library(ggplot2) hg38TE <- read.csv("~/github/pBrain/data/hg38rmsk_info.csv") young_TE <- read.csv("~/github/pBrain/data/Dfam_TE_simiiformes.csv") hg38TE_age <- hg38TE %>% mutate(age = ifelse(repName %in% young_TE$NM, "young", "old")) %>% select(c(3,4)) hg38_old <- hg38TE_age %>% filter(age=="old") %>...
65abab78d1e17c5ae77308ca178bbcb3769e7fbb1354ef4155f4aef37498c1f1
R
1,060
33
# ÓÃlncRNAÏà¹ØµÄµ°°×±àÂë»ùÒò×ö¸»¼¯·ÖÎö setwd(dir = "D:/R_project/UCR_project/") rm(list = ls()) library(tidyverse) library(biomaRt) ncRNA_UCR <- read.table(file = "02-analysis/16-New_classification/ncRNA_UCR(66)_ensembl_id.txt", sep = "\t") ncRNA_UCR <- unique(ncRNA_UCR) # ÀûÓÃuseMartÁ´½Óµ½ÈËÀàµÄÊý¾Ý¿â£¬ÆäËûÊý¾Ý¿âÊ...
5e80518fcbff4d10afdf1adbb4819907627014de7aa24cd663ed9959535fe060
R
1,065
53
#Environment and relevant functions for sc analysis # Single-Cell Analysis library(Seurat) library(SeuratWrappers) library(Signac) # Data Visualization library(ggplot2) library(patchwork) library(ggpubr) library(viridis) library(cowplot) library(ComplexHeatmap) library(circlize) # Data Manipulation library(dplyr) lib...
85d9156635cc24cf9af82fcd15bfce45529cc8d49891ff4939078a3e2f6c2e17
R
1,067
22
#' Effect of high fat diet on the liver transcriptome - Microarray #' #' Time-series data of the mouse liver transcriptome measured under normal chow #' read using custom CDF file from Brainarray version 24.0.0 annotated by #' Ensembl Gene ID followed by RMA normalization. The expression data are in the #' log2 scale. ...
93be36fca541e8c9f02da3208138efe0f8c7d75b77e0bc86b7420d35a0ed52fc
R
1,067
36
context("Comprehensive Test for Inprocessing Adversarial DebiasingAlgorithm") test_that("running dataset test", { dd <- aif360::binary_label_dataset( data_path = system.file("extdata", "data.csv", package="aif360"), favor_label=0, unfavor_label=1, unprivileged_protected_attribute=0, privileged_p...
369fea565adabb1bdf087f78bae36e8ef6bcaa1ba1d369382152486a82fe5f45
R
1,068
29
library(dplyr) library(Seurat) library(Matrix) library(sva) library(ggplot2) library(harmony) read_data <- function(folder_path) { cells <- read.csv(file.path(folder_path, "Cells.csv"), row.names = 1) genes <- read.table(file.path(folder_path, "Genes.txt"), header = FALSE) mtx_files <- list.files(folder_path, pa...
5b0dead35f9cf145e50b307b8984d223ead6426ac05f835f7ef73fa00356c938
R
1,071
20
#script to download, unpack, and read in data from Massri 2021 #make new directory for these data dir.create(here::here("objects", "Massri_data"), showWarnings = FALSE) #extend timeout for large download options(timeout = max(1200, getOption("timeout"))) #20 minute timeout (default is 1 minute) #download from SRA (~...
bb4ac4fe592db526aaca7a419bee79aca79ef6774aa7ec9b4af226f6e2267378
R
1,072
40
# install packages if needed BiocManager::install("GenomicPlot") BiocManager::install("TxDb.Dmelanogaster.UCSC.dm6.ensGene") library(GenomicPlot) library(TxDb.Dmelanogaster.UCSC.dm6.ensGene) txb <- bed_file <- "/Volumes/T9/drosophila_nanopore/DRS_basic/results/control_m6A_loci_sort.bed" names(bed_file) <- c("Co...
27cfbba8b24bf0f6bf1c3ec05d8579e00dd6cff9d1c84cdffdcce913a26398e5
R
1,078
33
library(tidyverse) library(ggplot2) library(moonBook) library(webr) # Setting working directory ----------------------------------------------- this.dir <- dirname(parent.frame(2)$ofile) setwd(this.dir) # Data paths -------------------------------------------------------------- project_path <- file.path(getwd(),'...
97db9089b57f818ecaad521cae19242965a9644df500485b9df21e0fc5b18c07
R
1,088
38
# plot practise # Siwei 6 Feb 2019 # init library(Gviz) # data("cpgIslands") library(rtracklayer) library(BSgenome) library(BSgenome.Hsapiens.UCSC.hg38) library(TxDb.Hsapiens.UCSC.hg38.knownGene) library(ensembldb) library(org.Hs.eg.db) library(grDevices) ########## options(ucscChromosomeNames = F) make_assembled_pl...
599d9a4f59dff88e0f1c39126e2a6e1cfb807ac497c6b1e22d1c0cd96acff3b2
R
1,090
48
library("SingleCellExperiment") library("rafalib") library("iSEE") library("pryr") library("here") library("whisker") library("usethis") library("withr") library("sessioninfo") load(here("rdas", "ztemp_Amyg-n2_SCE-with-tSNEonOptPCs-minus-PC5_MNT.rda"), verbose = TRUE) source(here("shiny_apps", "00_clean_functions.R")...
74d5357f25ba054cba4b72e1e21dfb8f8224a9228b6bab50995d101b55bdf4dc
R
1,091
29
## Calculate neuron (NeuN), oligodendrocyte (Sox10), microglia (IRF8) and astrocyte-enriched (TN) proportions in bulk postnatal samples ## # https://github.com/ejh243/CETYGO library(CETYGO) #1. Load data ==============================================================================================================...
318e2508e8d0910b749778c79c9562561cf15dd43f3c5f244d21256647bec8fc
R
1,092
23
# get all file names # hidden files are not selected incl_files <- list.files(path = "./", recursive = TRUE) # remove certain files incl_files <- incl_files[!grepl(x = incl_files, pattern = "^(240220.*|neurolipid_meta.csv)$")] incl_files <- incl_files[!grepl(x =...
5bb3cf66c0790f73e058dddb4f45f962ebdce4bc361f75e400d4834f27dbfa8b
R
1,092
25
#' Reweighing #' @description Reweighing is a preprocessing technique that weights the examples in each (group, label) combination differently to ensure fairness before classification #' @param unprivileged_groups a list with two values: the column of the protected class and the value indicating representation for unp...
fdefe91a65e5946efd4dd542cc7d3573f76b0a4cfccfe46ec3d4ed20c38c48f3
R
1,101
32
# load packages require(tidyverse) require(Seurat) # load Seurat object (singlet-only dataset) and gene names sdata.align <- readRDS('sdata_align_snRNA-seq_singlet.rds') gene.names <- read_csv('gene_names.csv') # set default assay to 'RNA' DefaultAssay(sdata.align) <- 'RNA' # set Idents to cluster labels Idents(sda...
c06b7d680871f19beb51b2beb5acc16c7f4aa200b6ecce9af99fc345bba44e7b
R
1,107
32
# load packages require(tidyverse) require(jmotif) # load data bin.data <- readRDS('bin_data_filtered.rds') # scale data bin.data.scale <- bin.data %>% unite('rowname', time_point, genotype, mouse_id, mouse_name) %>% column_to_rownames() %>% t() %>% scale() %>% t() %>% as_tibble(rownames = 'rowname') %>% se...
204cb8b9f63a0cec8c51c7ac887c4ebd297b559b8b59c2e4079be398af2c36b5
R
1,108
42
#!/usr/bin/env Rscript # to use nf variables: "${meta.id}" # load libraries library(anndataR) library(SeuratObject) library(SingleCellExperiment) # read input adata <- read_h5ad("${h5ad}") # convert to Seurat obj <- adata\$as_Seurat() # save files dir.create(file.path("$meta.id"), showWarnings = FALSE) saveRDS(obj...
ef365443ca7af02a35f842b7fec4aa54e021532d65f26e7dfde0c33dd3cef088
R
1,109
48
library("SingleCellExperiment") library("rafalib") library("iSEE") library("pryr") library("here") library("whisker") library("usethis") library("withr") library("sessioninfo") load(here("rdas", "regionSpecific_sACC-n2_cleaned-combined_SCE_MNTFeb2020.rda"), verbose = TRUE) source(here("shiny_apps", "00_clean_function...
6f7593e83d44bf6c2c3089bed594bc6b9ddee82f4d70302511f0852199ac4d35
R
1,116
47
library(readxl) library(writexl) # User-defined inputs --------------------------------------------------------- # Filenames datafile = 'input_data_perform_SEnorm/brain_metabolites.xlsx' factorfile = 'SE_factors.xlsx' opfilename = 'output_SEnorm/SEnorm_brain_metabolites.xlsx' # First column number of MID data index...
b4b26c349e310d2c6bd4beb264901ef1d942879c87150b8cf9c61035fe691298
R
1,116
27
#### Extract indel candidates from indel_calls.vcf for pileup in unmerged bam #### options(stringsAsFactors = FALSE) library(stringr) args <- commandArgs(trailingOnly=TRUE) input_f <- args[1] output_f <- args[2] indel_calls <- read.table(pipe(paste("grep -v '^#'", input_f)), header=FALSE, sep="\t", na.strings="", quo...
4c8ffa249038b457bc20de9a0f6946dc9cc59eca2da75152b579dc0fefe3bf56
R
1,119
41
tabPanel( title = i18n$t("感染者数の推移"), icon = icon("procedures"), value = "confirmed", fluidRow( column( width = 8, fluidRow( tags$br(), column( width = 6, radioGroupButtons( inputId = "selectTendencyConfirmedMode", justified = TRUE, ...
a3e9dd113a7dcbd38a87e4f7c3b0dbd3723f3bf148f234a61beb006545e8deea
R
1,124
51
#!/usr/bin/env Rscript # Command line argument processing args = commandArgs(trailingOnly=TRUE) if (length(args) < 2) { stop("Usage: markdown_to_html.r <input.md> <output.html>", call.=FALSE) } markdown_fn <- args[1] output_fn <- args[2] # Load / install packages if (!require("markdown")) { install.packages("mark...
9e76ecce837c21ee388a0baa3244312b73ebe3d3ad379b6b58c1c4c4b3646b86
R
1,125
32
--- title: "Lvar Single Cell Cell Marker bar plots" output: html_document date: "2024-01-03" --- setwd("C:/Users/kate.castellano/OneDrive - Gloucester Marine Genomics Institute/Documents/KCastellano/SeaUrchin/SeaUrchin_Data/2023Aug_CellCulture_ManuscriptDrafts/Figures/") ```{r } ##Make bar plots for single c...
ec37eea9ec6b231639947f7dd87189c1dc5116c4d02cb5bd6672a4a8757362c7
R
1,126
24
res_MRPRESSO <- function(dat=dat, NbD=1000,SignifThreshold = 0.05) { if(nrow(dat)<4){ resMRPRESSO <- data.frame(check.names = FALSE, Exposure=c(NA,NA), "MR Analysis"=NA , "Causal Estimate"=NA, Sd=NA, "T-stat"=NA ,"P-value"=NA,"Outlier"=NA,"global...
c7e66be2dd6ea94471405abd272b04bc127db7fd4844afa456eb5610913eced9
R
1,133
32
#' Get UK Biobank participant Electronic Medical Records (EMR) data in a RAP Spark environment #' #' @description #' #' This function is completely removed. Better to use `get_diagnoses()`. Use a historic release of this package if you really need it https://github.com/lcpilling/ukbrapR/releases #' #' @return Returns...
19e3e87e4b81eb6a8bddca766ea04e01568b6e1a8d87d66d960f3cde7ab4a19a
R
1,134
30
# 01 Load Data.R # 01 Load Data.R # ================================ # Load or Install All Libraries # ================================ packages <- c( "readxl","conflicted", "readr", "tidyr", "tibble", "pheatmap", "ggbreak", "imputeLCMD", "openxlsx", "limma", "writexl", "showtext", "jsonlite", "curl", "ggplot2",...
49710c54e11b780c65b34aa7f6e92346b4d2729a1116b9ecf393ca402f2e1af3
R
1,138
30
# --- make_score.R # Inputs a FUSION wgt.RDat file and prints to screen a plink format score file for individual-level prediction # --- arg = commandArgs(trailingOnly=T) if ( length(arg) == 0 || !file.exists(arg[1]) ) { cat("\nUsage: Rscript make_score.R [wgt.RDat file] > [SCORE_FILE]\n") cat("The SCORE_FILE can be lo...
3e3e0efbfbd2082e5eec6e2413883f6919b7bcc69a98e57c1dd6b42b7ad604d1
R
1,149
28
#Map and annotate integrated dataset with reference cell types from paper; run PCA and UMAP analyses ########################################## #Load library library(Seurat) #Read integrated Seurat object df = LoadSeuratRds("3_integrated_samples/integrated.rds") #Load Seurat object from reference paper and run FindV...
759d71f15cf0e91991bc335559289592e368c1589333029da9ef67338732823b
R
1,151
25
# ------------------------------------------------------------------------------ # Preprocessing Workflow using example data from Sturm et al. (2023) # # This script uses MNPpreprocessIllumina (Capper et al., 2018) for preprocessing. # If this function is not available, similar methods (e.g., preprocessIllumina) # may...
5cda0c9e4299a321a488d2961556704b9acaf9bdde32d57f6f6a15ae2b34b584
R
1,152
29
setwd("osmFISH_Ziesel/") library(Seurat) Zeisel <- read.delim(file = "data/Zeisel/expression_mRNA_17-Aug-2014.txt",header = FALSE) meta.data <- Zeisel[1:10,] rownames(meta.data) <- meta.data[,2] meta.data <- meta.data[,-c(1,2)] meta.data <- as.data.frame(t(meta.data)) Zeisel <- Zeisel[12:19983,] gene_name...
56c0068ae3c3ba81e1318137fedf1438fb7443647d1356dc72c286781b648a3e
R
1,162
32
context("Comprehensive Test for Binary Label Dataset Metric") test_that("running dataset test", { dd <- aif360::binary_label_dataset( data_path = system.file("extdata", "data.csv", package="aif360"), favor_label=0, unfavor_label=1, unprivileged_protected_attribute=0, privileged_protected_attrib...
96dce7773f60fa5f9058d6d44e03d6ef4fd0e3591752dcf02ccd7c5a0a2e16a7
R
1,162
36
#!/usr/bin/env Rscript #### Merge CD45pos and CD45neg batches for scRNA-seq samples #### Author: Jana Biermann, PhD library(dplyr) library(Seurat) library(gplots) library(ggplot2) library(ggrastr) pat <- commandArgs()[6] #provide patient name, e.g. 'MBM02_sc' print(pat) # Read in scCD45neg <- readRDS(paste0('data/...
5e56adc861236bf715713120de2745d65c070e74b1f43b65be858b4dd88bce70
R
1,164
30
raw.counts = readRDS("/da/raid/spwang/project/00.aneuploid.embryo/00.norm.scnorm/embryo.14082cells.raw.counts.rds") meta14082 = read.table("/da/raid/spwang/project/00.aneuploid.embryo/00.norm.scnorm/embryo_14082cells.metadata.upload.txt",sep = "\t",header = T,stringsAsFactors = F) rownames(meta14082) = meta14082$Cell....
54e816922a6fc9d916150e13e424089b463a0426a800a79b06f4ba06af0815f8
R
1,169
37
library(knitr) library(markdown) knit.report <- function(input.filename, output.filename, stylesheet=getOption("markdown.HTML.stylesheet"), ...) { input.filename <- normalizePath(input.filename) output.filename <- normalizePath(output.filename) output.dir <- dirname(output.filename...
22235601a5b51177d4c538e9a26c733c627841cebb01710f1bc3758646c9e7c0
R
1,171
34
#Plot Venn diagrams with intersections between cell populations ################################################################ #Load library library(VennDiagram) #List files up_files = list.files(path=".", pattern="^up_") down_files = list.files(path=".", pattern="^down_") files = c(up_files, down_files) #For each...
0976c03f04f2c2820fd0419063cee90d9f9e5c2030cb753fc8a7344dda4c0507
R
1,174
37
# load packages require(tidyverse) require(Seurat) require(pbapply) # load Seurat object and gene names sdata.hg <- readRDS('sdata_Polioudakis_pseudotime.rds') gene.names <- read_csv('Polioudakis_ensembl88_genes_edit.csv') # get metadata, remove cells with NA pseudotime value meta.data <- sdata.hg@meta.data %>% ro...
29f72ab3106451565bbd17a9aef6f6b8e7604382c4e3f706039e2dfe4ab8ae25
R
1,180
44
options(max.print = 1000) options(stringsAsFactors = FALSE) options(scipen = 999) library(data.table) library(keras) library(openxlsx) args = commandArgs(trailingOnly=TRUE) # bam file name, CpG names, MARLIN model, class annotations # load CpG names, ordered load(args[2]) # load MARLIN model model <- load_model_h...
c895228847841944bd536ace4e33b192db086e2a1d0dcb8c5cba4e4e802a5d51
R
1,181
37
library("spatialLIBD") library("here") library("sessioninfo") ## load snRNA-seq DLPFC data load(here("processed-data", "sce", "sce_DLPFC.Rdata"), verbose = TRUE) ## drop Ambiguous nuc sce <- sce[, sce$cellType_broad_hc != "Ambiguous"] sce$cellType_broad_hc <- droplevels(sce$cellType_broad_hc) table(sce$cellType_bro...
334377c5f2865efd18fbbf245aff8ec9853e094eae6cb207a40da8739edb9c24
R
1,182
18
library(harmony) library(Seurat) library(qs) seurat_integrated <- *seurat object after all filtering has been done post scvi and clustering; see scVI_Clustering.txt* seurat_integrated <- SCTransform(seurat_integrated, vars.to.regress = c("percent.mt","percent.ribo", "batchCorrect"), assay = "RNA", ...
21b59c18ac9734298dc6254205af04f1782c1b4c207fafe8860f3d47725dce2f
R
1,184
31
#Map and annotate integrated dataset with reference cell types; run PCA + UMAP analyses ############### #Load library library(Seurat) #Read integrated Seurat object df = LoadSeuratRds("3_integrated_samples/integrated.rds") #Load Seurat object from reference paper ref = LoadSeuratRds("integrated_1.5M_2M_harmonizedOBJ...
87df09e9e0b683ce80561f31483e4e12f45ed722b0b01fa34741219993ee4386
R
1,187
36
get_bulk_expANDout_harmonised_data <- function(exposure_data = bulkexposure, outcome_data = bulkoutcome ) { message("exposure_data = bulk exposure data input, dataframe") message("outcome_data = bulk outcome data input, dataframe") sour...
fd46e6b05a23b2dd377543b597e2511c5ee8b8aa749b5e48a7ca78eef372bf7f
R
1,201
34
### MNT add 07Apr2021 ======= # Check Read 1 files in expansion dataset for discrepant read lengths # (as seen with Br5182-NAc in preprint dataset) # Should be exactly 28bp = 16 [BC] + 12 [UMI] library(ShortRead) library(jaffelab) FASTQ.dir <- "/dcs04/lieber/lcolladotor/rawDataTDSC_LIBD001/raw-data/2021-10-...
5b605cc171dcef36f6454532e49b68b2e86c55e5e26a166b2c9548511fffc973
R
1,202
41
library(Matrix) library("UCell") set.seed(123) gene <- read.csv2('hallmark_surv_curated.csv', sep=',') geneSets <- list() for (col_name in names(gene)) { geneSets[[col_name]] <- gene[[col_name]][!is.na(gene[[col_name]]) & gene[[col_name]] != ""] } calculate_and_save_scores <- function(folder_path) { # Read fil...
7d8c90ddd3051d227f3c0021b24da5c5cb24ece0ef9d93d60295d3de757e3d0a
R
1,209
47
# »æÖÆMEMEÔÚintergenic UCRµ±ÖÐÕÒµ½µÄ¸»¼¯µÄmotif logo setwd(dir = "D:/R_project/UCR_project/") rm(list = ls()) library(seqLogo) library(tidyverse) # CTCF <- read.table(file = "01-data/11.1-Get_intergenic_UCR_closest_pc_gene/MA0139.1.jaspar", # header = FALSE) # CTCF <- CTCF[, c(3:21)] # rownames(C...
bf4b7f1336ef8afd784f5d51c257c2fc23dfe955aa198b7154563fc648c2e007
R
1,209
42
library(tidyverse) # library(ggpubr) # read in Halo-TDP quantification df <- read_csv("data/2023_12_17_elk1_quantification_relative_normalised.csv") # convert conditions in to single column df <- df %>% pivot_longer(cols = -sample, names_to = "condition", values_to = "rel_expr") %>% # rename TDPKD to TDP43KD for ...
0f4b0846f699d64d9a1d45ec33d4a94d332d86f6382819dd1c5c16b0d4f2adbe
R
1,210
34
tabPanel( title = i18n$t("コールセンターの対応"), icon = icon("headset"), value = "callCenter", fluidRow( column( width = 8, echarts4rOutput("callCenter") %>% withSpinner() ), column( width = 4, tagList( tags$br(), tags$b(i18n$t("これまでの主な相談内容")), tags$li(i18n$t("...
2f0bfa3e5c0bb9ea0a57e7e8c7f8ed9406bd09035170039598556a1d32f334f1
R
1,211
34
## Compare fetal and adult cell-type effect sizes ## #1. Load results ================================================================================================================ # probes significant to either fetal or adult in Cell-type EWAS res <- read.csv(paste0(AnalysisPath, "FACS_Cell_EWAS_fetal_anno_sig.c...
3049c2a7b303c994671e18d77a3afc299bcb3076955ceb577a8f99f0aa9e527b
R
1,213
36
#' MajorMinorCalc #' #' Major to Minor Calculation function #' @param Table The variable containing the table of SNPs #' @param minDP minimal reading depth required from accepted SNP, usually set to 20 #' @param maxDP maximal reading depth required from accepted SNP, usually set to very high number #' @param minAF mini...
f378a9a5508ef589412acf908bdc9d75270f8b5bbe95cb0329f25ac7b9c2130d
R
1,215
34
# load packages require(tidyverse) require(Seurat) # load Seurat objects (list) sdata.list <- readRDS('sdata_mmCortex_list.rds') # filter sdata.list.filtered <- lapply(sdata.list, \(obj) { # define percent_mito filter mt.cutoff <- switch(unique(obj$time_point), E12.5 = 2, E14.5 = 2, E16.0 = ...
f95837f99eba24bf0ccb37019cc1406ef397823bf3050aa7a7ea9bda1efd2a51
R
1,220
35
library("SummarizedExperiment") library("spatialLIBD") library("here") library("sessioninfo") library("scater") plot_dir <- here("plots", "10_bulk_vs_sn_DE", "06_sn_reduced_dims") if (!dir.exists(plot_dir)) dir.create(plot_dir) load(here("processed-data", "00_data_prep", "cell_colors.Rdata"), verbose = TRUE) my_them...
ca15d5a00f839d275e0cca8a15fe5fc53bc238e856e57f53783a2a0300377ed4
R
1,223
33
#!/usr/bin/env Rscript # # Author: Tim Sterne-Weiler, 2014 # tim.sterne.weiler@utoronto.ca # # Install/loading of required Packages. loadPackages <- function(toLoad, local.lib="Rlib/") { for(i in toLoad) { writeLines(sprintf("Trying to load required package: %s", toString(i)), stderr()) if(!suppressWarning...
35603026af437f80fe2daed027cefe152f5cbd0b00b3a8aab2fd61dd6de73f35
R
1,229
38
suppressPackageStartupMessages(library(readr)) suppressPackageStartupMessages(library(dplyr)) args <- commandArgs(T) # args = c(5e3, '~/Projects/circCenters/output2/visualize.circRNA/STAR_chimeric/STAR_chimeric/library/w1118_embryos_14_16_R1_RR.Chimeric.out.junction') max.length = args[1] ## Test data # STAR juncti...
789a4e43007d276c27ca20ce517da91b9516cbd6e18c2de213c002701c912325
R
1,229
53
# Siwei 15 Jan 2024 # plot fig. 5a # init #### library(gplots) library(RColorBrewer) library(readxl) library(stringr) # load data df_raw <- read_excel("Fig_5a.xlsx") genotype_info <- df_raw$Genotype gene_names <- df_raw$Gene_symbol df_to_plot <- df_raw df_to_plot$Gene_symbol <- NULL df_to_plot$Genotype <- ...
13ee44022520f7aba4f0d5697adc91fa4910eea42611c6b18613da85d1fd145a
R
1,234
36
library("tidyverse") library("scRepertoire") vdj_dir <- "data/raw/VDJ" figs <- "figures/scRepertoire/" data_out <- "data/processed/" contig_annots <- list.files(vdj_dir, recursive = TRUE, full.names = TRUE, pattern = "all_contig_a...
e40ea53c1774ab3a4cfcfebf38756446a89568e49fa675d191df0efc4479be30
R
1,235
38
output$user <- renderUser({ dashboardUser( name = "Su Wei", image = "Icon/wei_su.jpg", title = "Developer", subtitle = "Front-End Engineer | ex-Bioinformatician", footer = tagList( actionButton( inputId = "sponsorMe", label = i18n$t("スポンサー"), icon = icon("heart"), ...