sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
1d0f566bbf3fa3360c9413fa41a8d66b22360deed9a0cf45c1cf1fec6012052b | Python | 189,635 | 5,240 | from __future__ import annotations
from collections.abc import (
Callable,
Collection,
Generator,
Hashable,
Iterable,
Sequence,
)
from functools import wraps
from itertools import zip_longest
from sys import getsizeof
from typing import (
TYPE_CHECKING,
Any,
Literal,
NoReturn,
... |
dd36cfbcb6fadceb56ac1b9300c1d1ede2690777fb06f95a8aa5a87a8705d077 | Python | 191,245 | 5,965 | """
Provide the groupby split-apply-combine paradigm. Define the GroupBy
class providing the base-class of operations.
The SeriesGroupBy and DataFrameGroupBy sub-class
(defined in pandas.core.groupby.generic)
expose these user-facing objects to provide specific functionality.
"""
from __future__ import annotations
f... |
dff3c82dbaf995590aeb662d8939ceaf3326b621b80b65bb01b95a126327228a | Python | 193,209 | 5,341 | from __future__ import annotations
from collections.abc import (
Callable,
Collection,
Generator,
Hashable,
Iterable,
Sequence,
)
from functools import wraps
from itertools import zip_longest
from sys import getsizeof
from typing import (
TYPE_CHECKING,
Any,
Literal,
NoReturn,
... |
d25299fd6371727a95c9e60b55a87eb630ccb3729042dc31752e971774361995 | Python | 194,190 | 4,988 | """test to_datetime"""
import calendar
from collections import deque
from datetime import (
UTC,
date,
datetime,
timedelta,
timezone,
)
from decimal import Decimal
import locale
import re
import zoneinfo
from dateutil.parser import parse
import numpy as np
import pytest
from pandas._libs import t... |
6d54e8705f9b957a2b3f4971b59ab7358c8fd10a9422c2785f8ff4434801b1e9 | Python | 196,041 | 5,036 | """test to_datetime"""
import calendar
from collections import deque
from datetime import (
UTC,
date,
datetime,
timedelta,
timezone,
)
from decimal import Decimal
import locale
import re
import zoneinfo
from dateutil.parser import parse
import numpy as np
import pytest
from pandas._libs import t... |
0731442efc6c605f4d6ffa4317d0cdda2f7cb600c01b45940d8704bd3c8cf53a | Python | 200,000 | 3,269 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'GUI.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.s... |
26fd91c788609ded3a1a828e3917a3ed3e0d8903f0d5c5d559bfe03b5f553b13 | Python | 200,000 | 21 | # pylint: skip-file
"""File that contains the Christiansen Bosonic Operator data generated via functions in vibrant."""
# fmt: off
# Reference generated from vibrant
# mol = H2S
# coords =[[0.0, -1.0, -1.0], [0.0, 1.0, -1.0], [0.0, 0.0, 0.0]]
# localize = True
# nbos = 4
# quad_order = 9
# cubic = True
from pennylan... |
32d09876eea80bffe3daae2f783d5fd175d80861a77cb6d7384a032b984f8eb9 | Python | 200,000 | 4,175 | import textwrap
import time as pytime
from collections import defaultdict
import subprocess
import scipy.interpolate
import scipy.linalg
import scipy.signal
import scipy.stats
from sklearn.metrics import accuracy_score, f1_score
from .backend import *
from .data import build_CDR_impulse_data, build_CDR_response_data,... |
3604bb310d9a55163dd56b9569d534a974a0c0fe49ac3fc29db64ea42513dbe0 | Python | 200,000 | 5,298 | from typing import Iterable, List, Literal, Mapping, Optional, Sequence, Tuple, Union
import numpy as np
import pandas as pd
import tqdm
from numba import jit
_Peakcalling_Method = Optional[Literal["CCcaller", "MACCs", "Blockify"]]
_reference = Optional[Literal["hg38", "mm10", "sacCer3"]]
_PeakTestMethod = Optional[L... |
69648d95a4f6d6da46404e1a123240d54f184a1890bd666f4e34f309c220de2c | Python | 200,000 | 5,477 | """
DataFrame
---------
An efficient 2D container for potentially mixed-type time series or other
labeled data series.
Similar to its R counterpart, data.frame, except providing automatic data
alignment and a host of useful data manipulation methods having to do with the
labeling information
"""
from __future__ impor... |
9096733596abee46707018ac3a4141fe77a46d804092569d790b1ab6d87441fa | Python | 200,000 | 4,929 | #! /usr/bin/env python
##############################################################################
## DendroPy Phylogenetic Computing Library.
##
## Copyright 2010-2015 Jeet Sukumaran and Mark T. Holder.
## All rights reserved.
##
## See "LICENSE.rst" for terms and conditions of usage.
##
## If you use this wo... |
a9289415300b6ed5a65dbaf0dfd89f5e6da7f34a3c4f80246af1c9089cd148b8 | Python | 200,000 | 5,638 | from __future__ import annotations
from collections import abc
from datetime import (
datetime,
tzinfo,
)
import functools
from itertools import zip_longest
import operator
from typing import (
TYPE_CHECKING,
Any,
ClassVar,
Literal,
NoReturn,
Self,
SupportsIndex,
cast,
final... |
be4a4aa692d89e652ac508c13604dc9fe64b08ff43a60cda1c63d72089658b05 | Python | 200,000 | 5,492 | """
DataFrame
---------
An efficient 2D container for potentially mixed-type time series or other
labeled data series.
Similar to its R counterpart, data.frame, except providing automatic data
alignment and a host of useful data manipulation methods having to do with the
labeling information
"""
from __future__ impor... |
c6ece25b4b05bf448e525769f0fd82335d9d7991944d0baa7d4c2a20f5f3f891 | Python | 200,000 | 10,865 | #name name2
NM_000299 PKP1
NM_001276351 C1orf141
NM_001005337 PKP1
NM_001276352 C1orf141
NR_075077 C1orf141
NM_001042681 RERE
NM_012102 RERE
NR_038261 HIVEP3
NM_001042682 RERE
NM_001281956 CSMD2
NM_052896 CSMD2
NM_001130058 SLC44A5
NM_001350214 TTLL7
NM_001320287 SLC44A5
NM_024686 TTLL7
NM_001350215 TTLL7
NM_001320285 ... |
fc6be995d816d73cc61a90fc880361c7b3e9a593aeddff24bc71563154ad9b03 | Python | 200,000 | 5,670 | from __future__ import annotations
from collections import abc
from datetime import (
datetime,
tzinfo,
)
import functools
from itertools import zip_longest
import operator
from typing import (
TYPE_CHECKING,
Any,
ClassVar,
Literal,
NoReturn,
Self,
SupportsIndex,
cast,
final... |
0278c415376dc8b10240428e8406f06e5d24308d93707e4efffd48c9d5ff3268 | Python | 200,002 | 5,594 | """
High level interface to PyTables for reading and writing pandas data structures
to disk
"""
from __future__ import annotations
from contextlib import suppress
import copy
from datetime import (
date,
tzinfo,
)
import itertools
import os
import re
from textwrap import dedent
from typing import (
TYPE_C... |
49300c8f7c5c708ab82e448f5a22493aefdadc8c68a3d05c378a250dd4e24944 | Python | 200,002 | 5,676 | # pyright: reportPropertyTypeMismatch=false
from __future__ import annotations
import collections
from copy import deepcopy
import datetime as dt
from functools import partial
from json import loads
import operator
import pickle
import re
import sys
from typing import (
TYPE_CHECKING,
Any,
ClassVar,
Co... |
80812f336121ddd23d4fc403b4d0b7b591329252c8f16de971319073e06f2bab | Python | 200,002 | 5,691 | # pyright: reportPropertyTypeMismatch=false
from __future__ import annotations
import collections
from copy import deepcopy
import datetime as dt
from functools import partial
from json import loads
import operator
import pickle
import re
import sys
from typing import (
TYPE_CHECKING,
Any,
ClassVar,
Co... |
c84908c6bf0407e150419e1838558ff7bdc74ca029d1d3867c2c6d190dbe1fdc | Python | 200,002 | 5,591 | """
High level interface to PyTables for reading and writing pandas data structures
to disk
"""
from __future__ import annotations
from contextlib import suppress
import copy
from datetime import (
date,
tzinfo,
)
import itertools
import os
import re
from textwrap import dedent
from typing import (
TYPE_C... |
94df15dacd16bc7bbe61be46425f5f3b7143156fd59686d79fc5ba4bc14de9b1 | Python | 200,008 | 6,014 | """
Data structure for 1-dimensional cross-sectional and time series data
"""
from __future__ import annotations
from collections.abc import (
Callable,
Hashable,
Iterable,
Mapping,
Sequence,
)
import functools
import operator
import sys
from typing import (
IO,
TYPE_CHECKING,
Any,
... |
fdf4a186f5480342024ece4bbece1d42df7642992a5ba247f986cdfa9892323d | Python | 200,008 | 6,021 | """
Data structure for 1-dimensional cross-sectional and time series data
"""
from __future__ import annotations
from collections.abc import (
Callable,
Hashable,
Iterable,
Mapping,
Sequence,
)
import functools
import operator
import sys
from typing import (
IO,
TYPE_CHECKING,
Any,
... |
c88c1aa35c64c312251118dbda64023ddfc07b001c0c714cd4bc308bbd847336 | Python | 200,016 | 4,675 | from __future__ import division
import sys
import numpy as np
import torch
import scipy
import copy
from itertools import combinations
from sklearn.manifold import MDS
import nn_analyses as nna
import nn_models as nm
import task_train_test as tk
import nn_plot_functions as npf
def get_trai... |
8d9eef0c5845d3d636a8e3612d78e50c3c7c26855dbd8f43b52d73ab5363a965 | Quarto | 6,521 | 203 | ---
title: "Dorgau_lu pseudobulk"
format:
html:
self-contained: true
---
```{r global_options, include=FALSE}
knitr::opts_chunk$set(echo=FALSE, warning=FALSE, message=FALSE, fig.width = 10, fig.height = 10)
```
Can the new data be integrated successfully with previously published data or do they appear to be... |
cb50a1102cf31f0efffd24fcc5a45226db05ed94008b4affde78446b02332576 | Quarto | 12,453 | 462 | ---
title: "FlowSOM_PDG_BrM"
author: "Benoit Duc"
format: html
editor: visual
---
## FlowSOM analysis of PDGfp and breast-BrM tumors
```{r setup}
library(data.table)
library(janitor)
library(tidyverse)
library(flowCore)
library(FlowSOM)
library(pheatmap)
```
```{r function-definitions}
###########... |
06dceaa2eb18aba4075783102a090019154479169b750010e1911579af4c55da | Quarto | 13,097 | 437 | ---
format:
html:
self-contained: true
---
# Lu et al, 2020
### Single-Cell Analysis of Human Retina Identifies Evolutionarily Conserved and Species-Specific Mechanisms Controlling Development {-}
```{r global_options, include=FALSE}
knitr::opts_chunk$set(echo=FALSE, warning=FALSE, message=FALSE, fig.width ... |
8b6e2734119674dba5e644a3adca59c8ff305cdbd60d0cf5d53753bb69f5f1de | Quarto | 13,756 | 346 | ---
title: "HIFI Spatial Analysis - Neighborhood Analysis"
format: html
editor: visual
---
### Neighborhood Analysis
This script takes single cell HIFI data from QuPath after cell type annotation and analyzes cellular neighborhoods. Interaction analysis is included to perform statisitical tests of cellular co... |
a79c7437cc919f695bf7a34ea5abbe18643507e75ea54ef61935cea7b4b8b2d3 | Quarto | 14,868 | 377 | ---
title-block-banner: true
title: "Creation of point patterns using the spatstat package"
date: today
date-format: full
author:
- name: "Daniel Manrique-Castano"
orcid: 0000-0002-1912-1764
affiliation: Univerisity Laval (Laboratory of neurovascular interactions)
keywords:
- GFAP analysis
-... |
d95067df3c201d7cb6274d11756e4a0f1b2f73f9c2ad3ed18366d1c8424e307a | Quarto | 23,599 | 493 | ---
title: "HIFI Spatial Analysis - Proximity Networks"
format: html
editor: visual
---
### **Proximity Network Analysis**
This notebook creates graph-based networks of cellular proximity from HIFI digital pathology data.
The code generates a matrix of unidirectional cell type connections (currently all-to... |
54b6a972ef50988c8ca5ba32c2b3a84395fda0c1b92c84d8db3d293ab5355335 | Quarto | 200,007 | 5,436 | ---
title: "Dissecting glial scar formation by spatial point pattern and topological data analysis"
subtitle: "Supplementary data analysis notebook"
format:
html:
code-fold: true
embed-resources: true
toc: true
toc-location: left
theme: spacelab
knitr:
opts_chunk:
warning: fals... |
58ff38b5a84be607869a135aea445a618b17d2dea8c7edf5812c668deb415325 | R | 52 | 3 | ftrans <- function(a){
return(log((1+a)/(1-a)))
}
|
cf4ec27678a28f18c0b2fcaa7c84db5a099f164c8531c8723afda0cef3b8386c | R | 54 | 4 | library(testthat)
library(UCell)
test_check("UCell")
|
cc6fe33f02334a440880e5a73adc5513e6a75c39128fa02a31bcf058e8c2d7a2 | R | 61 | 3 | soft <- function(x,d){
return(sign(x)*pmax(0, abs(x)-d))
}
|
93af90380bae98d37a600d6421daf781e02458d54a5a4adf952e064b78588343 | R | 69 | 3 | #' @useDynLib fibrationSymmetries
#' @importFrom Rcpp sourceCpp
NULL
|
3c0e681b761a41bf9b8a20562c33f73893b8332667be1d625599a8bba4ebe29e | R | 80 | 5 | l2n <- function(vec){
a <- sqrt(sum(vec^2))
if(a==0) a <- .05
return(a)
}
|
ec5d317269be7bd96f3980e5edb32259b420ef8d7978f34774b962e3268bd599 | R | 85 | 3 | ### export_deps.R ###
write.csv(installed.packages(), "./tools/requirements_r.csv")
|
2b623ce9f943d7b514942eeb203ee3db07759115e8cdc4c2134540e469b55cc9 | R | 88 | 7 |
install.packages("psych")
library(psych)
r.test(n=91, r12=.29, r13=.07,r23=.55)
|
366c733905aef410897ecd1e9a7a3f0e1c083a8bbd8b44578a15e2610bd950e4 | R | 90 | 5 | zscore <- function(x, na.rm=TRUE){
(x-mean(x, na.rm=na.rm))/sd(x, na.rm=na.rm)
}
|
9c62636a5bee77239b2b18f23c6007bb90238ee6826d47ab018b8f91870c2bae | R | 151 | 5 | #' @name snpsOfInterest
#' @title snpsOfInterest
#' @description Example SNPs of interest from simulated \code{gwasResults} data.
#' @docType data
NULL |
d7abb2978c7d7eb99e27b90bd46b1a6ed8c7570faf3b5acbb7824fdf47334c2e | R | 153 | 5 | #' @name gwasResults
#' @title Simulated GWAS results
#' @description Simulated GWAS results as obtained from \code{plink --assoc}.
#' @docType data
NULL |
1677652d12c3ade87898285727240523fe6249c060ae015bff937c32a6b82f9f | R | 180 | 4 | dlpfc <-
list(spatial = readRDS('data-raw/LIBD_spatial_3639cells_2cols.rds'), count_exp = readRDS('data-raw/LIBD_mrna_count_18011genes_3639cells.rds'))
usethis::use_data(dlpfc)
|
0e3fed0b035d98df6f406a2500e6c6b8733ea3c33c595daf95663de9a83100cd | R | 233 | 8 | workflowr::wflow_publish(
c(
"analysis/figure_2d-THP7.Rmd",
"analysis/figure_2e-Pr5P7.Rmd"
),
verbose = TRUE
)
# workflowr::wflow_publish("analysis/eda.Rmd", all = TRUE, update = TRUE, republish = TRUE, verbose = TRUE)
|
9a88df4d6569bf28b1c1d1a1be0fd25a79208ce21eaf71172b4b80630e0541a1 | R | 251 | 4 | library(DiffBind)
K27ac_B<-dba(sampleSheet = "K27ac_B.csv",dir=system.file("extra", package="DiffBind"))
K27ac_B_consensus<-dba.peakset(K27ac_B,bRetrieve = TRUE)
write.csv(K27ac_B_consensus,file="C:/Users/Jerry Liu/Documents/K27ac_B_consensus.csv") |
cb8457eeebd7da94ea2bf3c267ca6db8644027763588081183d9e0241dd6251a | R | 258 | 15 | library(tidyverse)
library(stringr)
library(R.matlab)
library(cowplot)
library(expm)
library(mgcv)
library(RColorBrewer)
library(lm.beta)
library(wesanderson)
library(rjson)
library(reshape2)
library(reticulate)
library(car)
library(viridis)
library(ggrepel) |
50f57d35a4fa6ffa8983d2ba96032a8b4bf8d07dfa8a76111df53a5f42d14caf | R | 271 | 15 | # Side effects of upon package loading and unloading
.onLoad <- function(libname, pkgname) {
# Initialize global options
ecOptions()
invisible()
}
.onUnload <- function(libpath) {
# Reverse side effects
options(ecOptions = NULL)
invisible()
}
|
f91c9530fb9343283e7e814f13d5a2f72a4d68d09729c38ce946e7508a214363 | R | 273 | 14 | #SR_TAU_CELL
.libPaths("/data/user/jfisher7/.conda/envs/SR_TAU_CELL/lib/R/library")
#make sure the environment is clean
rm(list=ls())
info<- sessionInfo()
print(info)
# Listing packages
packages<- installed.packages()[,c(1,3)]
print("Listing packages")
print(packages)
|
88aa116547ba22e1583b29911e1cab0c5f44b0af668a261858c8565dc6afeec5 | R | 289 | 17 | library(ggplot2)
library(stringr)
library(R.matlab)
library(cowplot)
library(expm)
library(mgcv)
library(RColorBrewer)
library(lm.beta)
library(wesanderson)
library(rjson)
library(stringr)
library(reshape2)
library(reticulate)
library(car)
library(viridis)
library(gsubfn)
library(ggrepel) |
281f5de0a63f8e6025d730aad4ea150513c56951ad2ab02c10f70cf3d2cfa43f | R | 300 | 16 | #' STew S3 object
#'
#' @param count_exp count_exp data
#' @param spatial spatial data
#'
#' @return S3 Object
#' @export
STew_Obj = function(count_exp = NULL, spatial = NULL){
stew = list()
stew$count_exp <- count_exp
stew$spatial <- spatial
class(stew) <- 'STew_Object'
return (stew)
}
|
865c0b589cee7a90248a26c901012e2798467df65676a793211de0a82a303f4c | R | 306 | 11 | #' List all tips descendant from a node
#'
#' @param tree an object of class 'phylo'.
#' @param node number of interest.
#' @return vector of tip numbers.
#' @export
getTips<-function(tree,node){
getDescendants(tree,node)[which(getDescendants(tree,node)<(length(tree$tip.label)+1))]
}
|
a08dbd1e4118c05c9cdb571a1ebf48c7a7a04181d4940dac69dbea220e4b4020 | R | 311 | 10 | ## this function returns the name of the sheet from the filepath
getRegion = function(f) {
x = unlist(strsplit(f, split = "/", fixed = TRUE))
x = x[3]
x = unlist(strsplit(x, "_", fixed = TRUE))
x = x[-c(1:5)]
x = x[1:(length(x) - 1)] # remove last segment
x = paste(x, collapse = "_")
return(x)
}
|
1abbeb8dc6c56e9f70cd11ca3963f39eebac36c9bb5a04621d8358b3d62e175e | R | 317 | 11 | #' List all nodes descendant from a node
#'
#' @param tree an object of class 'phylo'.
#' @param node number of interest.
#' @return vector of node numbers.
#' @export
getNodes<-function(tree,node){
c(getDescendants(tree,node)[which(getDescendants(tree,node)>(length(tree$tip.label)+1))],node)
}
|
d841d2071f0e1a3eb5698a9e5c83f63e86581df3d3454a4d0e758c31f37d53c4 | R | 321 | 7 | # install the required R packages for the demos
install.packages("Rcpp",dependencies=TRUE)
install.packages("Matrix",dependencies=TRUE)
install.packages("pracma",dependencies=TRUE)
install.packages("RcppAnnoy",dependencies=TRUE)
install.packages("RSpectra",dependencies=TRUE)
install.packages("igraph",dependencies=TRUE)... |
e13975d3af41f616b14ad35472b3967977109c3676c1ecbe4530f8d6d3ec1e3a | R | 338 | 16 | #install.packages("irr")
library("irr")
#install.packages("readr")
library(readr)
data1 <- read_csv("pubmed.csv")
data2 <- read_csv("scopus.csv")
combined_data <- rbind(data1, data2)
# binarize it
combined_data <- combined_data + 1
combined_data <- sign(combined_data)
kappam.fleiss(combined_data, detail = TRUE)
agr... |
36daa3bd9ffef8c04674affacb56bfba34133bda7c84782a7018a33e340ebcc8 | R | 382 | 12 | # This file is part of the standard setup for testthat.
# It is recommended that you do not modify it.
#
# Where should you do additional test configuration?
# Learn more about the roles of various files in:
# * https://r-pkgs.org/tests.html
# * https://testthat.r-lib.org/reference/test_package.html#special-files
libr... |
10220b209190e2a51838ab9e3b85e4f901f9befbde98dacc8734bc033a2eafd0 | R | 411 | 15 | #' List all edges descendant from a node
#'
#' @param tree an object of class 'phylo'.
#' @param node number of interest.
#' @return vector of edge numbers.
#' @export
getEdges<-function(tree,node){
Desc<-getDescendants(tree,node)
Edges<-c()
for(i in 1:length(Desc)){Edges<-c(Edges,which(tree$edge[,2... |
a04f8bfb21475a19d88b3403616758987d6a7d147a1abc24c1e7682d456fd542 | R | 412 | 10 | library(randomForest)
load('/Users/jianinglu1/Documents/GitHub/deltaVinaXGB_develop/Feature/RF20.rda')
args <- commandArgs(trailingOnly = TRUE)
infn = args[1]
outfn = args[2]
df = read.table(infn, header=T, stringsAsFactors = F, sep=',')
feats = df[3:22]
pred = predict(rffit, newdata = feats) + df$vina
output = data.fr... |
fce4a5ea363565faa221308b7a8843d9673c084ffb0cc14ccbc9c8c01bd8bbcc | R | 412 | 10 | .onLoad <- function(libname, pkgname) {
desc <- read.dcf(file.path(system.file(package = pkgname, lib.loc = libname), "DESCRIPTION"))
cat("Package:", desc[, "Package"], "\n")
cat("Description:", desc[, "Description"], "\n")
cat("Version:", desc[, "Version"], "\n")
cat("Release Date:", desc[, "Date"], "\n")
... |
e150ffa29c1ced969b21b08a9c96f70e3d65d3c43ffd35e90c5f6315a2b442b9 | R | 430 | 15 | ### DATA
d <- read.table("GSE93374_Merged_all_020816_DGE.txt")
d <- d[,order(colnames(d))]
### ANNOTATIONS
ann <- read.table("GSE93374_cell_metadata.txt", sep = "\t", header = T)
ann <- ann[order(ann[,1]), ]
rownames(ann) <- ann[,1]
ann <- ann[,2:ncol(ann)]
colnames(ann)[9] <- "cell_type1"
### SINGLECELLEXPERIMENT
so... |
e5c4e8d3d8f3fadc955f68b58197245c7ccf110a63f9e77e6a5ec57476a3ada7 | R | 431 | 32 | ---
title: "221221_rstudio_cancer_dr_info"
author: "Jennifer Fisher"
date: '2022-12-21'
output:
html_document: default
---
GitHub Repo:
Transfer_Leanring_R03
Docker:
rstudio_cancer_dr
Directory of operations:
/home/rstudio (Docker)
```{r setup, include=FALSE}
knitr::opts_chunk$... |
e244986cb6f3d18cc437a091c8a8ef1593cb6a4f259edc9e068c76e9235e0764 | R | 436 | 11 | ### bioinfo_installer.R ###
install.packages("BiocManager", repos="http://cran.ism.ac.jp/")
BiocManager::install("clusterProfiler")
BiocManager::install("AnnotationDbi")
BiocManager::install("org.Hs.eg.db")
BiocManager::install("org.Mm.eg.db")
BiocManager::install("org.Rn.eg.db")
BiocManager::install("GO.db")
install.... |
844bce43bf8bc3a60be858b7c03ae68619dd02cb8aee0a29d069a2dfb49db5f7 | R | 446 | 16 | convert_evetech_names = function(x)
{
x = gsub("SDF-1α\\+β", "SDF-1ab", x)
x = gsub("FLT-3L", "Flt-3l", x)
x = gsub("GROα", "GRO", x)
x = gsub("IFN-α2", "IFNa2", x)
x = gsub("γ", "g", x)
x = gsub("IL-1α", "IL-1a", x)
x = gsub("β", "b", x)
x = gsub("MIP-1α", "MIP-1a", x)
x = gsub("δ", "d", x)
x = gsu... |
04aee24d98bb7fd6c47fda7f9631d54d42dc635f9c58a83760e003aaa8c1a03d | R | 460 | 16 | ### DATA
d <- read.csv("data.csv")
### ANNOTATIONS
genes <- unlist(lapply(strsplit(as.character(d[,1]), "_"), "[[", 2))
d <- d[!duplicated(genes), ]
rownames(d) <- genes[!duplicated(genes)]
d <- d[,2:ncol(d)]
# metadata
ann <- data.frame(cell_type1 = unlist(lapply(strsplit(colnames(d), "__"), "[[", 2)))
rownames(ann) ... |
9d009c88913d341afad75c877fc6eac5e307ab9fdf76a5af6fcb0dacd4bb696d | R | 465 | 8 | .onAttach <- function(...){
packageStartupMessage()
packageStartupMessage("For example usage please run: vignette('qqman')")
packageStartupMessage()
packageStartupMessage("Citation appreciated but not required:")
packageStartupMessage("Turner, (2018). qqman: an R package for visualizing GWAS results... |
1592943bc3fc8ba1eb532e46a44ec9dfabddc7e8e7205e65ccc882ca446cb8ca | R | 470 | 16 | # Set directory to source file loaction
setwd(paste0(figureDirectory, "Figure7-survival" ) )
library(ggplot2)
library(cowplot)
load("plotListSurvival.RData")
png(filename = "Figrue7.png", height = 1000, width = 1000, res = 90)
plot_grid(plotList[[9]],plotList[[2]],plotList[[3]],plotList[[5]],plotList[[11]],plotLi... |
0333b8109dea627c8c14da7a8d32e49a18414818d5648a5c96c9880091b8bf9a | R | 478 | 12 |
install.packages("psych")
library(psych)
# week 8
r.test(n = 24, r12 = 0.62, r13 = 0.48, r23=.97, twotailed = FALSE) # TSI vs MAIP
r.test(n = 23, r12 = 0.62, r13 = 0.21, r23=.55, twotailed = FALSE) # TSI vs mathres
r.test(n = 24, r12 = 0.62, r13 = 0.06, r23=.27, twotailed = FALSE) # TSI vs numops
# week 4
r.test(... |
52156fba94260087993cb1edad9bb25de70871b0693f77753fe123415e9056e1 | R | 482 | 12 | #' Extract variant type (snp/indel)
#'
#' This function takes in a CollapsedVCF object and returns a vector: variant type (snp/indel)
#'
#' @param VCF_DATA CollapsedVCF object (as extracted by VariantAnnotation::readVcf())
#' @return non null GT vector
snp_indel <- function( VCF_DATA ){
cat( " -> extracting varian... |
8030b7d6d9c388c411dc96a099af31e0b506b1113180755d63e99621bd689941 | R | 485 | 16 | res1 <- read.delim("AXXC-WT_deseq2_LFC.txt",row.names = "gene_symbol")
head(res1)
library(EnhancedVolcano)
EnhancedVolcano(res1,
lab = rownames(res1),
x = 'log2FoldChange',
y = 'padj',
xlim = c(-3, 3),
ylim = c(-0.5,80),
... |
c282bfc053ec736946b542401e52b38d38b4ae9c88db6ea5e39dcf37df8aca30 | R | 485 | 17 | ### This code creates fig. S6a
dev.off()
rm(list=ls())
library(ggplot2)
library(tidyr)
library(gridExtra)
library(dplyr)
Data <- read.table("Chr12_binning_summary_10kb", header = F)
Data <- Data[-6111,]
Data$V2 <- as.integer(Data$V2)
pdf("TE_density.pdf", width=5, height=5, useDingbats=FALSE)
ggplot(Data, aes(x=V2, ... |
e681fd4ac5a6b364a476864c387bb0f5139af2fc275f06580dd76beadfcf4ebc | R | 486 | 29 | ---
title: "221221_rstudio_tf_dr_v3_singularity"
author: "Jennifer Fisher"
date: "12/21/2022"
output:
html_document: default
---
GitHub Repo:
Transfer_Learning_R03
Docker:
rstudio_tf_dr_v3
Directory of operations:
/data/project/lasseigne_lab/JLF_scratch/Transfer_Learning_R03 (singula... |
8b6673b6b22e26faccf63d087c3a2578598e565656e5c907593dc8b8710d40b9 | R | 507 | 21 | BinarySearch <- function(argu,sumabs){
if (length(sumabs) == 0) {
sumabs <- 0
}
if(l2n(argu)==0 || sum(abs(argu/l2n(argu)))<= sumabs) return(0)
lam1 <- 0
lam2 <- max(abs(argu))-1e-5
iter <- 1
while(iter < 150){
su <- soft(argu,(lam1+lam2)/2)
if(sum(abs(su/l2n(su)))<sumabs){
lam2 <- (lam1... |
62e14dbe44ecbd7960074d2982db679fcccf854ac9df7dca40ca4676c40030cc | R | 509 | 18 | ### DATA
d <- read.table("nature13173-s4.txt")
d <- t(d)
genes <- d[,1][5:nrow(d)]
# remove genes and bulk samples
d <- d[,2:(ncol(d) - 2)]
exprs_data <- as.data.frame(matrix(as.numeric(d[5:nrow(d),]), ncol = ncol(d)))
rownames(exprs_data) <- genes
colnames(exprs_data) <- d[1,]
### ANNOTATIONS
ann <- data.frame(cell_t... |
0e8466231135da8b5e419aaba76de8020ca7d64bdc8e70b09f98c60acd2b0f16 | R | 510 | 19 | library(Seurat)
library(DropletUtils)
library(argparse)
library(dplyr)
parser <- ArgumentParser("Parameters for 10x matrix")
parser$add_argument("--hto_h5", help = "Path to HTO H5 ")
parser$add_argument("--hto_mtx_path", help = "Path to save HTO mtx. ")
args <- parser$parse_args()
hto_h5 <- Read10X_h5(args$hto_h5)
... |
0ce50b6447d372bb935b5548ea51c465161b92e96dd796c61413a108d5b184e9 | R | 511 | 17 | ### DATA
d <- read.table("GSE87544_Merged_17samples_14437cells_count.txt", header = TRUE)
rownames(d) <- d[,1]
d <- d[,2:ncol(d)]
d <- d[,order(colnames(d))]
### ANNOTATIONS
ann <- read.csv("GSE87544_1443737Cells.SVM.cluster.identity.renamed.csv")
rownames(ann) <- ann[,2]
colnames(ann)[3] <- "cell_type1"
ann <- ann[,3... |
09afca2f581268dc23a4793c6597510196143f8bbf03c5fafbc5270bb65fd931 | R | 515 | 19 | library(ggplot2)
rm(list = ls())
options(stringsAsFactors = F)
QC_K27 = read.csv('RNA_QC.csv')
colnames(QC_K27)
pdf("RNA_deduplication.rate.pdf",height = 5,width = 8)
ggplot(QC_K27,aes(x=condition,y=deduplication.rate,fill=condition)) +
geom_violin(trim = TRUE) +
geom_boxplot(width=0.2,fill="white") +
scale_co... |
b14eb1795263e885724682eae89c2c179fed31b42b46d3e750a1d06e749fb071 | R | 515 | 17 | library(rmarkdown)
library(dplyr)
allData <- "/data/rachel/Linda_Lako/Spatial/spaceranger_outs_2021_102"
tissue <- "AD3"
projDir <- paste0("/data/rachel/Linda_Lako/Spatial/", tissue)
outputDir <- file.path(projDir, "/rObjects/")
## find markers
sampleNames <- paste0("AD3_D", c(10,20,35,60,90,150,210))
for (sampleNa... |
e713af03769899a1349f28ec1059fa59d820f782d516145f7ddcd727e1a698ec | R | 519 | 16 | test_that("bamEdges() working", {
test.bam <- test_path("fixtures", "sample.bam")
test.edges <- test_path("fixtures", "sample.bamEdges.rds")
expect_true(
all(bamEdges(test.bam) == readRDS(test.edges))
)
})
test_that("countEdges() working", {
test.bam <- test_path("fixtures", "sample.bam")
... |
242f37ed907d3695500a0ea06f631c44f6268a0624674572cb9faece480c8df6 | R | 525 | 20 | # Function that takes in a vector of p-values and outputs a corresponding number of stars
p_star <- function(x){
if(sum(is.na(x)) != 0){
warning("Vector contains NA values")
}
star <- factor()
star <- sapply(x, function(i) {
if(i <= 10^(-4)){"****"
... |
d159e1dc1ad13e85980b850f065d7760aebf589fbac0dded017c57d9873eef0c | R | 534 | 16 | ### DATA
data1 <- read.table("ExprMat1.txt", header=T)
ann1 <- read.table("Ann_part1.txt", header=T)
data2 <- read.table("ExprMat2.txt", header=T)
ann2 <- read.table("Ann_part2.txt", header=T)
DATA <- cbind(data1, data2)
ANN <- rbind(t(ann1), t(ann2))
### ANNOTATIONS
rownames(ANN) <- NULL
colnames(ANN) <- c("Source", ... |
ace92917926701690c6230d348222f507eec56633f1760b67144f98477ba156b | R | 549 | 21 | #DeLong test
library(pROC)
y<-c()
for(i in 1:300){
y<-c(y,0,1)
}
df<-read.delim('C:/Users/oonar/Downloads/unet_binClass_predictions.txt',
header=FALSE)
dim(df)
x<-df[,1]
df<-read.delim('C:/Users/oonar/Downloads/inception_binClass_predictions.txt',
header=FALSE)
z<-df[,1]
roc... |
728c36e71dd0a25fba0b421619e188b73e1394e0d790e511bbea5795d6707b1f | R | 555 | 23 | make.kNNG <-
function(DM, k=as.integer( 2*log(nrow(DM)) ), symm =FALSE, weight=FALSE ) {#begin function
N <- nrow(DM)
ADM <- matrix(0, N, N)
#Search kNN point
if(weight==TRUE){
for (i in 1:N) {
nid <- order(DM[i,])
ADM[ i, nid[2:(k+1)] ] <- DM[ i, nid[2:(k+1)] ]
}
}else... |
a1d2db58cf198dc671f2f9ddf47767c0bd0d7753417335f1213227431f6b1c8d | R | 560 | 13 | #' Combine colData and in_tissue column of SpatialData from SpatialExperiment into a data.frame
#'
#' @param spe SpatialExperiment object with per spot QC metrics in colData and
#' in_tissue column present in spatialData
#'
#' @return data.frame containing both colData and in_tissue from spatialData of original spe
s... |
0e59620908eaa3c718019cb3c6b64fbee16d837d12587c3e2161673cf893541d | R | 569 | 22 | ### _go_pipeline.R ###
suppressPackageStartupMessages({
library(clusterProfiler)
library(optparse)
source("/home/jovyan/tools/_go.R")
})
optslist <- list(
make_option(
c("-t", "--tempdir"),
type="character",
default="/home/jovyan/out",
help="temporary directory to save ... |
a65b5cec53db1adcda289573c5aa5583c67c98dcd5bd96804829aa5d1b8fc4cc | R | 571 | 21 | ### _gprofiler_pipeline.R ###
suppressPackageStartupMessages({
library(optparse)
source("/home/jovyan/tools/_gprofiler.R")
})
optslist <- list(
make_option(
c("-t", "--tempdir"),
type="character",
default="/home/jovyan/out",
help="temporary directory to save intermediate fi... |
0e7b0241e47d2214a7770cf49c8a476aff201d814ea3dab849a8bda821ed2155 | R | 574 | 12 | M3_RNA_count<-read.csv("E:/R files/M3_RNA_count.csv",row.names = 1)
M3_RNA_count<-as.matrix(M3_RNA_count)
M3_RNA_count_coldata<-read.csv("E:/R files/M3_RNA_count_coldata.csv",row.names = 1)
M3_RNA_count_coldata<-as.matrix(M3_RNA_count_coldata)
library("DESeq2")
dds <- DESeqDataSetFromMatrix(countData = M3_RNA_coun... |
0e1872b25657d95a99d3d9f3ead021c6d2445d0e6159a1dddc339fd035179d7a | R | 575 | 10 | HG38_FASTA_FILE <- '/home/enrico/columbia/FASTA/hg38.fa'
CHR_NAMES <- c("chr1","chr2","chr3","chr4","chr5","chr6","chr7","chr8","chr9","chr10","chr11","chr12","chr13","chr14","chr15","chr16","chr17","chr18","chr19","chr20","chr21","chr22","chrX","chrY","chrM")
genomestrings <- Biostrings::readDNAStringSet(HG38_FASTA_... |
a26e61dcf0e58fe00565b61823e3c2e8ba92f96fee5a631cb95816fbb834679a | R | 585 | 24 | #' joint_embedding()
#'
#' Extracting spatial-informed canonical loading
#'
#' @param obj stCCA S3 Object
#'
#' @export
joint_embedding <- function(obj) {
stcc <- obj$optimal_cca
meta_cell <- stcc$v
rownames(meta_cell) <- stcc$znames
meta_cell <- data.frame(meta_cell)
for ( col in 1:ncol(meta_cell)){
co... |
308f4c397e2c967319c6dfbad19ec30e825d5e7c8d28dee3f2d34b03ed2249b1 | R | 589 | 23 | #' Calculating row mean for each gene using normalized gene expression matrix
#'
#' @param obj stCCA object
#'
#' @export
#'
#'@import tibble
#'Matrix
#'matrixStats
var_genes <- function(obj){
environment(FindVariableGenesSeurat) <- asNamespace("Seurat", base.OK = TRUE)
exp <- Matrix(obj$count_exp, sparse = TRUE)... |
3bf6e47180edb57e46cc2a0d6c352c5cfa4929cb5dd32864534077d013732285 | R | 597 | 17 | #' return a vector with null GT removed
#'
#' This function takes in a GT vector object and returns it without null GTs
#'
#' @param GT_VECTOR vector object with GT (as extracted by VariantAnnotation::readVcf())
#' @param GT_NULL (optional) vector passing GT values to consider null (default: c( '0/0', './.', '0|0', '.|... |
8d1cfd398dc5ab1f0c1e45fe1347351d616ecd812e3de22383ae07c8c65a8666 | R | 610 | 21 | #' Barplot of canonical correlation for each pair of canonical variate
#'
#' @param cc Output of CCA() function. Result of Sparse CCA.
#' @param t Title
#' @param tsub Subtitle
#'
#' @export
#'
#' @import ggplot2
#' ggpubr
plot_corr <- function(cc, t, tsub=NULL) {
cca_cor <- data.frame(cc$cors)
cca_cor$CC <- paste... |
49a7ffff270b13b666fd952be2b5a76792ca037c15cb4ad9df9b22b5305e0092 | R | 615 | 26 | ### _get_go.R ###
suppressPackageStartupMessages({
library(clusterProfiler)
library(optparse)
source("/home/jovyan/tools/_go.R")
})
optslist <- list(
make_option(
c("-t", "--tempdir"),
type="character",
default="/home/jovyan/out",
help="temporary directory to save inter... |
2e4998e6b38fafa97eb24d9c9d58c8b658a95bff5a4dfd27dd588308c4c0ecdb | R | 617 | 20 | ### DATA
d <- read.table("data.txt")
# select 5 patients
d <- d[,grepl("MGH26_", colnames(d)) |
grepl("MGH264_", colnames(d)) |
grepl("MGH28_", colnames(d)) |
grepl("MGH29_", colnames(d)) |
grepl("MGH30_", colnames(d)) |
grepl("MGH31_", colnames(d))]
### ANNOTATIONS
patients <- unlis... |
747ba76367aafdabd32c037f8c46a8b15a698b570b198d4091ada95d1817d57c | R | 623 | 26 | library(Signac)
library(Seurat)
library(GenomeInfoDb)
library(EnsDb.Hsapiens.v86)
library(ggplot2)
library(dplyr)
library(patchwork)
library(rtracklayer)
library(cowplot)
set.seed(1234)
sampleInfo <- readRDS("rObjects/SampleInfo.rds")
sObj_predicted <- readRDS("rObjects/sObj_predictions.rds")
for (i in 1:length(sO... |
d49eb40894a413bc492e936a33e773e91992f212050e014f2ed57d3d1d510f87 | R | 623 | 23 | .libPaths("/home/u23/haozhang1/miniconda2/envs/r_env/lib/R/library")
args = commandArgs(TRUE)
options(stringsAsFactors = FALSE)
library(tidyverse)
library(Matrix)
##################
# load binary matrix
bmat = read_tsv(args[1])
#bmat = bmat[, -c(1:3)]
#bmat = bmat %>%
# column_to_rownames("annot")
#rownames(bmat) = ... |
c1698ba4f11837d98b622f217241838bf35eab87d8889102d8055c60133afd61 | R | 632 | 17 | library(stats)
ChooseLambda1Lambda2 <- function(y,chrom=NULL){ # using as of 8/25/09
if(is.null(chrom)) chrom <- rep(1, length(y))
y.lo <- lowess(y, f=min(50/length(y),.2))$y
y.lo <- soft(y.lo, quantile(abs(y.lo), .45))
s1=sum(abs(y.lo))
lambdas=exp(seq(log(10^(-4)), .2, len=50))
out <- matrix(NA, nrow=leng... |
51d498d49d77a76096979f562a15b5a17bada22bd7de5bac59c259bea35d3e5f | R | 639 | 11 | # Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
calculateVectors <- function(nodeColors, edges, directed, weighted, numberOfWeights, fromR = FALSE) {
.Call('_fibrationSymmetries_calculateVectors', PACKAGE = 'fibrationSymmetries', nodeCol... |
41a428b84ca5b903a2032debf57b2a4fb55d1758538cc1746a9cdd37e4fb1ead | R | 657 | 24 | library(dplyr)
library(Seurat)
library("ggplot2")
library(monocle3)
library(patchwork)
library(SeuratWrappers)
library(harmony)
library(ggplotify)
library(rmarkdown)
subsets <- readRDS("rObjects/subsets_list.rds")
for (i in 1:9){
outName <- names(subsets)[i]
seuratObj_subset <- SetIdent(seuratObj_subset, value ... |
df482c44a39bce23439e05657961af042bac8b0694170def4f3bc1afbd51cc40 | R | 657 | 15 | ### install_deps.R ###
deps <- read.csv("./tools/requirements_r.csv", row.names=1)
"%notin%" <- Negate("%in%")
current_pkg <- installed.packages()
for(package in rownames(deps)) {
if (package %notin% rownames(current_pkg)) {
remotes::install_version(package, version = deps[package,"Version"], repos="http:... |
cb0bd82ba31d6086bf5103dedaa66234a09011b6b9c2d5145fa7ee17b338db6a | R | 663 | 20 | ### DATA
d <- read.table("data.txt", header = T)
d <- d[!duplicated(d$ID),]
rownames(d) <- d$ID
d <- d[,2:ncol(d)]
### ANNOTATIONS
ann <- read.table("biase_cell_types.txt", stringsAsFactors = F)
### SINGLECELLEXPERIMENT
source("../utils/create_sce.R")
sceset <- create_sce_from_normcounts(d, ann)
# convert ensembl ids... |
b30eccc43e487076623f0b41b9fcddcc0b4f501994bba9f30c945bc50757e6ca | R | 665 | 7 | CHR_NAMES <- c("chr1","chr2","chr3","chr4","chr5","chr6","chr7","chr8","chr9","chr10","chr11","chr12","chr13","chr14","chr15","chr16","chr17","chr18","chr19","chr20","chr21","chr22","chrX","chrY")
CODING_LENGTH <- c( 8345447,5878924,4836344,3417120,3959062,4251743,3840011,2910726,3182390,3240638,4701713,4544590,1644627... |
32371c22aaeeb88d9be7fd58a268925fec056f48a3f0167da8cf08c9bfcfd4e4 | R | 666 | 14 | sce <- import(sampleDirs = c("/data1/zj_mut/"))
sce.raw <- import(sampleDirs = c("/data1/zj_mut/"), dataType = "raw")
scemut <- decontX(sce, background=sce.raw)
umap <- reducedDim(scemut, "decontX_UMAP")
plotDimReduceCluster(x = scemut$decontX_clusters,
dim1 = umap[, 1], dim2 = umap[, 2])
plotDecon... |
4436cbe4022860fab0df8d2f70311d4da4bb501eb0434f700f09bf475051f24d | R | 669 | 30 | library(Spaniel)
library(scran)
library(scater)
library(batchelor)
library(dplyr)
library(Seurat)
library(SCFunctionsV3)
library(cowplot)
library(RColorBrewer)
library(SCFunctionsV3)
library(harmony)
allData <- "/data/rachel/Linda_Lako/Spatial/spaceranger_outs_2021_102"
tissue <- "fetal_retina"
projDir <- paste0("/d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.