sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
4c85669a1a3f214ca4e48e8ef7335e812b4fa4f64673c6a3f6ce39c14bfe4c10 | Python | 200,000 | 5,551 | import collections
from collections import OrderedDict
import re
import warnings
from contextlib import contextmanager
from copy import deepcopy, copy
import itertools
from functools import reduce
from _plotly_utils.utils import (
_natural_sort_strings,
_get_int_type,
split_multichar,
split_string_posi... |
5436a6d08bffe2f01bac2e33ccae71b0e1420986bc39d1fddc09b529ce0813cb | Python | 200,000 | 4,883 | """
session.py
Classes to store, extract, and analyze an Allen Institute OpenScope session for
the Credit Assignment Project.
Authors: Colleen Gillon, Blake Richards
Date: August, 2018
Note: this code uses python 3.7.
"""
import warnings
from pathlib import Path
import itertools
import numpy as np
import pandas ... |
71a9b8d809355af1ea8e761ae2b750ee97eb498b0f6a92e25b0f0e4df3104367 | Python | 200,000 | 4,500 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basewidget import BaseFigureWidget
class FigureWidget(BaseFigureWidget):
def __init__(
self, data=None, layout=None, frames=None, skip_invalid=False, **kwargs
):
... |
78ed4ca1e2f93e3a59ed9fd92caf78deefbbe8d3452566f8181b4e1d1dcf9c70 | Python | 200,000 | 5,844 | # Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
"""Data containers and basic operations
Data Representation
===================
Data is stored in three main vessels:
:class:`Factor`:
stores categorical data
:class:`Var`:
stores numeric data
:class:`NDVar`:
stores numerical data where each cell c... |
8896ce94c496ccb886b110c53836d0b76f919f72b8cfa211cbb42f0b26fb2363 | Python | 200,000 | 5,399 | """Binary classes"""
import binascii
import gzip
import io
import json
import logging
import math
import os
import re
import shutil
import struct
import subprocess
import tarfile
import tempfile
import zipfile
from collections.abc import (
Iterable,
Iterator,
)
from json import dumps
from typing import (
A... |
88ddd590ee7d57f687e87f2f6ceb699f12dfd0fb86c76b9779bfa10d4006bf81 | Python | 200,000 | 5,221 | """
The environment builder app.
Composes an environment interactively -- arena, sources, borders and the odor,
wind and thermal fields -- with a live canvas preview.
"""
from __future__ import annotations
import html
import io
import json
from dataclasses import dataclass
import math
from numbers import Number
from... |
a7140d9ea2a60248a80a13c99e149343fd8bb868fa9f52f7b056b67099fc89ea | Python | 200,000 | 4,504 | # --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
from plotly.basedatatypes import BaseFigure
class Figure(BaseFigure):
def __init__(
self, data=None, layout=None, frames=None, skip_invalid=False, **kwargs
):
"""
... |
b8cc3cb06093fc0af4950df4bd20401fe7e3cdfab799c4a0fc57dd90a99250c4 | Python | 200,000 | 4,211 | # Copyright (c) 2025, Ted Zadouri, Markus Hoehnerbach, Jay Shah, Tri Dao.
import enum
import math
from typing import Callable, Optional
from functools import partial
import cuda.bindings.driver as cuda
import cutlass
import cutlass.cute as cute
from cutlass.cute import FastDivmodDivisorV2
from cutlass import Float32,... |
d7aed6baa68068c3a75a7aea8ea0bc038881162a360df75819b24c13fe97b2fc | Python | 200,000 | 4,083 | """
Additional functionalities to characterize signaling patterns from spatial transcriptomics
These include:
- prediction of the effects of spatial perturbation on gene expression- this can include the effect of perturbing
known regulators of ligand/receptor expression or the effect of perturbing the ligand/r... |
d91870b585bce508d977893fdd06e9ba9fce280e8a00db0bfc73b4527df902c0 | Python | 200,000 | 34 | # pylint: skip-file
# pylint: disable=line-too-long
"""Create quantized model from JSON files..."""
import os
import warnings
import mxnet as mx
from mxnet.context import cpu
from mxnet.gluon import SymbolBlock
from gluoncv.utils.compress_json import get_compressed_model
__all__ = ['mobilenet1_0_int8', 'resnet50_v1_in... |
fc7c9b48b603aabb24d3758ce298543005e74f886d5e6a23009a6dddc47816d9 | Python | 200,000 | 3,635 | validation_paths = {'airplane': ['ilsvrc/val/n02690373/ILSVRC2012_val_00024747.JPEG',
'ilsvrc/val/n02690373/ILSVRC2012_val_00024108.JPEG',
'ilsvrc/val/n02690373/ILSVRC2012_val_00015498.JPEG',
'ilsvrc/val/n02690373/ILSVRC2012_val_00018685.JPEG',
'ilsvrc/val/n02690373/ILSVRC2012_val_00044253.JPEG',
'ilsvrc/val/... |
02423c52825f989ff03c1cea8d0dfd35e4b9ca4a835849716bc429b8ea018494 | Python | 200,002 | 4,684 | # Author: Christian Brodbeck <christianbrodbeck@nyu.edu>
"""MneExperiment class to manage data from a experiment"""
from collections import defaultdict
from copy import deepcopy
from datetime import datetime
from glob import glob
import inspect
from itertools import chain, product
import logging
import os
from os.path ... |
04717b56a02cc64966c5abd86a0bed138afa603d9ba1a0d7f75d939e01f861f6 | Python | 200,002 | 5,381 | #! /usr/bin/python3
# -*- coding: utf-8 -*-
# tifffile.py
# Copyright (c) 2008-2017, Christoph Gohlke
# Copyright (c) 2008-2017, The Regents of the University of California
# Produced at the Laboratory for Fluorescence Dynamics
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or witho... |
07801597363320d2c6f463150d005cc7f59ad55d63e6357b02e1f31df573d5b3 | Python | 200,002 | 6,351 | import builtins
import math as python_math
import re
import numpy as np
from keras.src import backend
from keras.src.api_export import keras_export
from keras.src.backend import KerasTensor
from keras.src.backend import any_symbolic_tensors
from keras.src.backend import config
from keras.src.backend.common import dty... |
9015be1844965b4b209c2d316ad7d2e53eb222bf2abfae0549ef65807350b86e | Python | 200,002 | 3,876 | from pathlib import Path
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import os
from os.path import join
import operator
import copy
from tqdm import tqdm
from scipy.io import savemat
import random
import datetime
import scipy.io as sio
from scipy.io import loadmat
import matplotlib.patches as... |
a77bfd448dba541eef372602784173f7f51bf9541cd71741dea9fe4b2b56593e | Python | 200,003 | 3,837 | # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
"""
Generate predictions using the Segment Anything Model (SAM).
SAM is an advanced image segmentation model offering features like promptable segmentation and zero-shot performance.
This module contains the implementation of the prediction logic and ... |
5d551f832bcceaa02d261502593b5888371be996c4ea5be99d81c1f9857743c1 | Python | 200,004 | 5,439 | import functools
import itertools
import math
import warnings
import numpy as np
import pytest
from absl.testing import parameterized
import keras
from keras.src import backend
from keras.src import ops
from keras.src import testing
from keras.src.backend.common import dtypes
from keras.src.backend.common import is_i... |
c8c0c52e1542df8f16fb2dfd61afbc5aebd019fde82dfb36f1d52c0c2388b7b9 | Python | 200,004 | 4,896 | """General-purpose helpers: video I/O wrappers, path tools, image warping, downloads.
Collected utilities used across the face-rhythm package. Notable groups:
* Video readers (``VideoReaderWrapper``, ``BufferedVideoReader``) around
``decord`` / ``torchcodec`` with pre-fetch threads.
* Path and file helpers (``find_... |
edc7a22a82e624a0cc6b39d15b55e79e29261794fc50de4e18e81fe9f4058d5e | Python | 200,004 | 5,347 | """Tests for the validation subpackage.
Covers: import paths, registry consistency, and integration tests through
specific exemption paths. Perturbation and deep-clone helper unit tests live
in ``tests/test_validation_perturbation_units.py``.
"""
import threading
import warnings
from collections import defaultdict, d... |
edaf1d73f59004a428b0a1fbf95dafeb557e9d4a76498f24738055493db01de2 | Python | 200,006 | 4,916 | """
Galaxy data model classes
Naming: try to use class names that have a distinct plural form so that
the relationship cardinalities are obvious (e.g. prefer Dataset to Data)
"""
import abc
import base64
import errno
import json
import logging
import numbers
import operator
import os
import pwd
import random
import s... |
23c106606a85744d23e93dd6be19f657d617fd689f757b6312ffe08e70927b5e | Python | 200,012 | 4,834 | # Copyright (c) 2025, Jay Shah, Ganesh Bikshandi, Ying Zhang, Vijay Thakkar, Pradeep Ramani, Tri Dao.
# [2025-07-04] Version in Cute-DSL, for Hopper and Blackwell. You'll need install nvidia-cutlass-dsl==4.2.0.
import os
import math
import operator
import warnings
from dataclasses import dataclass, replace
from functo... |
1dcb7c4c4eb3e3dcda580915742b9e021beb77d257af44bd00763b89e5fa9bb7 | Python | 200,102 | 2,567 | #Natalia Łapińska
# GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
# This program is free software: you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation,
# either version 3 of the License. This program is distributed in
# th... |
3662c0f5b267fe5660fa65dfc93e3044f4a9f412bd7dab941a761c9d06f40b36 | Python | 200,118 | 4,914 | """Regression tests guarding against specific bugs reappearing."""
import sys
from pathlib import Path
import pytest
@pytest.mark.parametrize("engine", ["in_memory", "out_of_core"])
def test_get_methods_do_not_mutate_shared_tag_config(engine):
"""#252 — get_* must not mutate the shared Conf default-tag lists, n... |
f90687e3dcb6ef1f3c2c2b82dd6809dd4c0139e2ab3af7b06112d6f4fa3badd5 | Quarto | 1,307 | 73 | ---
title: "Bayesian parametric models for survival prediction in medical applications"
subtitle: "Sample size calculation"
date: "12-02-2022"
author:
- name: Iwan Paolucci, PhD
affiliation: "MD Anderson Cancer Center, Department of Interventional Radiology, Houston, TX, USA"
orcid: 0000-0002-9393-3015
toc: t... |
873ac3bfb6af650fc43ac71c6e5f74eb4a1003f625e612ef1dfdb3ae79eed44c | Quarto | 4,076 | 167 | ---
title: "Bayesian parametric models for survival prediction in medical applications"
subtitle: "Overlap of posterior distributions"
date: "07-03-2023"
author:
- name: Iwan Paolucci, PhD
affiliation: "MD Anderson Cancer Center, Department of Interventional Radiology, Houston, TX, USA"
orcid: 0000-0002-9393-... |
016950751ad5cfdbdc64e67b2df4ba78dac334774a3a4960d6d96194303c1854 | Quarto | 7,082 | 288 | ---
title: "Bayesian parametric models for survival prediction in medical applications"
subtitle: "Visualization posterior distributions"
date: "07-03-2023"
author:
- name: Iwan Paolucci, PhD
affiliation: "MD Anderson Cancer Center, Department of Interventional Radiology, Houston, TX, USA"
orcid: 0000-0002-93... |
20cc42a18bf01e13f44d9204bddd5f664180bc87d48b822212e50f2e74975515 | Quarto | 9,266 | 251 | ---
title: "Bayesian parametric models for survival prediction in medical applications"
subtitle: "Assessing overfitting"
date: "07-04-2023"
author:
- name: Iwan Paolucci, PhD
affiliation: "MD Anderson Cancer Center, Department of Interventional Radiology, Houston, TX, USA"
orcid: 0000-0002-9393-3015
toc: tru... |
b13c654de64d393cb0718a10330e26fed174c6a0bb99ee57d0d5a70ae44182af | Quarto | 9,544 | 294 | ---
title: "Bayesian parametric models for survival prediction in medical applications"
subtitle: "Comparison of algorithms"
date: "07-04-2023"
author:
- name: Iwan Paolucci, PhD
affiliation: "MD Anderson Cancer Center, Department of Interventional Radiology, Houston, TX, USA"
orcid: 0000-0002-9393-3015
toc: ... |
630d84363b77fee6f9e67b956c1b4f8fa32a81be559d0b64821f2de8aa78fc06 | Quarto | 11,028 | 354 | ---
title: "Bayesian parametric models for survival prediction in medical applications"
subtitle: "Retraining using Bayes rule"
date: "07-02-2022"
author:
- name: Iwan Paolucci, PhD
affiliation: "MD Anderson Cancer Center, Department of Interventional Radiology, Houston, TX, USA"
orcid: 0000-0002-9393-3015
to... |
6f66f8e63aa6ef058279f398834570519bdc6817e6e6b93e79269f70f545765b | R | 49 | 1 | install.packages(".", repos=NULL, type="source")
|
08fa3fb64e4d222557f74d5d4c7a5039bf4ccd262352fe4b8e869fcb7104dedd | R | 52 | 4 | catn <- function(...) {
cat(...)
cat('\n')
} |
ac9d8efdbe14eab3bf874c2a68d06b01c9a52cb2f92aa63301f2b23519fa3a6f | R | 54 | 2 |
normalize <- function(x){(x-min(x))/(max(x)-min(x))}
|
ed734aad8ac2d046479e18edc6af38fec38ff4a08bc8cae3d0798f34c7fb5d15 | R | 55 | 5 | "ES.w1" <-
function(P0,P1){
sqrt(sum((P1-P0)^2/P0))
}
|
cacddf2966b5424349b0467b76017eda2412b0f8e79c96ccaa6936f6c92ac448 | R | 68 | 4 | library("testthat")
library("granulator")
test_check("granulator")
|
88b2c921a9907654dab292f0184d0c2858e8e23fae6f1169cb954c3ee9ec9018 | R | 70 | 1 | This code is unrelated to this project - Aditya will delete this file
|
c8d8560cd3d1538d8f155e8b88eb165d53e0d5d35c11548c6706e6d58d8909ff | R | 72 | 3 | setGeneric ("extract",
function(object){standardGeneric("extract")}
)
|
7ad7b9e3a3f0c6f1e931e4d7e3cd784982b3e9ef240b06526f191c94e2eaa6f1 | R | 75 | 4 |
ggmap = function(m, ...) {
gmap(reshape2::melt(as.matrix(m)), ...)
}
|
85c7912b6d8918c7bdc4c249d687bf1f84636207abca7273c89d0f8f5344bfaf | R | 77 | 5 | "ES.h" <-
function (p1, p2)
{
2 * asin(sqrt(p1)) - 2 * asin(sqrt(p2))
}
|
813e8507115b66b2ffa78511798eb485de4680d2ac9cfd719933faa1907048e3 | R | 82 | 7 | #' analyzeHiC.
#'
#' @import misha
#' @name analyzeHiC
#' @docType package
#'
NULL |
27bd4c661e98b7567d1e106f01fde5197ecfb12525d87bc043482418ee6dc732 | R | 84 | 4 | getUrlDis <- function() {
url <- "https://www.disgenet.org/oql"
return( url )
}
|
f58b1acb22b7d5fdc12c908bf0ca323535f055b2f41fa898c422c0c782bf7185 | R | 85 | 4 |
ggraster = function(m, ...) {
graster(reshape2::melt(as.matrix(m)), ...)
}
|
dd1ae523541919b762e438892e2bf1522f1d13c18ee37e5ef227e79dda99c725 | R | 94 | 5 | set.seed(321)
library(testthat)
library(SPOTlight)
# plotImage() ----
test_check("SPOTlight")
|
0058eae0989ddd8407b79390689b0fdc84ea0311e8d2c642183e1f4948a65651 | R | 95 | 1 | utils::globalVariables(c('..level..', 'UMAP1', 'UMAP2', 'geom_point_rast', 'geom_text_repel'))
|
72784355634a461ee7f41d68821182b3d33b0063d596b2b730a3f4463eb858fe | R | 95 | 4 | dyn.load(paste("R/adolc", .Platform$dynlib.ext, sep=""))
source("R/adolc.R")
cacheMetaData(1)
|
dbf97f7cf3ea48675a20742cccd80a71a20dbb1c187e94cd38ed966dddd3c84c | R | 100 | 4 | linters <- linters_with_defaults(
line_length_linter = NULL,
commented_code_linter = NULL
)
|
3b11755c76980b7b1b28f4294e7432ceb482227f4cdc2029ac5a233f7f72fe56 | R | 103 | 8 | "ES.w2" <-
function(P){
pi<-apply(P,1,sum)
pj<-apply(P,2,sum)
P0<-pi%*%t(pj)
sqrt(sum((P-P0)^2/P0))
}
|
859ddb4326afb9ad920a49c0a25c694a9eceaf1559ba13e7e364571dd5a1a971 | R | 106 | 4 | #' @keywords internal
#' @useDynLib symphony, .registration=TRUE
#' @importFrom Rcpp sourceCpp
"_PACKAGE"
|
03518bf2eda3159d9eb613e9f2af74454bb8b50f3f6b0a41d58d1c8256a78c2f | R | 113 | 4 | #!/usr/bin/env Rscript
library(epicseg)
epicseg:::CLI(args=commandArgs(trailingOnly=TRUE), epicseg:::getProg())
|
c095fef7eadb734891a408a9c96ff4d8b2b8d7f61fe6ac7da8a141a723950b99 | R | 114 | 6 | #' Correlation method
#' method for computing correlation coefficients
#'
#' @format cor.methods
"cor.methods"
|
d835bf4890820ea5156ff9e98fa8caa0623355832d1f1aa6299222f6b2889971 | R | 118 | 5 | args <- commandArgs(trailingOnly = TRUE)
repos <- "https://cran.rstudio.com"
install.packages(args, repos = repos)
|
1707e8ddf0a8180b48700c62b15454b55286f646251529f073df012107570e37 | R | 119 | 6 | #' distance metric
#' method for computing distances from a matrix object
#'
#' @format dist.methods
"dist.methods"
|
91d6bb0f756a389c8bc9ae2f67d69708a948dc37c8f17d4d139751f8f8472f9b | R | 128 | 1 | data1 <- read.csv("C:\\Users\\hratigan\\Documents\\mPFC-RE-CA1 Project\\pf_exp_days.csv", header=TRUE, stringsAsFactors=FALSE)
|
2c0ba5112b48e24e482cdc2cca0d317ea77a714ee871973b76cd4704d1172141 | R | 150 | 9 | #
# Hello World R script, launched from RunR java
#
hello <- function() {
cat( R.version.string );
cat('\n');
cat('Hello, world!\n');
}
|
640b9801d8234de45228f9f674b8714304523116bdef23be2bf5a0d14880453e | R | 152 | 14 | #' Accessory codes for Plotting of DAFi gated populations
#'
#'
#'
biaxial_plot <-
function(){
}
oneD_density_plot <-
function(){
}
|
09316445fb47f699dc116a55736f1aed399d5dc8991821537f6e932dcd42a8a1 | R | 153 | 8 | int.tec.ac <-
function(Nt,dist.sc,bij,dist.bij){
mat.bij<-mat.or.vec(Nt,Nt)
q<-which(dist.sc<=dist.bij,arr.ind=TRUE)
mat.bij[q]=1
return(mat.bij)
}
|
0248b3361ee29803719a6177c792982a2884998ea8fd41eff9062b1c7726d72b | R | 167 | 11 | #' pal28, 28 Pretty Discrete Colours
#'
#' @docType data
#'
#' @format A character vector.
#'
#' @keywords datasets
#'
#' @examples
#' scales::show_col(pal28)
"pal28"
|
dfa7a6bd222070071046409f4016c7fde97ee066685dcd010578d072ed08f3f4 | R | 167 | 11 | #' pal19, 19 Pretty Discrete Colours
#'
#' @docType data
#'
#' @format A character vector.
#'
#' @keywords datasets
#'
#' @examples
#' scales::show_col(pal19)
"pal19"
|
844740b4c8c9a6bc659c5086815da3d053500cf525f9797d73b3323e1083ac0c | R | 171 | 11 | #' simpsons, 16 Discrete Colours
#'
#' @docType data
#'
#' @format A character vector.
#'
#' @keywords palettes
#'
#' @examples
#' scales::show_col(simpsons)
"simpsons"
|
a4e57b1d914e01de4ebc70f869253454f6bdbcef2723f66ea48ad95970713215 | R | 172 | 4 | data<- read.table("all.ACC.sc",header=FALSE)
y<-p.adjust(data$V9)
z<-cbind(data,y)
write.table(file="all.ACC.sc.qvalue.results",z,sep="\t",quote=F,row.names=F,col.names=F)
|
e22044a777c2bfabd4667455fa66654c317e3960f2df8747a867028484d4a9c1 | R | 172 | 11 | #' futurama, 12 Discrete Colours
#'
#' @docType data
#'
#' @format A character vector.
#'
#' @keywords palettes
#'
#' @examples
#' scales::show_col(futurama)
"futurama"
|
1d4d376eb60b2c07d1086c3f63b4a5af5c0b63ab92d54e751c8684309f6c42dd | R | 195 | 6 | #' @export
pvalOfBEZI <- function(x, mu, sigma, nu, lower = TRUE){
pval <- (1 - gamlss.dist::pBEZI(
x, mu = mu, sigma = sigma, nu = nu, lower.tail = lower, log.p = FALSE))
return(pval)
}
|
542741574ea75ab919c14645ea694d28fd8cdf875d1128d60049835c9bb0c402 | R | 196 | 11 | #' ensembl2symbol
#'
#' @docType character vector conversion
#'
#' @usage symbols = ensembl2symbol[ensembl_gene_ids]
#'
#' @format A character vector.
#'
#' @keywords datasets
#'
"ensembl2symbol"
|
0515a4773a06e019967b5711927f2281d539f0fb39c1de08b050dbf196ef077d | R | 198 | 5 | .onLoad <- function(libname, pkgname) {
fl <- system.file("extdata", "metadata.csv", package=pkgname)
titles <- read.csv(fl, stringsAsFactors=FALSE)$Title
createHubAccessors(pkgname, titles)
} |
57ac79f110faa2ed73044dc4182ed18db1c1be5711fcb3d07d42ca1e59efaab0 | R | 199 | 6 | #' agglomeration method in hierarchical clustering
#' agglomeration method in hierarchical clustering when grouping members into a tree structure.
#'
#' @format cluster.methods
"cluster.methods"
|
e50fb45bf2f5084342dc7b89ada8b43f405189b1ed9e4f6dda9f9aa4480dd251 | R | 206 | 14 | #' ggpubr, 3 Discrete Colours
#'
#' @docType data
#'
#' @usage data(ggpubr)
#'
#' @format A character vector.
#'
#' @keywords datasets
#'
#' @examples
#' data(ggpubr)
#' scales::show_col(ggpubr)
"ggpubr"
|
4e4d8fdd42b0f9b0cbd7aeb2ca4d76d3010078f7eaa728d91fc894d3095bccab | R | 210 | 9 | getinitialsij <-
function(Nr,Nt,type,smallnumber=1,min=0.00005,max=0.00011){
switch(type,
zero=mat.or.vec(Nr,Nt),
small=smallnumber*(mat.or.vec(Nr,Nt)+1),
rand=matrix(runif(Nr*Nt,min,max),nrow=Nr)
)
}
|
b528750d0fe89192028aed536953809b12159c2da723f81639471f5fb53f1a53 | R | 217 | 4 | data <- read.table(file="Mammals.feature.xls",sep="\t",header=T)
attach(data)
mylogit <- glm(Label ~ mRNA + ORF + Fickett + Hexamer, family=binomial(link="logit"), na.action=na.pass)
save.image("Mammals.logit.RData")
|
97907f57ad7db57904737a15cb77d5dda4cd357a015013754ee2cf73786d4f68 | R | 241 | 16 | # load original PNET data files
library(tidyverse)
library(fs)
source("scripts/utils.R")
dir_create("pnet_data/mounted")
walk2(
ORIGINAL_FILES,
MOUNTED_FILES,
file_copy,
overwrite = TRUE
)
info("Loaded original PNET input data")
|
74591761ba864bafc61a077a36de3fda0b5116d1ef036020fe1bd4444d7ec8cd | R | 247 | 14 | #' palG34R, a palette of reds and blues for cases within two groups
#'
#' @docType data
#'
#' @usage data(palG34R)
#'
#' @format A character vector.
#'
#' @keywords datasets
#'
#' @examples
#' data(palG34R)
#' scales::show_col(palG34R)
"palG34R"
|
dd8a1fb4ea4747d0fedf604e122ebc685d7555ed025a2884fba737f100a28a57 | R | 250 | 11 | #' Divergent Heatmap Colours from Blue to Red
#'
#' @docType data
#'
#' @format A character vector of 11 heatmap colours from blue to red, with the middle value as whote
#'
#' @keywords datasets
#'
#' @examples
#' scales::show_col(palBuRd)
"palBuRd"
|
2ebcb0748d2f534b3989e6495346aa929b621e1fd6c2d63e1ca53b3675d36923 | R | 258 | 6 | library(uwot)
human <- as.matrix(read.table("../data/processed/data_merged.txt", header=T))
um <- umap(t(human), metric='correlation', init="random", min_dist = 0.01, n_neighbors=30)
write.table(um, file="../data/processed/umap.txt", quote=F, row.names=F)
|
369b873476fbfe4fe9f2d7f993d18e4de5fd8e1288ab69ffe82fd48a4ac0ef7c | R | 259 | 10 | library("rsconnect")
source("token.R")
options(repos = BiocManager::repositories())
rsconnect::deployApp(
appFiles = c('app.R', "LC_singleNucleus_SCE_EHub.rds", "initial.R"),
appName = 'locus-c_snRNA-seq',
account = 'libd',
server = 'shinyapps.io'
)
|
ee4c016aa36958cba885b5c993452afabc831be75435989d5ca8c63f1b3152fa | R | 264 | 9 | ## File containing manual fixes for code generated by swig
## that is wrong.
## This file will get shorter and disappear as we improve swig.
PermuteAxesImageFilter_DefaultOrder =
function(value, .copy = FALSE)
{
PermuteAxesImageFilter_DefaultOrder_get(.copy)
}
|
7c218cc4c0bf33306719c1c1cf2098490c58c2cd3f0041f21dceabc53897b56b | R | 269 | 7 | library(SimpleITK)
elastixImageFilter <- ElastixImageFilter()
elastixImageFilter$SetFixedImage(ReadImage("fixedImage.nii"))
elastixImageFilter$SetMovingImage(ReadImage("movingImage.nii"))
elastixImageFilter$Execute()
resultImage <- elastixImageFilter.GetResultImage()
|
eb163e7917c7e7810cbcf88f25553b7e6481d0c32497317a179149cdc430d228 | R | 271 | 7 | #' @title Convert logTPM to TPM
#' @description 'This function has been deprecated. Please instead use `scalop::unlogtpm`'
#' @rdname tpm
#' @export
tpm = function(m, bulk = F) {
message('This function has been deprecated. Please instead use `scalop::unlogtpm()')
}
|
11321fa45bcf76c85d8bc0c2edde6c856ad41331ee14656d82c586d614394cac | R | 273 | 10 | library(Seurat)
library(SeuratDisk)
library(here)
## convert the h5Seurat to h5ad file
save_merged_fn = here('data/tidy_data/Seurat_projects',
"OUD_Striatum_refined_all_SeuratObj_N22.h5Seurat")
Convert(save_merged_fn, dest = "h5ad", assay = 'RNA') |
d92228638efee236f4a6d2fac49c84918477a01a690b7f4ca601f6a4eb3683a1 | R | 292 | 10 | #' @title Range of the rowMeans of a matrix
#' @description Returns the range over the rowMeans of a matrix
#' @param mat a matrix
#' @return the range of the rowMeans of the matrix provided.
#' @rdname range_rowmeans
#' @export
range_rowmeans <- function(mat) {
range(rowMeans(mat))
}
|
17f31b6662755a43f072cfa311aab997080ba120ca26b75d880aff6b5d1b9c78 | R | 294 | 10 | enrichment_phyper <- function(NDD, List, background){
q <- length(intersect(List$ensembl, NDD$gene)) -1
m <- nrow(NDD)
n <- length(setdiff(background[,1], NDD$gene))
k <- length(List$ensembl)
pvalue <- phyper(q,m,n,k, lower.tail = FALSE)
return(as.vector(c(pvalue, q+1, m)))
}
|
baef0562890e719bd8ea8a28f4406f7b62cfe0673ce0a4305364ae267199b6ec | R | 295 | 6 | install.packages('PRROC', repos="https://cran.r-project.org/")
install.packages('data.table', repos="https://cran.r-project.org/")
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager", repos="https://cran.r-project.org/")
BiocManager::install(c("slingshot", "MAST"))
|
fb01236cd8c404bd0e455ecab52c8ed89e3af0e7593e359f61ad6206e31502fa | R | 298 | 14 | source("http://bioconductor.org/biocLite.R")
biocLite('BiocUpgrade')
biocLite("Oscope")
install.packages("BiocInstaller",
repos="http://bioconductor.org/packages/3.2/bioc")
source("https://bioconductor.org/biocLite.R")
biocLite()
# see https://www.bioconductor.org/install/
|
f86462f2e0253a6400ef4d9a20e29487be266af04a05bb6a9e10631c983c80a4 | R | 305 | 9 | ## zzz.R --- general functions for loading/unloading package.
.onUnload <- function(libpath) {
library.dynam.unload("gierer", libpath)
cat("Detaching gierer package with shared objects\n")
}
#.onUnload is preferred to .last.Lib, see help file.
# use unloadNamespace("gierer") to detach the package.
|
7e129d6ab2c95fd7f47ff6285d080144acadba234813baf923de9f3cd058e925 | R | 313 | 19 | # Analysis
library(symphony)
library(harmony)
library(singlecellmethods)
library(irlba)
library(tidyverse)
library(data.table)
library(matrixStats)
library(Matrix)
library(plyr)
library(dplyr)
# Plotting
library(ggplot2)
library(ggthemes)
library(ggrastr)
library(RColorBrewer)
library(patchwork)
library(ggpubr) |
7ce437a7cbf195470494544c4c29b5a3cfa72a2ba6b8b3793fe6b10b40e4b74e | R | 327 | 12 | GGsave = function(filename,
plot=last_plot(),
width=dev.size()[1],
height=dev.size()[2]) {
device = 'png'
if (str_detect(filename, "pdf")) device = 'pdf'
ggsave(filename=filename,
plot=plot,
width=width,
height=height,
device=dev... |
c8aa12e19416ab73487a9586f1036a854c6755ca2024a85ef21de342b2a61659 | R | 340 | 21 | logger::log_threshold(logger::TRACE)
log_file <- snakemake@log[[1]]
logger::log_appender(logger::appender_file(log_file))
afnm <- snakemake@input[["afnm"]]
str(afnm)
logger::log_info(afnm)
bfnm <- snakemake@input[["bfnm"]]
str(bfnm)
print(bfnm)
params <- snakemake@params[["a"]]
str(params)
print(params)
print(snak... |
81b6e1a2c1c69a8347102f2214f6cf9b11cbdd1f6d8c9c136db20d7a13e1137d | R | 359 | 9 | #########################################################
# Additional details for WeberDivechaLCdata_Visium object
#########################################################
# All code to generate the 'WeberDivechaLCdata_Visium' object is available from
# GitHub at: https://github.com/lmweber/locus-c
# This object i... |
c15079e843d5183281c1e330567b3cefc48b73b0781b7fd31595819c0b78f17c | R | 369 | 24 | getcij <-
function(chem,Ai,aj,Bi,bj,Nr,Nt){
EPSA=1
EPSB=1
EPS=1
cij<-mat.or.vec(Nr,Nt)
if(chem=="add"){
for(i in 1:Nr){
for(j in 1:Nt){
cij[i,j]=EPSA*Ai[i]*(max(aj)-aj[j])+EPSB*Bi[i]*bj[j]
}
}
}else if(chem=="mult"){
for(i in 1:Nr){
for(j in 1:Nt){
cij[i,j]=EPS*Ai[i]*(max(aj)-aj[j])*Bi[i]... |
01694348d446399236e4cf38e1e3bcc93e26e39ff4dd4fbbf54515e52c8f4886 | R | 375 | 8 | #' Hallmarks of transcriptional intratumour heterogeneity across a thousand tumours
#'
#' Gavish, A., Tyler, M., Greenwald, A.C. et al. Hallmarks of transcriptional intratumour heterogeneity across a thousand tumours. Nature 618, 598–606 (2023). https://doi.org/10.1038/s41586-023-06130-4
#'
#' @docType data
#'
#' @form... |
849a6cb4766dc907605ea51bde61637e5c8a7020cfb00fc6ef83b9f96779e601 | R | 388 | 9 | cmdargs <- c("-m","mask.nii.gz", "--set1", "setfilenames1.txt",
"--set2", "setfilenames2.txt",
"--setlabels1", "setlabels1.csv",
"--setlabels2", "setlabels2.csv",
"--model", "lmerICC.R",
"--output", "lmerICC/icc.",
"... |
1089fc991cc4d373c712e415d1cbfa52f93539d5c25f6930e31a8e3e3d6a8173 | R | 390 | 9 | ################################################################
# Additional details for WeberDivechaLCdata_singleNucleus object
################################################################
# All code to generate the 'WeberDivechaLCdata_singleNucleus' object is
# available from GitHub at: https://github.com/lmwe... |
d421cd05a49f36c35e75f8cac8845980dcae72856f8e30daabe81728aae7945e | R | 390 | 9 | cmdargs <- c("-m","mask.nii.gz", "--set1", "setfilenames1.txt",
"--set2", "setfilenames2.txt",
"--setlabels1", "setlabels1.csv",
"--setlabels2", "setlabels2.csv",
"--model", "nlmemodel.R",
"--output", "nlmemodel/n.",
... |
3fb33032cc41b4c2dbf610d162da6ef38bcd20dff7facccc77a5af556631352f | R | 391 | 10 | #' @title Convert Counts to Counts-Per-Million (CPM)
#' @description Convert counts to CPM, by scaling raw counts such that they sum to 1 million per cell.
#' @param counts matrix of raw counts (gene rows; cell columns)
#' @return scaled matrix of counts-per-million values
#' @rdname cpm
#' @export
cpm = function(co... |
f3e6cbdbc65bf9ccb1b3d21387983115c4bce526d337fe4dad087fbdfbdc1856 | R | 392 | 7 | #' Marker gene sets of Normal Cell Types and Pan-Cancer Programs
#'
#' Marker genes for different normal cell types and some pan-cancer expression programs.
#'
#' @format A list of character vectors (i.e. sets of gene per cell type / program)
#' @source Microglia signature: \url{doi:10.1016/j.cell.2019.11.010}; House... |
4c9505135db7249f5c7034dfce48f7c91d6f29ee1344827d2dea3a25b3304305 | R | 397 | 11 | # Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
predict_nmf <- function(A_, w, L1, L2, threads) {
.Call(`_SPOTlight_predict_nmf`, A_, w, L1, L2, threads)
}
run_nmf <- function(A_, At_, tol, maxit, verbose, L1, L2, threads, w) {
.Cal... |
4034d0bfcfc567226c022b06fe4f1b8c9f45523da9a3578137ce709f4ca586ef | R | 400 | 9 | cmdargs <- c("-m","mask.nii.gz", "--set1", "setfilenames1.txt",
"--set2", "setfilenames2.txt",
"--setlabels1", "setlabels1.csv",
"--setlabels2", "setlabels2.csv",
"--model", "lmermodel.R",
"--output", "lmer.notprewhitened/m.",
... |
6efacc8aec95052d80d7f9d7a42234c3ed5dc7a3058e0a46abfee0121a13ae27 | R | 402 | 9 | cmdargs <- c("-m","oneslice_4mm.nii.gz", "--set1", "setfilenames1.txt",
"--set2", "setfilenames2.txt",
"--setlabels1", "setlabels1.csv",
"--setlabels2", "setlabels2.csv",
"--model", "fmrimodel.R",
"--output", "slurmdata/sim.",
... |
b811e63bab40ddfff25a531dc8aaf9014995100856cfa244ff29bfad8ecf06e2 | R | 409 | 17 | #installpackages
install.packages("ggfortify")
library(ggfortify)
install.packages("ggplot2")
library(ggplot2)
#import CSV file
data <- read.csv("FPKM Counts_brainreads.csv")
#run PCA on imported CSV file
pca <- prcomp(data)
autoplot(pca)
#transpose the data
data1 <- t(data)
#run and plot the transposed d... |
5691e266347e9627d3a586856c5e546258405b8f33da8d3c840860622668f197 | R | 419 | 9 | cmdargs <- c("-m","mask.nii.gz", "--set1", "setfilenamesPrewhitened1.txt",
"--set2", "setfilenamesPrewhitened2.txt",
"--setlabels1", "setlabels1.csv",
"--setlabels2", "setlabels2.csv",
"--model", "lmermodel.R",
"--output", "lmer.... |
561b8ec65d0d8eb3d8ac5b9232489c55471889334b731e360ad7020fd3773018 | R | 421 | 11 | # install packages
install.packages("BRETIGEA")
# load data
expression_data <- args[1]
out_dir <- args[2]
own_marker_expression <- read.table(expression_data)
# run analysis and save data
ct_res = brainCells(own_marker_expression, nMarker = 50, species="human", celltypes = c("ast", "end", "mic", "neu", "oli", "opc"),... |
9c8ac8b505d55f00da87fbc7f3dbb26003fb6e490861d6d4626a6d9ed7a907fc | R | 421 | 17 | #' The 297 discrete colours available across different RColorBrewer palettes.
#'
#' The first 24 were selected and ordered carefully (with qualitative data in mind) and the rest was taken and shuffled.
#'
#' @docType data
#'
#' @usage data(discrete_colours)
#'
#' @format A character vector.
#'
#' @keywords datasets
#... |
ce862bbcfe3f3063af8015d87bf84b1acc6d357b7e90ec61d8eb6a00384b7889 | R | 423 | 9 | data_all = read.table("kmer_histo.all.txt")
data_norm = read.table("kmer_histo.NormMaxKCov50.txt")
log_data_all = cbind(data_all[,1], log(data_all[,2]+1))
log_data_norm = cbind(data_norm[,1], log(data_norm[,2]+1))
plot(log_data_norm, col='green', xlim=c(0,200), xlab="kmer occurrence count", ylab="log(number of unique... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.