sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
74793a21d25c2352661a51e4530d6db491d5c2acd9762fd3138b045835a0d201 | Python | 164,940 | 4,043 | """
Module for working with sequencing data.
This module forms the first part of the Hi-C pipeline after externally
mapping FASTQ sequencing reads to a reference genome with a read aligner
such as Bowtie 2.
Facilities for loading and filtering reads from SAM/BAM files are
provided in the :class:`~Reads` class.
To pa... |
238b52030f0d2aceed2ad8425c95cc965f8fdb05bcbab1e7a0eadad0008eea91 | Python | 169,965 | 3,839 | """
Ring attractor simulation. Analysis library (:mod:`lib_analysis`)
=================================================================
.. currentmodule:: lib_analysis
:platform: Linux
:synopsis: module for analyzing simulated data from the ring attractor network.
.. moduleauthor:: Jose M. Esnaola-Acebes <josem... |
8d54a2c1c1c0ae90962a17bebe8736b1e44b199bfe2d1657cd18103975ab386a | Python | 172,484 | 3,849 | # -*- coding: utf-8 -*-
# from matplotlib.text import Text
import os
import re
import importlib
import matplotlib.pyplot as plt
from matplotlib import lines
import matplotlib.transforms as mtransforms
from matplotlib import ticker as mplticker
from matplotlib import patches
from matplotlib.font_manager import FontPrope... |
74e88537aec651cd915cfd155cf8e4efbe7ce11c93d04e55d224c5b85deb8995 | Python | 175,723 | 5,128 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
4d43263a1074d7aa1147e7705ea0f5525de63fbd0f08460c9cb118c3d037dbcb | Python | 180,614 | 4,530 | # Copyright (C) CVAT.ai Corporation
#
# SPDX-License-Identifier: MIT
import csv
import json
import math
from copy import deepcopy
from http import HTTPStatus
from io import BytesIO, StringIO
from pathlib import Path
from typing import Any
from zipfile import ZipFile
import numpy as np
import pytest
from cvat_sdk.core... |
a0bc8d675a416a20658fdcc5ccb15177f3fb27c32445c8038ac8c4c5947fe0c6 | Python | 198,292 | 8,205 | # This file is automatically generated by tools/idna-data
# vim: set fileencoding=utf-8 :
"""IDNA Mapping Table from UTS46."""
__version__ = "11.0.0"
def _seg_0():
return [
(0x0, '3'),
(0x1, '3'),
(0x2, '3'),
(0x3, '3'),
(0x4, '3'),
(0x5, '3'),
(0x6, '3'),
(0x7, '3'),
(0x8, '3... |
c66381682c15b8f6948771c37f7dee2c5599afa4af1773c450c0960d4d7e3a7d | Python | 198,918 | 5,411 | import argparse
import logging
import os
import os.path
import textwrap
import shutil
import tempfile
import warnings
# configure logging
logger = logging.getLogger(__name__)
def fanc_parser():
usage = "fanc <command> [options]\n\n"
command_descriptions = dict()
for name, function in globals().items():
... |
005d4c8e98640798b8ec6eca9b185d97220a18942a1075a03fe65cabe53dcbd8 | Python | 200,000 | 6,039 | import matplotlib
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib import gridspec
import matplotlib.patches as mpatches
from sklearn import datasets, linear_model
import parmap
import numpy as np
import os
import pickle
from sklearn.decomposition import PCA
import pycorrelate
from tqdm impor... |
2966fe398dadd82cf0decf6ec7e007dac511c34b5c6af18b9fa5e4a0c4422c51 | Python | 200,000 | 4,279 | # -*- coding: utf-8 -*-
"""Module for reading, writing and validating SNIRF files.
SNIRF files are HDF5 files designed to facilitate the sharing of near-infrared
spectrocopy data. Their specification is defined at https://github.com/fNIRS/snirf.
This library wraps each HDF5 Group and offers a Pythonic interface on li... |
2b6e36fe9f3cb07aa1d9d5fafdef39fbfa615b5f043de9c0265bb4050f857e64 | Python | 200,000 | 5,858 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 10 14:25:40 2021
@author: ColinVDB
BIDS MANAGER GUI
"""
# import output_redirection_tools # KEEP ME !!!
# import time
import sys
import os
from os.path import join as pjoin
from os.path import exists as pexists
from dicom2bids import *
import logg... |
3e0271aa1dd4cc771d814b84d076a9ec1870fc942d4cdb38cee61e31628c8ebc | Python | 200,000 | 4,428 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
3febf4aa3f9125af5b8fd9a582239205b837a78aa347b4be804b2394cbabbc1c | Python | 200,000 | 5,444 | """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... |
84074d8ad0e5ae1224be678fad47be4fbc552fa4294431c56ba169dcd870b863 | Python | 200,000 | 4,129 | # -*- coding: utf-8 -*-
"""
Created on Fri Feb 7 18:14:28 2020
still working on it...
@author: Maxsc
"""
import time
import numpy as np
import pandas as pd
from . import statannot
from matplotlib import pyplot as plt
import matplotlib
from matplotlib.patches import Polygon
from matplotlib.colors import LinearSegmente... |
895f06cdb7548bd49989922020981c5041ac9419d71333c1c0dc6b161a056a16 | Python | 200,000 | 5,302 | #-*- coding: utf-8 -*-
# module pyparsing.py
#
# Copyright (c) 2003-2019 Paul T. McGuire
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation... |
9f7edd5462ca985ed1c328fbae69eb926b4901c6a2ac6602402412c5efbb3ad2 | Python | 200,000 | 5,385 | """
Module for working with genomic data.
This module provides classes and functions to work with objects in the context
of the genome.
:class:`~Chromosome`, :class:`~Genome`, and :class:`~GenomicRegion` simplify
working with reference sequence data by providing easy access and many convenience
functions.
Examples:
... |
a66b8fca65edc5af817bbe89d5f4ecfaa575294e723b66cfe9d2fb466fc15de4 | Python | 200,000 | 4,555 | # -*- coding: utf-8 -*-
"""Module for reading, writing and validating SNIRF files.
SNIRF files are HDF5 files designed to facilitate the sharing of near-infrared
spectrocopy data. Their specification is defined at https://github.com/fNIRS/snirf.
This library wraps each HDF5 Group and offers a Pythonic interface on li... |
bed1c5fb2a62fb932c953b83940bfa3bef429dc47afed0f62d3b57680e03ad58 | Python | 200,000 | 4,832 | # Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditio... |
cc1de65be3922361d9d0eeb50f1c1f4cb50b5499052432cd01d5b2af359eebb6 | Python | 200,000 | 5,048 | # Copyright (C) 2022 Intel Corporation
# Copyright (C) CVAT.ai Corporation
#
# SPDX-License-Identifier: MIT
import io
import itertools
import json
import operator
import os
import os.path as osp
import re
import zipfile
from collections.abc import Generator, Iterable, Sequence
from copy import deepcopy
from datetime i... |
e06c9b3c432d472e206fb8f638011cb842182c7e09701e61bbfe462975edfe23 | Python | 200,000 | 4,083 | # -*- coding: utf-8 -*-
"""
Created on Fri Feb 7 18:14:28 2020
still working on it...
@author: Maxsc
"""
import time
import numpy as np
import pandas as pd
from . import statannot
from matplotlib import pyplot as plt
import matplotlib
import inspect
import os
import itertools
# for extracting informati... |
f9d79359502170b0f616ee2726fb9d5293dc4ec55e89223b0b0001a6111c9daa | Python | 200,000 | 5,671 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
fa6976ce0bb44e73c13c5d6f27c7ddf6d0675fc3e8df23937cf4ac0e3790df41 | Python | 200,000 | 4,820 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
9fc36117b95e6e200c32dccd8b339be06b35e52d50b0703dedf83fafb62c8f14 | Python | 200,004 | 4,895 | """
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... |
4b5905b6807963c28cef2d8040ba91ffe0fdba6f0f1278fe4615f7da6afbf3b8 | Python | 200,006 | 5,951 | # pylint: disable=C0302
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "... |
bcba946f6b03dbd775a3de97fb5c57e65c35c3dd77ce63db4680d1d08d672d2c | Python | 200,006 | 5,660 | #!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... |
0db886d5a550c6aa55b254a64f1a2eb4a708bb79ae071f043b599ae067b9d90a | Quarto | 167 | 6 | ---
title: Voluseg
---
🌟 Welcome to Voluseg, an open-source tool providing a pipeline for automatic volumetric cell segmentation from calcium imaging recordings.
|
363d5fa277d7ddb05ff89238748f76e61f7c4cd3ea1262b989f8f69271e7f374 | Quarto | 226 | 12 | ---
title: FAQ
---
### Frequently Asked Questions
<details>
<summary>What is Voluseg?</summary>
<p>
Voluseg is a pipeline for automatic volumetric cell segmentation from calcium imaging recordings.
</p>
</details>
|
5050ad3b88e2256682fac9db0ea42780e50c39109b2a6a645a455d4454605375 | Quarto | 875 | 35 | ---
title: Installation
---
### Prerequisites
In order to use Voluseg you need to have the following dependencies installed on your machine:
- Python >= 3.10
Registration uses [ANTsPy](https://github.com/ANTsX/ANTsPy), which is installed
automatically with Voluseg — no separate ANTs installation is needed.
It is r... |
e27bb37745e2b28fff96896d42d168e43c9adcf196ca2890dc6519f8b10afbb6 | Quarto | 1,635 | 41 | ---
title: Running on DANDI Hub
---
## DANDI Hub
Neuroscientists registered at [DANDI archive](https://dandiarchive.org/) can use the [DANDI Hub](https://www.dandiarchive.org/handbook/50_hub/) to interact with the data stored in the archive.
DANDI Hub is a JupyterHub instance in the cloud, free to use for exploratory ... |
a51bd09fa68be4d18a2f9f8242ac232654a4eaa683c00a48811bd84c358e9aff | Quarto | 2,101 | 77 | ---
title: Running from Container
---
You can easily run the Voluseg pipeline using a container. This is useful if you want to run the pipeline without having to install all the dependencies on your local machine.
## Using Docker
Pull the image from GHCR:
```bash
docker pull ghcr.io/mikarubi/voluseg/voluseg:latest
``... |
3318509396cc04f8e52b5342e84d966a9c0ef197afbe29622e0496c12fc948a0 | Quarto | 2,402 | 84 | ---
title: Running Voluseg Pipeline
---
## Pipeline Overview
The Voluseg pipeline consists of an initial setup of parameters followed by five consecutive steps:
1. Process volumes
2. Align volumes
3. Mask volumes
4. Detect cells
5. Clean cells
## Running a demo workflow
To get familiar with Voluseg, let's run a si... |
964de696d9d9946f9817376df9a020e392b147d7455d6f0557bf67b4e6a8df6e | Quarto | 2,543 | 89 | ---
title: Output Files Overview
---
This page describes the contents and purpose of output files and directories generated by the Voluseg pipeline.
---
### `parameters.json`
**Parameter dictionary**
* Loaded via:
```python
parameters = voluseg.load_parameters('parameters.json')
```
* Required as input to ... |
72e96ad78fc478652974b3e8e6508a3fef43c23f49e581483a332c699563dbc9 | Quarto | 2,632 | 70 | ---
title: Algorithm
---
## Algorithm Overview
> This algorithm extracts spatially and functionally distinct cellular components from whole-brain imaging data using constrained non-negative matrix factorization (NMF), optimized in parallel over overlapping 3D brain blocks.
### 1. Preprocessing
- Rigid-body registra... |
07949268af9d45baef752d9aafaa32fc0da87ce122fe1b75262ae2bb408712ce | Quarto | 3,409 | 72 | ---
title: Running on AWS Batch
---
Here we provide instructions for setting up your Voluseg service to run jobs in AWS Batch. First you will need to provision the base AWS Batch infrastructure using CDK. This includes IAM roles, VPC, Security Group, Batch Compute Environments and Batch Job Queues. Next you will need ... |
21384beb5898e6e7bb5d342da3a962bbc97028205be229d79407c5bfb2571184 | Quarto | 4,204 | 177 | ---
title: Pipeline Parameters
---
## Parameters dictionary
To run the Voluseg pipeline, you need to set up the parameters. The parameters are stored in a dictionary and can be modified to fit your specific needs. The parameters are used to control the behavior of the pipeline, such as the type of detrending, registra... |
b8c6b4e07b832e1ee36021a485fc9d2632d817373581fdc20ea6541c58e81911 | R | 28 | 3 | shinyUI(
uiOutput("ui")
)
|
5d81d64e27dc3e60ed8411381736fedc14e1aae195b3cd5731ebbd5335dd60ce | R | 54 | 4 | library(testthat)
library(liger)
test_check("liger")
|
9b555a75964316a5a43b6f25de6d52e5e8c1d3564690c411ddef73469d56908a | R | 55 | 3 | #' @importFrom magrittr %>%
#' @export
magrittr::`%>%`
|
dfc0ea01559f306356601dacd5a3f35f705fccef844c3ce15cd758a4bdd2df73 | R | 56 | 4 | library(testthat)
library(blotIt)
test_check("blotIt")
|
1a4394d0bb4b93fecf775bab741d968a31435a138f5d0bb304a21f673d530e62 | R | 192 | 10 | #' liger
#'
#' This package contains permutation-based gene set enrichment functionalities in R
#'
#' @name liger
#' @docType package
#'
#' @useDynLib liger
#' @importFrom Rcpp evalCpp
NULL |
389afe0588856b5900549b0e2bcab90c1c2a8a61f00d1d06cdc1bded872f6703 | R | 197 | 6 | #' Human Gene Ontology to HUGO Symbol list
#'
#' @format List with each entry as a Gene Ontology gene set
#'
#' @source \url{http://geneontology.org/docs/download-ontology/}
"org.Hs.GO2Symbol.list" |
26cab6a3b72d3fe352af6500432fcd987975b0ea96588ca655c4aed77bd18f83 | R | 251 | 11 | library("readxl")
a = read_excel("41587_2014_BFnbt2851_MOESM12_ESM.xls")
# xlsx files
b = read_excel("41587_2014_BFnbt2851_MOESM13_ESM.xls",skip=3)
head(a)
head(b)
c=merge(a,b,by=1)
writefile(c[c[,8]!="nd",c(7,8)], "fastUTR_mpra.txt", col.names=F)
|
7e2aab1cc8df1fd7c2ac545c175f4c9edd11a179772ef80fe8c0b8c131c0767d | R | 288 | 5 | utils::globalVariables(c(
"N", "n", "plot_extra_yaxis", "proportion_success", "sd", "sf_change", "success_change",
"tag", "x", "x_axis_raw", "x_failure", "x_success", "xend", "y", "y_failure", "y_success",
"failure_change", "y_top_start", "y_top_end", "y_bot_start", "y_bot_end"
))
|
e4e3297a84d532a7a005ceb6a716a2413d08e7e1bda802ba66755260bb8ee9ae | R | 294 | 9 | #' A simulated spatial transcriptomics dataset
#'
#' A toy simulated spatial transcriptomics dataset, used to demonstrate the
#' functionality and usage of Magellan.
#'
#' @docType data
#' @usage data(demo)
#' @format a Seurat object with 22,127 genes measured in 100 spatial barcodes
"demo" |
18a12edfb5fea1dbd1f268e04b12b6946b6cb80b7e786f3eeda10b3dafc0c0b9 | R | 297 | 10 |
file <- "/Volumes/Jellyfish/Dropbox/Manuscripts/_ Under Revision/Artificial intelligence maps giant kelp forests from satellite imagery/Annotations Data/Final Data/test/via_region_data.json"
readLines(file)
library(stringr)
str_count(readLines(file), "kelp")
# Test 537
# Train: 2368
# Val: 440 |
d992fa1c8ba152758c180c803ee77317c7d7854b60d8360d94924fb3d9f7a44d | R | 304 | 10 | a=readme("cxcl2_deltaA.wig",skip=2,header=F, sep="\t")
c=readme("cxcl2_deltaC.wig",skip=2,header=F)
g=readme("cxcl2_deltaG.wig",skip=2,header=F)
u=readme("cxcl2_deltaU.wig",skip=2,header=F)
all=cbind(a,c[,2],g[,2],u[,2])
colnames(all)=c("pos","A","C","G","T")
all
writefile(all,"mutagenesis_MPRA.txt")
|
8a21b69584f7a5aaa64e4b8579b7014c0623c3b53f0b1d749dd8b4510c26ad10 | R | 315 | 14 |
library(optparse)
option_list <- list(
make_option("--infile",
type = "character")
)
args <- parse_args(OptionParser(option_list = option_list))
infile <- args[["infile"]]
Sys.setenv(RSTUDIO_PANDOC="/usr/lib/rstudio-server/bin/pandoc")
rmarkdown::render(infile, output_format = 'pdf_document')
|
9e3eac57e9c93f18c1f00c9c9f37421b973ba723e357733f28b7f873edcb9719 | R | 352 | 20 | ---
title: "comment-utiliser-mon-package"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{comment-utiliser-mon-package}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
``... |
110032f59c56f1d1cb24f1037e1f664b185e6fd49b46b6d2b0642c987ae37acf | R | 355 | 18 | library("shiny")
library("rJava")
library("rcdk")
library("ChemmineR")
library("DT")
library("rapportools")
library("shinyjs")
library("cluster")
require("mlbench")
library("drat")
library("mxnet")
library("EBImage")
library("pbapply")
library("neuralnet")
library("RColorBrewer")
library("caret")
librar... |
d1d544584feff47abdb1e1a5426187b5a55367d7f4d40cfd5563fa36edb2b31b | R | 355 | 7 |
a=read.table('rank.txt',sep='\t',header=T,row.names=1)
a=as.matrix(a)
library('gplots')
pdf('HEAT.pdf','w')
heatmap.2(a,Rowv=F,Colv=F, dendrogram='none',col=colorpanel(256, low="Blue", high="Red", mid="grey90"), scale="row", key=TRUE, keysize=1, symkey=FALSE, densadj = 0.1, density.info="none", trace="none",margin=c(2... |
7a5ce09b7974dd7a6351a9c0406fc37c6ca950b18bfc8c3f381fcca324a7c913 | R | 368 | 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... |
b059c6ea7f0c35f84ddfcd2fc0e85f9656afbaf00548f20d58f9f2d114be35ea | R | 374 | 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... |
c3eb993b3546d99c3beb184049afd251229f32091914fde89a92886d81ce15fd | R | 375 | 11 | # Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
gseaRandCore <- function(sset, eso, nsamples) {
.Call('_liger_gseaRandCore', PACKAGE = 'liger', sset, eso, nsamples)
}
gseaBulkCore <- function(setm, eso, nsamples) {
.Call('_liger_gse... |
4095b38e9232e405cd0421fc299e76db33c7952efba13165e7ad5dc9edf7dc39 | R | 396 | 12 | find_peaks <- function (x, m = 3){
shape <- diff(sign(diff(x, na.pad = FALSE)))
pks <- sapply(which(shape < 0), FUN = function(i){
z <- i - m + 1
z <- ifelse(z > 0, z, 1)
w <- i + m + 1
w <- ifelse(w < length(x), w, length(x))
if(all(x[c(z : i, (i + 2) : w)] <= x[i + 1])) retu... |
f2bd30c6c1be27e0bd62b025f746ea763df10df8c16f9acc40d5e7f00146657e | R | 402 | 13 | library(psych)
a=readme("fastUTR_mpra_with_predictions.txt")
idx = grep("Ref",colnames(a))
a=a[,idx]
head(a)
a$Ref_GC = NULL
colnames(a) = gsub("log2FoldChange_Ref_","", colnames(a))
head(a)
png("all_spearman_Ref.png",width=800,height=800,type="cairo") #Figure S7g
pairs.panels(a, method = "spearman", hist.col = "#00A... |
486929e81ec9efd135856427ab94fca0e0a1195d03bdebce0097e5b788111f88 | R | 413 | 15 | # Create some magick
LOM <- image_read(here("figs", "overlay_lesion_acute_mricron.png"))
legend <- image_read(here("figs", "legend_mricron.PNG"))
legend_inset <- image_scale(legend, "80%x")
LOM_with_legend <- LOM %>% image_composite(
legend_inset,
operator = "Atop",
gravit = "SouthWest",
offset = "... |
97f6991e573b607c74b0079c108f07fa8f76581e04d40a2d1697964d62755ab7 | R | 477 | 20 | #' Tidy GWAS
#'
#' @param GWAS df. RBD GWAS dataframe.
#'
#' @return Tidied RBD GWAS dataframe with appropriately named columns.
#'
tidy_GWAS <- function(GWAS){
GWAS_tidy <-
GWAS %>%
as_tibble() %>%
dplyr::mutate(GWAS = "RBD",
Al1 = stringr::str_to_upper(A1),
Al2... |
ea5212be02a8050bd6215f379bdec0a50ccbb1b64c79faa340c544e621ba9320 | R | 489 | 24 |
library(optparse)
library(stringr)
option_list <- list(
make_option("--infile",
type = "character")
)
args <- parse_args(OptionParser(option_list = option_list))
infile <- args[["infile"]]
if (is.null(infile)){
stop("No input file provided")
}
if (!str_detect(infile, ".Rmd$")) {
stop("Input ... |
79d95329857051857010b36cfdfdca12ef572a20fbe309d843ddc844b86df711 | R | 491 | 11 | testthat::test_that("Able to generate dataset for testing", {
expect_no_error(generate_non_proportional_dataset())
expect_no_error(generate_proportional_dataset())
expect_no_error(generate_deltadelta_dataset())
})
testthat::test_that("Able to generate dataset for testing with parameters", {
expect_no_error(gen... |
70dd329d6a88dbe37bb6f3cdbcfbed571456c8390db7eafb68e086ad3909b6ad | R | 506 | 21 | library(LSD)
a=read.delim("all_HLs_mouse_PC1.txt")
b=read.delim("all_HLs_human_PC1.txt")
c=read.delim("1to1_orthologs_expression.txt",F)
c=c[,1:2]
colnames(c)=c("humangene","mousegene")
c=merge(c,b,by=1)
c=merge(c,a,by.x=2,by.y=1)
"Sample size:"
nrow(c)
"Pearson"
cor(c$human_PC1, c$mouse_PC1)
"Spearman"
cor(c$human_... |
a756bd543cfb490cb4bb4c152982f843f892636c5c6225bbe6c8bab79c689292 | R | 528 | 19 | library(ggplot2)
library(glmnet)
library(LSD)
a=read.csv("experimentResults.csv")
round(a,3)
results = data.frame(tests = c("BC3MS vs Saluki human","BeEM vs Saluki human","BC3MSD vs Saluki mouse"), pvals =
c(t.test(a[,1], a[,3], paired=T)$p.value,
t.test(a[,2], a[,3], paired=T)$p.value,
t.test(a[,4], a[,5], paired=T)... |
30b98589f9f46d5cff6a6444c6a3426b46f278bc8c5f47ef2905474a27bb1f34 | R | 531 | 22 | #Desmosomal connectome paper R - code to generate dotprops source data
#Gaspar Jekely
source("code/Packages_and_Connection.R")
MUS = nlapply(
read.neurons.catmaid(
"^muscle$",
pid=11
), function(x) smooth_neuron(
x, sigma=6000)
)
# convert neuron representations to "dotprops" ie point-vector fo... |
05e3fd1d5ce86ad33cf6070193bfc4df7e1798bb39fedda143db848c518b811c | R | 542 | 22 | ## Get example dataset
exampleWB <- system.file(
"extdata", "INFdata_WB_wide.csv",
package = "blotIt"
)
## read in example data by use of 'readWide()'
exampleData <- readWide(exampleWB, description = seq_len(3))
## execute alignReplicates
out <- alignReplicates(
data = exampleData,
model = "yi / sj",
errorM... |
251435d867d178a4fc8eafadcb8379d68be1e83a271272ae9bb38804b7a5e834 | R | 545 | 20 |
file_ext<-function(x){
pos <- regexpr("\\.([[:alnum:]]+)$", x)
ifelse(pos > -1L, substring(x, pos + 1L), "")
}
#' Get images from directory
#'
#' Find dimensions of stitched image from number of tiles.
#' @param input a list of file names.
#' @keywords grid
#' @export
#' @examples
#' get.images('/Volumes/Seag... |
204769506444b3aab938460a790d2d69a0c24fa4a30d2a435a6dae486229e8ea | R | 554 | 26 | #' Load Trained Models
#'
#' @param x A subset from [list_trained_models].
#'
#' @return A (list of) Keras model.
#' @export
#'
#' @examples
#' z <- list_trained_models() %>%
#' head(1) %>%
#' load_trained_model()
#' z
load_trained_model <- function(x) {
stopifnot(is.data.frame(x), "ModelFile" %in% colnames(x))
... |
520b47d37e59773010f528cee38e24b319a03516d4cbdccb628b4480d6cbc0bb | R | 559 | 16 | a = read.csv("AU-Rich-Elements/sequence_level_data_Jurkat.csv")
b = read.csv("AU-Rich-Elements/sequence_level_data_Beas2B.csv")
nrow(a)
nrow(b)
a = a[complete.cases(a$ratios_T4T0_GC_resid),c("seq","ratios_T4T0_GC_resid")]
b = b[complete.cases(b$ratios_T4T0_GC_resid),c("seq","ratios_T4T0_GC_resid")]
colnames(a)[2]="Sta... |
55f7559be2bc700bf31db302ac71e7fbebf1d3ee3e722276e56f9ebeca29ab40 | R | 564 | 19 | WD = getwd( )
setwd(WD)
library(coloc)
CHR = "8"
FID = "201"
data <- read.csv(file=paste(WD,"/data/Chr_",CHR,"/BWAS_",FID,".csv",sep=""),head=TRUE,sep=",")
BWAS <- data.frame(data)
data <- read.csv(file=paste(WD,"/data/Chr_",CHR,"/GWAS.csv",sep=""),head=TRUE,sep=",")
GWAS <- data.frame(data)
gwas_n <- 11259
bwas_n ... |
f56eae01d270f2ceb80340b8ee35cfdeed3f96f834e42fe4241561a0d5e94bdb | R | 610 | 20 | ## Statistical test functions
#-------------------------------------------------------------------------
# Two-way ANOVA + Tukey
#-------------------------------------------------------------------------
anova_tukey <- function(test_col, df){
# # TROUBLE
# test_col <- "Observed"
# df = ... |
0e55a0d2a77684f52f107a05484b1b87371c2c28b5efb0a57abe809140db30da | R | 656 | 23 | #####################################################'
#'
#' The files in this package are all labelled by numbers.
#'
#' e.g.
#' 000_README.R
#'
#' The numbers represent an imaginary folder that the R scripts are located in.
#' This is done as a workaround the structure of R packages.
#'
#' This file serves to give an... |
5e20fbcd86778630e78cc91ff51c1fbb9f3817e93c24eadc385d7eeb4da76309 | R | 676 | 19 | library(gdata)
prepare = function(x){
a = read.csv(paste0("AU-Rich-Elements/sequence_level_data_",x,".csv"))
b = a[a$iscontrol!=1 & complete.cases(a[,c("effect_size_T4T0","effect_size_T4T0_GC_resid")]),
c("region","seq","effect_size_T4T0_GC_resid")]
a = a[a$iscontrol==1,c("region","seq"... |
0ccbbeea17f99700d90915d5e4e88e1c97ea80dd105306c4b713d7353d615ff0 | R | 719 | 23 | # ----------------------------------------------------------------------------
# render_pdf.R
# Antoine Beauchamp
#
# Render .pdf file from .Rmd file
# Packages -------------------------------------------------------------------
suppressPackageStartupMessages(library(optparse))
# Command line arguments -------------... |
e2015296b7bfcb0824a0f615d59f582efa2ebc6cddd37096dfd325f99cdcbbc0 | R | 726 | 20 | #' Function to perform ALRA on a Seurat2 object
#'
#' This function performs ALRA on the "data" slot in a given Seurat object,
#' does the neccessary pre- and post-processing to fit with the object, use
#' the ALRA imputed data to REPLACE the "data" slot in the Seurat object, and
#' returns that updated Seurat obje... |
5ac856a14af99e11fd9adc11646ea48e84066c96581857edd4dcd08a2e1284b2 | R | 739 | 34 | #' Output a vector of colours based on the ggplot colour scheme
#'
#' This function takes as input the number of colours the user would like, and
#' outputs a vector of colours in the ggplot colour scheme.
#'
#' @param g the number of colours to be generated.
#'
#' @return a vector with the names of the colours.
#' @ex... |
8f1b4dd4e8203d815646945cd418cd3c94c1aa59d36758d3908f4c0675bbfd2f | R | 740 | 16 | library(ggplot2)
library(here)
vis_colors <- c("#ECEA13","#00ffff","#8bc53f","#ec1c24","#223f99","#dcd0ff","#d4a537")
quant_cluster <- read.csv(here("Hiplex_QuantificationTable_with_clusters.csv"))
upper <- max(quant_cluster$Y)
lower <- min(quant_cluster$Y)
ggplot(quant_cluster,aes(x=X,y=Y,colour=factor(Cluster))) + ... |
d215e7de5f89ed75d6efdb30b9652289285e8f3df498d6bbf8b5c8522759356c | R | 776 | 24 | library(tidyverse)
library(lme4)
rdm.data = read.csv('results/csv/RDM_values.csv')
print("Difference between kid1 group and adults?")
data = rdm.data %>% filter(group=="kid1" | group=="adult")
dist.lm = lm(dist ~ group, data=data)
print(summary(dist.lm))
print("Difference between kid2 group and adults?")
data = rdm.... |
68b5cfce1518fea9f1a94a55f78a1fb5a09198545b297120efff6c181fc384ec | R | 782 | 26 | source('scRef.R')
exp_sc_mat=read.table('Zeisel_exp_sc_mat.txt',header=T,row.names=1,'\t')
exp_ref_mat=read.table('Reference_expression.txt',header=T,row.names=1,sep='\t')
#KENDALL
out=.get_cor(exp_sc_mat, exp_ref_mat, method='kendall',CPU=4, print_step=10)
tag=.get_tag_max(out)
cat('kendall finished!!!')
wr... |
0b8e9b3ea7f71a5afda9e15e573c6a5ce09a49ddb17f150ad0a3ece333dc9009 | R | 787 | 30 | #' Tidy Modeling Result
#'
#' @param x A result `tibble` from either [modeling_and_fitting] or [batch_modeling_and_fitting].
#'
#' @return a `tibble`
#' @export
tidy <- function(x) {
stopifnot(!is.null(x$performance))
dt <- dplyr::bind_rows(x$performance)
dt2 <- dplyr::bind_rows(x$key_params)
x %>%
dplyr::s... |
1017f1ac771c324996bbdbc2097b2a8b1792aca600d5c96869b8678286ff8fd0 | R | 788 | 29 | #' SourceAll
#'
#'
#' @name SourceAll
#'
#' @description will source every functions located in the Sources folder if it contains functions
#' will better work with a project created with make_project function
#'
#' @examples
#'
#' @import purrr
#'
#' @export
SourceAll <- function()
{if(nrow(data.frame(... |
6a0b8f6efa191686968b03607575312faa8deaf8f168c6133d58bab97e7b41a4 | R | 808 | 34 | ---
title: "Sample Datasets"
output: rmarkdown::html_vignette
description: |
Loading in of sample datasets for dabestr.
vignette: >
%\VignetteIndexEntry{Sample Datasets}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
co... |
0919f6864b2a3e580e36b76f7fdb508b7d852543229abae16e5a8d48d0b210d8 | R | 811 | 21 | A <- b_nk_example
labels <- labels_example
test_that("alra works", {
# Library and log normalize the data
A_norm <- normalize_data(A)
# Choose k.
k_choice <- choose_k(A_norm)
# run ALPRA
A_norm_completed <- alra(A_norm,k=k_choice$k)[[3]]
#NCAM1 should be expressed in all NK cells, but is only express... |
96f55367dcd72417d7d877be1f5a95e3871ad606647d8817e334e4ad7e35746f | R | 819 | 30 | #' Estimate the parameters of a Beta distribution
#'
#' This function estimates the two parameters of the Beta distribution, alpha
#' and beta, given a vector of proportions. It uses the method of moments to
#' do this.
#'
#' @param x a vector of proportions.
#'
#' @return a list object with the estimate of alpha in \c... |
95e2b730c5c6de5a612f475ca64112fc76ce7f9313d545ccc077fb81dd48bb81 | R | 820 | 36 | #' save_pheatmap
#'
#'
#' @name save_pheatmap
#'
#' @param x heatmap name
#' @param filename directory and name with extension (pdf or png)
#' @param width,height the width and height of the graphics region in inches
#'
#'
#' @description save pheatmap
#' @import rstatix
#' @import pheatmap
#' @importFrom ... |
e8bda3599d4ff055d4168029d1af5bd26781aaf5a7f86d69b1ad8fdb85575748 | R | 820 | 30 | .onAttach<-function(...){
packageStartupMessage("WholeBrain (version 0.1.35) \"Thurstone\" \n by Daniel Fürth, 2018, by using this software you agree to the EULA")
get_os <- function(){
sysinf <- Sys.info()
if (!is.null(sysinf)){
os <- sysinf['sysname']
if (os == 'Darwin')
os <- "o... |
e90e9c4cee762ded8ec66a7cb9299817740ee0c25f4eff7b744b5175cf196d73 | R | 832 | 20 |
## BART: Bayesian Additive Regression Trees
## Copyright (C) 2019 Rodney Sparapani
## 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 2 of the License, or
## (at your option) an... |
4796fafc99af7fcbad884110df4d0e37a6d6565ecfa6a841e12cffd71912aeb2 | R | 841 | 34 |
# readWide() -------------------------------------------------------------
test_that("readWide works properly", {
simDataWideFile <- system.file(
"extdata", "simDataWide.csv",
package = "blotIt"
)
simDataWide <- read.csv(simDataWideFile)
expect_equal(
length(
uniq... |
54f489a40785a1f879670469532e17adf74ed4e2573c4f634c5730a060e5caa5 | R | 844 | 22 | # richDAVID() deprecation (SPEC-RICHR-002 REQ-025 / AC-025). No network is used:
# the call stops at the RDAVIDWebService check, after the deprecation warning.
test_that("richDAVID() warns that it is deprecated before the package-missing error", {
skip_if(requireNamespace("RDAVIDWebService", quietly = TRUE),
... |
d1427eae6c8c50affac5adf3acfb1a86706c313241859defc84c837fc310cdb8 | R | 855 | 21 |
## BART: Bayesian Additive Regression Trees
## Copyright (C) 2017 Robert McCulloch and Rodney Sparapani
## 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 2 of the License, or
#... |
f951f8c658851fc78a875578696e15439c5b4217f2b231d2e02702d169eaf81c | R | 861 | 21 |
## BART: Bayesian Additive Regression Trees
## Copyright (C) 2017 Robert McCulloch and Rodney Sparapani
## 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 2 of the License, or
#... |
5f9a4ae634bc46d71b10fc38566f9a006db9a7526a075ec39146fbda26b91858 | R | 863 | 22 | # Load in libraries
library(here)
library(tidyverse)
# load in data
dat_viral <- read.csv(here("Full_Viral_Concat.csv"))#read.csv(here("Viral distributions.csv"))
dat_viral %>% select(-X.2,-X.1) -> dat_viral
dat_genes <- read.csv(here("Full_Allen_Concat_results.csv"))
dat_genes %>% select(-X.2,-X.1) -> dat_genes
fo... |
62e5029b767c9e494adffca461b08863d6ab5169e7d747e09fe85949811d1b29 | R | 877 | 25 | library(ggplot2)
library(glmnet)
library(LSD)
a=read.csv("experimentResults_ablations.csv")
round(a,3)
results = data.frame(tests = c("S vs SCs human","SC vs SCs human","Ss vs SCs human",
"S vs SCs mouse","SC vs SCs mouse","Ss vs SCs mouse"), pvals =
c(t.test(a[,1], a[,4], paired=T,alternative='less')$p.value,
t.test... |
f23aa8e8c7ab77699bf1b7a40bff2abcc2616b749f6e9478024c2b6f04e8256d | R | 897 | 21 |
## BART: Bayesian Additive Regression Trees
## Copyright (C) 2017-2018 Robert McCulloch, Rodney Sparapani
## and Robert Gramacy
## 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 F... |
55dfc81ab1c65c93ec2b47d0928914663cb356fc3fe2ae6753bab4fe5c935861 | R | 912 | 33 | # ----------------------------------------------------------------------------
# extract_code.R
# Antoine Beauchamp
#
# Extract R code from .Rmd file
# Packages -------------------------------------------------------------------
suppressPackageStartupMessages(library(optparse))
# Command line arguments -------------... |
7f4c4c94444ece8f60986e5082ad3d0696b8bfb5800357ec160cb34f7aa42629 | R | 913 | 40 |
library(tidyverse)
library(ggplot2)
library(qdapTools)
library("ggpubr")
DepMapPath = "F:/DepMap/"
dataFolder = "C:/Work/MatlabCode/projects/SingleCellModeling/SingleCellModeling/data/"
d = read_csv(paste0(DepMapPath, "CCLE_expression_full.csv"))
dim(d)#1377 52055
#transpose
ds = as_tibble(cbind(gene = names(d)[-1]... |
4445893ca6ce51468c068f3a7d8d9379795e0b44e9c33f2d84ffaa4f3950a2b9 | R | 925 | 17 | library(CHIPIN)
setwd("/Users/szhang32/Desktop/INTACT5/CHPIN_normalization")
RPKM <- "/Users/szhang32/Desktop/public_RNA_seq/RiboTag_MSN/D1_D2_cuffdiff/CHIPIN_in_gene_expression.txt"
organism <- 'mm10'
#### using RPKM values with CPM normalized bigwig
## H3K4me3
path_to_bw <- c("/Users/szhang32/Desktop/Dropbox/INTAC... |
dd4b5c1997a3559c45f944b8e226a8a4e3939a3b7b9e19f4c73ae61c616f7c4c | R | 934 | 22 |
## BART: Bayesian Additive Regression Trees
## Copyright (C) 2017-2018 Robert McCulloch, Rodney Sparapani
## and Robert Gramacy
## 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 F... |
1176ccc75b4389d98fcc56a6103ef79b7e0bef16a4342f8aa54c9610ddcbecde | R | 937 | 27 | library(LSD)
getvals <- function(dir, pattern, filter, celltype){
files = list.files(path=dir, pattern=paste0('^',pattern), full.names=T, recursive=T)
files = files[grep(filter, files)]
names = read.delim(paste0(celltype,".names.txt"),F)
say(files)
table <- as.data.frame(do.call("rbind", lapply(fil... |
ce3a8a00a45bacdcdee7bf70414e0b24f292c8345b8e382e8cd272bc4130cc41 | R | 938 | 22 |
## BART: Bayesian Additive Regression Trees
## Copyright (C) 2017-2018 Robert McCulloch, Rodney Sparapani
## and Robert Gramacy
## 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 F... |
0e523fe542041171f9a70e6dc6f5930893dcd23df07f902f86ee8c6c6e47bb87 | R | 969 | 33 | library(tidyverse)
library(lme4)
source("scripts/R/ReadDataMTurk.R")
### statistics analysis of drawing style ###
style.data = read.csv('results/csv/drawing-style-data-70.csv')
# layer 0 to 6
for (l in 0:6) {
print("Current layer is: ")
print(l)
print("Scribbling vs. completion")
data = style.data %... |
74d18389b51b69cd41d794d9c814c3d8d657c8231a37c01091dc873df908f056 | R | 981 | 40 | library(RColorBrewer)
library(gplots)
library(circlize)
# The mtcars dataset:
#mtgat 300tpgs
csv <- read.csv("./js_value_mat.csv") # for graphene
#csv <- read.csv("./js_value_mat_gwas.csv") # for gwas
mat<- data.frame(csv[-1])
mat <- as.matrix(mat)
rownames(mat)<-t(csv[1])
mat <- -log(mat, 10)
mat <- sca... |
39a9a3a37a1aef430dc4b4566af33dde7c84af519092340472eff46f6de2aa03 | R | 1,008 | 28 | library(R.matlab)
library(tidyverse)
library(ggplot2)
library(ggpubr)
library(Seurat)
library(Matrix)
#This code expects you to have ~48 GB of RAM
setwd("C:/Work/MatlabCode/projects/HMASandbox/HMA_Sandbox/Single-cell Modeling")
UMICounts = readRDS("D:/SingleCellModeling/LC3/GSE131907_Lung_Cancer_raw_UMI_matrix.rds") ... |
ff7fe4e8fbb20dc0070609a5c1755f363e18d7af5a5ad67a8c66c588e265b2b2 | R | 1,033 | 36 | a=read.table('TAG.txt',sep='\t',header=T)
b=read.table('../../Habib_exp_sc_mat_cluster_original.txt',header=T,sep='\t')
c=read.table('../../Habib_exp_sc_mat_cluster_merged.txt',header=T,sep='\t')
library('cidr')
library('NMI')
a[,2]=as.character(a[,2])
a[which(a[,2]=='Myelinating.Oligodendrocytes'),2]='Oligodendroc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.