sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
739c48b84775c59bc81914d2ca494dbc80255418c3f0c45b3218b5c4de201abe | Quarto | 15,439 | 440 | ---
title: Canvas
description: "Examples of using the Canvas object"
jupyter: python3
execute:
daemon: false
---
The [](`~mn.Canvas`) object can be used to configure different render settings, camera, frame objects and views to render images and animations. The [](`~molecularnodes.Canvas.snapshot`) and [](`~molecula... |
c7542f8dc883ca1183f4db65cfbdeef66e3731a93678cd1cda47d034e9f07252 | Quarto | 20,716 | 161 | ---
title: Blender
description: Learnings, quirks and gotchas for programming in Blender.
---
## Props and GUI
- `bpy.props` have an implicit `name` attribute. (It is ok to define it explicitly too) This applies to `CollectionProperty` as well and the `find` method of a collection property uses this `name` to return ... |
604faaa5c679079690717f0ed3751568842246b9dfbaa8ee3e23a1330aeead1d | Quarto | 21,730 | 562 | ---
title: Annotations
description: Annotations API and Examples
jupyter: python3
execute:
daemon: false
---
Annotations API allows adding annotations to molecular entities. Molecular Nodes comes with a few bundled annotations for trajectories, but new ones can be dynamically added as well.
## Setup Molecular Nodes... |
f0a7fff5b188c025e9b6e70530355d57971f7f5163bcac89504cf80e68d6375e | Quarto | 22,677 | 572 | ---
title: "MDanalysis"
description: "A complete MDAnalysis workflow on the AdK equilibrium dataset, rendering with Molecular Nodes along the way."
jupyter: python3
execute:
daemon: false
format:
html: default
ipynb: default
---
This page walks through a full analysis of a molecular dynamics trajectory with
[MDA... |
8fce9443a800d7e1e50c10f948a41bbf7a92db4ec3aaa50c3fe6c9c1f888d726 | Quarto | 23,077 | 796 | ---
title: "SEP H5N5 HA Phylogenetic tree"
author: "Eve Zeyl Fiskebeck"
date: "`r format(Sys.time(), '%d %B, %Y')`"
params:
strain: "H5N5"
segment: "HA"
all_tree_metadata: "data/prepared_data/all_tree_metadata_CAB.RDS"
tree: "results/H5N5_HA/iqtree/H5N5_all_SEP_MSA_jalview.fasta.contree"
save_dir: "... |
757cc8ff4cd3aeeb5bb5cd68d4ee84d4c8f2ad436a67a3fe9b261c7eb8d9f8af | Quarto | 23,396 | 821 | ---
title: "SEP H5N5 NA Phylogenetic tree"
author: "Eve Zeyl Fiskebeck"
date: "`r format(Sys.time(), '%d %B, %Y')`"
params:
strain: "H5N5"
segment: "NA"
all_tree_metadata: "data/prepared_data/all_tree_metadata_CAB.RDS"
tree: "results/H5N5_NA/iqtree/SEP_NA_H5N5_clean_total_jalview_alignment.fasta.contree... |
227237c2546369de38c2c8d2e0a74a48df3ccb957df5bd82eee8f778f32f97cc | Quarto | 28,693 | 132 | ---
title: "Changelog"
---
# v520.3.0 - UNRELEASED
## Added
- Compositor node groups under a new `Compositor` catalog: `Illustrate` (flat, illustrative shading from the AO or Shadow pass or a `Cone Shadow`, with outlines and a flat background), `Depth Outline` and `Outline` (outlines from the Depth pass, by a Sobel f... |
78b87c62c248a4546debffb48eabd46fc158b80c2bb367cf9c3139cfde8356b0 | Quarto | 30,426 | 834 | ---
title: "Population-specific effects of APOE in NACC"
format: pdf
editor: visual
knitr:
opts_chunk:
code-fold: true
warning: false
error: false
message: false
echo: false
editor_options:
chunk_output_type: console
---
```{r}
#| label: packages
#| code-summary: Load R Packages
#| echo: fal... |
30da9129d69767c32b3e0b3de3bc3e884aee7749022b3d4264efb082cfa878d3 | Quarto | 34,285 | 256 | # Attributes
Below are the attributes which are potentially created when a structure is imported.
Explanations of type and domain conversions can be found in the Blender documentation [here](https://docs.blender.org/manual/en/latest/modeling/geometry_nodes/attributes_reference.html)
## World Scale
In Molecular Nodes... |
f8186bf28986c57e7f94eb5445f47eee3ec4a85cf10fdf54e0669e3c9b3c49e5 | Quarto | 43,263 | 1,489 | ---
title: "SEP H5N1 NA Phylogenetic tree"
author: "Eve Zeyl Fiskebeck"
date: "`r format(Sys.time(), '%d %B, %Y')`"
params:
strain: "H5N1"
segment: "NA"
all_tree_metadata: "data/prepared_data/all_tree_metadata_CAB.RDS"
tree: "results/H5N1_NA/iqtree/SEP_NA_H5N1_MSA_nommals.fasta.contree"
save_dir: "r... |
1fb8aab1a316b26185f10449f35ae38f419cb474bd4a20ca4b60723cda6c1d49 | Quarto | 43,739 | 1,516 | ---
title: "SEP H5N1 NA Phylogenetic tree"
author: "Eve Zeyl Fiskebeck"
date: "`r format(Sys.time(), '%d %B, %Y')`"
params:
strain: "H5N1"
segment: "HA"
all_tree_metadata: "data/prepared_data/all_tree_metadata_CAB.RDS"
tree: "results/H5N1_HA_all/iqtree/SEP_HA_H5N1_MSA_nomammals.fasta.contree"
save_d... |
dc9cec5e260eef06379f42743bfbd2b8d2896e28da409e5a61fd2f36c7c41ef0 | Quarto | 44,404 | 1,479 | ---
title: "SEP H5N1 HA Phylogenetic tree"
author: "Eve Zeyl Fiskebeck"
date: "`r format(Sys.time(), '%d %B, %Y')`"
params:
strain: "H5N1"
segment: "HA"
all_tree_metadata: "data/prepared_data/all_tree_metadata_CAB.RDS"
duplicates: "results/H5N1_HA/phylog/remove_identical_msa/duplicates_list"
tree: "... |
6cf0a3ee8e550a2ca5bc4c329911ca972d7885ef5303a070e942f35f068b0525 | Quarto | 44,554 | 1,532 | ---
title: "SEP H5N1 HA all Phylogenetic tree"
author: "Eve Zeyl Fiskebeck"
date: "`r format(Sys.time(), '%d %B, %Y')`"
params:
strain: "H5N1"
segment: "HA"
all_tree_metadata: "data/prepared_data/all_tree_metadata_CAB.RDS"
tree: "results/H5N1_HA_all/iqtree/SEP_HA_H5N1_MSA_nomammals.fasta.contree"
sa... |
fd3f50c0801b2aa06aa7d71400dcc72568fe14ab90e3f033874b0d47e974a247 | Quarto | 47,312 | 1,623 | ---
title: "SEP H5N1 NA Phylogenetic tree"
author: "Eve Zeyl Fiskebeck"
date: "`r format(Sys.time(), '%d %B, %Y')`"
params:
strain: "H5N1"
segment: "NA"
all_tree_metadata: "data/prepared_data/all_tree_metadata_CAB.RDS"
tree: "results/H5N1_NA/iqtree/SEP_NA_H5N1_MSA_nommals.fasta.contree"
save_dir: "r... |
843dba736ad4a4135193bd111ab892800749874673e48aa77e8e1a0e3ee072d4 | Quarto | 150,180 | 4,841 | ---
title: "Population-specific effects of APOE in NACC"
format: html
editor: visual
knitr:
opts_chunk:
code-fold: true
warning: false
error: false
message: false
echo: false
editor_options:
chunk_output_type: inline
---
```{r}
#| label: packages
#| code-summary: Load R Packages
#| echo: fal... |
793200a6aa3226a3ea2d686ff51a7d75354436c8affb1e7704c9cbf388bfc02c | R | 8 | 1 | # TODO
|
d8f7192c8dba90ef6c79d7948b5db66937c2df81c6f351bb96e18f59a90a5d33 | R | 17 | 1 | print('>(LAN*>')
|
58a4369d65ff83b922a4059c262535c8ad778f158987081ca1f46f21e340619b | R | 49 | 3 | #!../r
print(summary(as.integer(readLines())));
|
de649ffdc64ec054efc1423df608f09916a5ef19938c36557a98bbcc0491bc2b | R | 52 | 4 | library(testthat)
library(meta)
test_check("meta")
|
874dd72e8075f5471d2c2f837561205dd05fc8c9bcfc8cf7d9070d69aba23159 | R | 58 | 3 | #!../r
print(summary(as.integer(readLines("dat.txt"))));
|
7556e0c0a3ddf5c9f90dc91d0e86bce3c17f2c9d61f7da8981b4e8e5fadd924f | R | 59 | 4 | #!../r
cat(search(),"\n")
stop("FOO")
cat(ls("Autoloads"))
|
9ae60360e06ba3ed1b3b19912519815134f276073ee095fd126fe55f9fd02c6d | R | 61 | 4 | library(testthat)
load_all(pkg = './')
test_package('spdm')
|
d7dd9e5477334ac034bf5e78c10c4db49404fdb6a53c8607e59f7d7f86c7a54e | R | 61 | 4 | library(testthat)
load_all(pkg = './')
test_package('grss')
|
4efa09ee6cdbace0d4e036af433244f85cda9bcec2d402ecc9b43301e4e51813 | R | 68 | 4 | library(hySpc.testthat)
library(hyperSpec)
test_check("hyperSpec")
|
3fb614dd2fd62762466a4c16009f5cf27c46e291004de70485619af3635bf175 | R | 72 | 2 | library(rmarkdown)
rmarkdown::render("translating.Rmd", "html_document") |
5e52863be1dbf7b35aadafa817d3bb659dcfeb6a919c949055419b35472b1606 | R | 76 | 4 | args <- commandArgs(trailing=T)
errorCode <- args[1]
quit(status=errorCode) |
8c3f2d81efa36999d2f5d6c0b849b83326d543fa75ce756b8744b9ec9953835d | R | 83 | 6 | set.seed(42)
library("pacman")
## paths
datasets <- "/data"
outputs <- "/outputs"
|
bf54a131d53dc810426c105f0b4899c066fb4c8a96ae1f65fc7f68853081f007 | R | 88 | 5 | #!/usr/bin/env r
fsizes <- as.integer(readLines())
print(summary(fsizes))
stem(fsizes)
|
2c614383673d46d5149c746a705c65663aa332a1616a5acb29505d4b1e3fba39 | R | 89 | 5 | #' @method summary metainf
#' @export
summary.metainf <- function(object, ...)
object
|
e6498ec218a02b771f37f3aadb796e6ade5f9ed0d57f42ba828104d45ce45f44 | R | 89 | 5 | #' @method summary metacum
#' @export
summary.metacum <- function(object, ...)
object
|
07a23d176bc1a5706c27b3d70f53d97b186732419965c8310b47ebae1ef212ea | R | 104 | 3 | .onLoad <- function(libname, pkgname) {
utils::globalVariables(c("anno", "fs_anno", "ng_vignette"))
}
|
9dce19f2ebd26d108601ccfc8fcca999394d5f6fd8b208af6143668f3210b8f4 | R | 109 | 4 | # C. Beleites
# run all tests attached to objects
hySpc.testthat::unittest("hyperSpec", standalone = FALSE)
|
dac388c87778288ec14791b5c197968c344b00fd7093f6a33da60b016feebe46 | R | 112 | 6 |
.onLoad <- function(libname,pkgname) {
library.dynam(pkgname,package=pkgname,lib.loc=libname,local=FALSE)
}
|
dd7fe2edf94c7592609bc86ca7cfcafc72954603477dbecdf95d7fe7e14c98d4 | R | 112 | 3 | # @concept constants
.PATTERN.number <- "[-+]?(([0-9]*[.][0-9]+)|([0-9]+[.][0-9]*)|([0-9]+))([eE][-+]?[0-9])?"
|
fc4660b3ed0e9048528486983facac0cc0f4bbd97a7972f6fc88a05d37d75ae9 | R | 115 | 6 | ## librerias necesarias para LAN
library('lattice')
library('nlme')
library('lme4')
library('MASS')
library('boot') |
6a410c1d5fe6b5191902745cd4ddf2067b731e9ec96f73de84e2613497aa3323 | R | 132 | 12 |
# heatmapServer <- function(id, dw) {
#
# moduleServer(
# id,
# function(input, output, session) {
#
#
# }
# )
# }
|
5e00a1f0752a99ec3ebf88c15fe20e4ecf2c01a07c6dbc13457876de83415cb1 | R | 142 | 5 | # @concept constants
#
.wn.shift <- expression(Delta * tilde(nu) / cm^-1)
.wn <- expression(tilde(nu) / cm^-1)
.wl <- expression(lambda / nm)
|
d7fbef6726bd2e7c0e1e1fdf2a7f60adb8ea69673b0f77bfadb06bafafdc8b34 | R | 142 | 3 | ui<-dashboardPage(dashboardHeader(title="AutoFocus Run Results"),
dashboardSidebar(disable = TRUE),
body)
|
665082637c4a7c0b18022aa8f73ef805a2737766a38a9e7249c435e6ecdfc790 | R | 144 | 6 | # For fractional powers...
mat.frac.pow <- function(x, p){
d <- eigen(x)
return(d$vectors %*% diag(d$values^p) %*% solve(d$vectors))
}
|
554ded4a7989973ea2a38fb131b225caa170e2feddf20949e3a680e49370ceec | R | 156 | 11 | if (!dir.exists("data")) {
dir.create("data")
}
if (!dir.exists("output")) {
dir.create("output")
}
if (!dir.exists("logs")) {
dir.create("logs")
}
|
ef6662e0519185a4136e7ba3bf2e479370c4775d685d1e1cc593b339b1983db9 | R | 157 | 9 | compmatch <- function(x, split) {
if (split %in% gs("special.characters"))
split <- paste0("\\", split)
res <- any(grepl(split, x))
res
}
|
12a94dd43df80643675fef6d074fad035bc9917fa794c03a7ecef6238e8e42e0 | R | 158 | 10 | ---
title: "Pathway enrichment"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
This text will soon be updated. |
06c67f600c523d2fa5546a5bf7db53b4cc38c013b0aaf4f1f494399a53360f53 | R | 160 | 10 | ---
title: "Run network analysis"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
This text will soon be updated. |
9798f7114c4d606ca24fd2a91e43d2d146387272dd8e0ba4a43ebb30ffad253f | R | 161 | 3 | source(here(params$source_code, "AI_dependencies.R"))
source(here(params$source_code, "AI_palettes.R"))
source(here(params$source_code, "AI_grouping_helpers.R")) |
ab40e883f58c85bcc83a0d6694ab45f3d96d6725672136d840cae73d2c1d6061 | R | 171 | 9 | #' @keywords internal
"_PACKAGE"
## usethis namespace: start
#' @import rlang
#' @importFrom glue glue
#' @importFrom lifecycle deprecated
## usethis namespace: end
NULL
|
d9f329e4cebd2144d35992fefb316d6e34aec514409505937c859ab728fb1d86 | R | 174 | 6 | setwd('./Individual_timepoints')
source('AmphiG4stage.R',echo=TRUE)
source('AmphiN0stage.R',echo=TRUE)
source('AmphiN2stage.R',echo=TRUE)
source('AmphiN5stage.R',echo=TRUE)
|
a1127f90a56f5859f446238daef6fdb3f8129a1928fb3c81af22bb1d0c749c38 | R | 179 | 1 | utils::globalVariables(c("value", "count", "division", "super", "layer", "numel", "trainable", "rnorm", "code","geometry", "chipID", "filename", "gloal", "ic1", "layout", "par"))
|
b37b22f3acd70776768a38a38aa6af237927cf36d4c54ca1f7ff32093d05a7d1 | R | 184 | 16 | #!../r
cat("hello world!\n");
for (i in 1:10){
cat("i is",i,"\n");
}
foo <- function(x=1){
if (x == 1){
cat("x is 1\n");
} else {
cat("x is",x,":NOT 1\n");
}
}
foo(2)
foo()
|
0d9788243a482f4bc81ee3dbafb6dfe7ce63f090596304848939ded70c363bd0 | R | 193 | 9 | #' @keywords internal
#' @aliases stadia-package
"_PACKAGE"
## usethis namespace: start
#' @useDynLib stadia, .registration = TRUE
#' @importFrom Rcpp sourceCpp
## usethis namespace: end
NULL
|
5b26fca63320d6b9442b1d4f5da6da345baac2e6048429f170121169b90707c5 | R | 193 | 9 | #!../r
# function to be called at exit
.Last <- function() { cat("Really done, so bye-bye from .Last\n") }
# imagine we're doing something now...
# end, and .Last is now called
q(status=42)
|
7c4f961f634c1d81ef8702cff2174cc03aca5e141618a203820202c65aeb951b | R | 201 | 5 | # Check that sample labels match metadata rows
samples_match_metadata <- function(samples.vector, metadata) {
if (all(samples.vector==metadata$SampleName)) { return(TRUE) }
else { return(FALSE) }
} |
40c7a05ff1fa34a0307c5b68355cd0dd39b5b357c07fd389971020de468fc433 | R | 202 | 14 | ---
title: "Differential expression"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## Differential expression analysis
This text will soon be updated. |
99b276417b0675650d2f7c2d65d20414df9340af5675b859a510d1e1821f528e | R | 203 | 3 | a=read.delim(gzfile("57epigenomes.RPKM.pc.gz"))
a$median=apply(a[,3:ncol(a)],1,median)
write.table(a[,c("gene_id","median")],quote=F,row.names=F,col.names=F,sep="\t", file="57epigenomes.median_expr.txt") |
3fe31d53951ae82283d2423677524e3d697e4e4b491fce79daf3ac112fc9eef3 | R | 207 | 10 | #' Helper function for unit testing
#'
#' @export
skip_if_not_fileio_available <- function() {
testthat::skip_if_not(
file.exists("fileio"),
message = "file import test files not installed"
)
}
|
0e081eb48c6347b2ea0fc067c7d4183cb70b57858502ac00c718b4fd8b374aa9 | R | 210 | 9 | library(synapser)
library(synapserutils)
synapser::synLogin()
# download rosmap clinical data set
syncFromSynapse('syn3191087',
path="data/synapse",
ifcollision="keep.local") |
4dca5b89bfe80a20fc16e0471f527d6d927e644e004c6844b096f6003d232810 | R | 214 | 4 | ##ADD YOUR PACKAGES HERE!
remotes::install_github('LCBC-UiO/ggseg', build_vignettes = FALSE)
remotes::install_github('LCBC-UiO/ggseg3d', build_vignettes = FALSE)
remotes::install_github('LCBC-UiO/ggsegDesterieux')
|
16751befa85e8b6c439295b164cb68e7436f1803ff5eceb8bffea494ac808caa | R | 220 | 8 | context("spd-expam and spd-logmap")
# Positive definite matrixTesting data
x <- cov(matrix(rnorm(100), ncol = 5))
test_that("Exp and Log are inverses", {
expect_true(compare(x, spd.expmap(spd.logmap(x)))$equal)
})
|
fe55f949949521c1280853fb4d2150370654a89bc66404b053281cecca31b7e7 | R | 225 | 10 |
s <- Sys.info()
if (is.null(s))
q()
if (s[1] == "Linux") {
ldp <- strsplit(Sys.getenv('LD_LIBRARY_PATH'),':')$LD_LIBRARY_PATH
ldp <- ldp[which(ldp != "")]
cat(paste('-Wl,-rpath,',ldp,sep=''),"\n",sep=' ')
}
|
f8549ac6418df7ed8075e8d7f917b2e893e5026ac87bafa1a39f5df38aa274ed | R | 226 | 10 |
library(data.table)
get_results_list <- function(files) {
nfiles <- length(files)
file_list <- vector(mode = "list", length = nfiles)
for (i in 1:nfiles) {
file_list[[i]] <- fread(files[i])
}
return(file_list)
} |
bebed7f01d539844d8f4066e69e6fc1d3173f2116e463a03d58ae5d5dcb0ef42 | R | 236 | 11 | context("plotspc")
test_that("BARBITURATES", {
expect_silent(
spc <- do.call(collapse, barbiturates[1:3])
)
expect_silent(
plotspc(spc, col = palette_matlab_dark(3), stacked = TRUE, lines.args = list(type = "h"))
)
})
|
d43c4f4d886c5190eac0825153cf4f9c9b66b9700b0eb5e0758b47eb80624339 | R | 241 | 12 | remove_html <- function(x) {
x <- gsub("^<p>", "", x)
x <- gsub("</p>$", "", x)
x <- gsub("^Quote: ", "", x)
x <- gsub("\"", '"', x)
#
x <- gsub(">", ">", x)
x <- gsub("<", "<", x)
x <- gsub(" ", " ", x)
#
x
}
|
b4acdd0ad6f0e489c7e0b69705f1cf45d1f1580d6b07eb8c24ab46a46befc22b | R | 245 | 9 | #==========================================
# strips A1:A2 suffix from variant IDs
#==========================================
require(stringi)
strip_alleles <- function(x) {
x <- stringi::stri_replace_last_regex(x, ":[ACTG]*:[ACTG]*", "")
} |
7e79a61baab5b986afe680a4dd1b599bde365dee91fb4342755f1bd07aa70273 | R | 247 | 5 | a=read.delim(gzfile("mouse_FPKMs.tsv.gz"), F)
colnames(a)[1]="gene_id"
a[,1]=substring(a[,1],1,18)
a$median=apply(a[,2:ncol(a)],1,median)
write.table(a[,c("gene_id","median")],quote=F,row.names=F,col.names=F,sep="\t", file="mouse.median_expr.txt") |
8af6c2fe3a71a0291863a59b0c0bca155bc57caf2061fa478d24e214ceefff6b | R | 251 | 10 | library(data.table)
related <- fread("data/act/act_rosmap_adc.kin0")
remove_ids <- related[FID2 == 2, .(FID2, ID2)]
fwrite(remove_ids,
file = "data/act/act_related.remove",
quote = FALSE,
col.names = FALSE,
sep = ' ')
|
a5acf3ef63f10ae0d8e479107956052249f835b27ab51896487c4e3715725bb8 | R | 251 | 16 | test_that("fast correlation computation", {
pt <- 50
pr <- 10
n <- 200
zt <- matrix(rnorm(pt * n), ncol = pt)
zr <- matrix(rnorm(pr * n), ncol = pr)
c_ref <- cor(zt, zr)
c2 <- fast_cor(zt, zr)
expect_equal(
c_ref,
c2
)
})
|
e84d4e72ae771ad30f2c6dfe43f0a5c060a92c7433aa94059c9b674b2645b8bb | R | 252 | 8 | library(data.table)
covar = fread("data/act/act_np.covar")
pheno = fread("data/act/act_np.pheno", na.strings = "-1")
covar = merge(covar, pheno[, .(IID, cerad)], "IID")
covar = covar[!is.na(cerad)]
fwrite(covar, file = "data/act/act_np_cerad.covar")
|
85c71697e9f75d041c7244279f389c6c521007b6661004d56827a752c1fb97e2 | R | 259 | 12 |
get_results <- function(files) {
require(data.table)
nfiles <- length(files)
file_list <- vector(mode = "list", length = nfiles)
for (i in 1:nfiles) {
file_list[[i]] <- fread(files[i])
}
results <- rbindlist(file_list)
return(results)
}
|
fd89a669f70dc15069e63643c8e24822471d8a713d4b3b410b83134921fd63ef | R | 270 | 8 | library(data.table)
covar = fread("data/rosmap/rosmap_np.covar")
pheno = fread("data/rosmap/rosmap_np.pheno", na.strings = "-1")
covar = merge(covar, pheno[, .(IID, cerad)], "IID")
covar = covar[!is.na(cerad)]
fwrite(covar, file = "data/rosmap/rosmap_np_cerad.covar")
|
37c1dcbbe67d846670c8f03b234a2ef7378dbd4d6329429b592da5a18726b1fd | R | 276 | 9 | # true onset = 160 ms, F=81, max at F=126
true_onset <- 160
Xf <- seq(0, 500, 2)
Nf <- length(Xf)
temp1 <- vector(mode = "numeric", length = Nf)
erp <- dnorm(seq(-1.5,1.5,length.out=93), 0, 1)
erp <- erp - min(erp)
erp <- erp / max(erp)
temp2 <- c(rep(0, 79), erp, rep(0, 79)) |
2bb1043405cf2a7aae866222e7b7a6a119542bcf4b1ec57e759e1b40ff88e8bb | R | 277 | 10 |
library(data.table)
library(readxl)
act_np <- setDT(read_xlsx("raw_data/ACT_235_2023_08_21/np_2023_08_21.xlsx"))
act_np[, FID := 0]
fwrite(act_np[, .(FID, IDFromDave)],
file = "data/act_np_ids.txt",
quote = FALSE,
col.names = FALSE,
sep = " ")
|
32fdf783a1a7f1ff65f447d82c1d07f524cfa4cf606b10d08af0f9f6cf9a06eb | R | 285 | 9 | # true onset = 160 ms, F=81, max at F=126
true_onset <- 160
Xf <- seq(0, 500, 2)
Nf <- length(Xf)
temp1 <- vector(mode = "numeric", length = Nf)
erp <- dnorm(seq(-1.5,1.5,length.out=47), 0, 1)
erp <- erp - min(erp)
erp <- erp / max(erp)
temp2.half <- c(rep(0, 79), erp, rep(0, 79+46))
|
3b3de573ed48be7160fada5b05bde9ed6366106f1e2647073dbbb5a191d65e61 | R | 291 | 8 | #===================================
# makes a Table 1 from a data frame
#===================================
library(downloader)
source_url("https://raw.githubusercontent.com/lincoln-shade/r.functions/master/make_table_one.R",
sha = "618b76ddf7b93f365d7cd45fdf00910011dabb0c")
|
2b4d07e08ef448615c481581f85895e703dc5e897e53aada3ccc5491ef1c6a64 | R | 298 | 12 | source("../utils/0-indices.R")
set.seed(3745758)
n_reps <- 50
is_regulator <- as.logical(read.csv("data/pbmc-genes-meta.csv")$is_regulator)
gene_indices <- lapply(
seq_len(n_reps), function(i) generate_new_splits(is_regulator)
)
write_gene_indices("data/pbmc-gene-indices.txt", gene_indices)
|
72e918d7b08fc03cac5d507d8b91ee6b1cd8c6169c1a09b559744f33a59d33d2 | R | 298 | 8 |
#Read command line arguments
args <- commandArgs(trailingOnly = TRUE)
try(if(length(args) != 2) stop("Incorrect number of arguments, usage> Rscript index.r SIZE OUTPUT"))
index=args[1]
opt_output = args[2]
a<-sample(1:407, size = index)
write.table(a, opt_output,row.names=F,col.names=F)
|
dbb7859b67f757f04170ca6c40a6b0b021350cdb30c201c15dce4e781cb9bf36 | R | 298 | 12 | source("../utils/0-indices.R")
set.seed(3745758)
n_reps <- 50
is_regulator <- as.logical(read.csv("data/wang-genes-meta.csv")$is_regulator)
gene_indices <- lapply(
seq_len(n_reps), function(i) generate_new_splits(is_regulator)
)
write_gene_indices("data/wang-gene-indices.txt", gene_indices)
|
d843b67d38472433e9fc62973d554d98589332f0a004fece5d0d3ea94696d21b | R | 299 | 6 | .onLoad <- function(libname, pkgname) {
invisible(suppressPackageStartupMessages(
sapply(c("cluster", "dendextend", "dplyr", "foreach", "ggplot2", "glmnet", "magrittr", "mgm", "parallel", "RColorBrewer", "reshape2", "SummarizedExperiment"),
requireNamespace, quietly = TRUE)
))
}
|
0960af9ba7c1c7de3f6861e8e1e6ed18f9b06bbd96a253ddda4af8a162ce264d | R | 316 | 6 | library(qvalue)
for(i in c(1:22,"X")){
d = read.table(paste("eqtl.nopermute.chr",i,sep=""), head=F, sep=" ", stringsAsFactors=F)
d$qvalue = qvalue(d$V12)$qvalues
write.table(d[which(!is.na(d$qvalue)),], paste("eqtl.nopermute.chr",i,".qvalue",sep=""), quote=F, row.names=F, col.names=T, sep="\t")
}
|
2eb26eb8519ecce65eb6719f67f4d9b1ff1527a0b5dd2ecdd7d7d9fb8fc170a1 | R | 326 | 9 | # setting up R environment. As I have to rerun everything
# https://rstudio.github.io/renv/articles/renv.html
library(renv)
# setup
renv::init()
# reproducibility
# renv.lock is the file with metadata on the packages - This is the file to share!
renv::snapshot() # updates the rlock file / metadata - after sure code... |
3c1af80b45fa4a584ae081bbd837c57df7e4f4307aa13295ec6cd6224e17d598 | R | 334 | 8 | # Load function from StackoOver to check if a URL is valid
# https://stackoverflow.com/a/60627969
valid_url <- function(url_in,t=2){
con <- url(url_in)
check <- suppressWarnings(try(open.connection(con,open="rt",timeout=t),silent=T)[1])
suppressWarnings(try(close.connection(con),silent=T))
ifelse(is.null(check)... |
0e1043d310b03df781390dbdea7920e76f258c9768059aa849180fd4ba93de21 | R | 338 | 8 | #!/zs32/home/frwang/software/R-3.4.0/bin/Rscript
#Read command line arguments
args <- commandArgs(trailingOnly = TRUE)
try(if(length(args) != 2) stop("Incorrect number of arguments, usage> Rscript index.r SIZE OUTPUT"))
index=args[1]
opt_output = args[2]
a<-sample(1:407, size = index)
write.table(a, opt_output,row.name... |
b1225aae5748a06c729839bfd61a284a941c3442eb9fc0ed6a891a7ad5824023 | R | 344 | 21 | .pastenames <- function(...) {
if (nargs() == 1L & is.list(..1)) {
dots <- ..1
} else {
dots <- list(...)
}
names <- names(dots)
names <- sapply(
names,
function(x) {
if (nchar(x) > 0L) {
sprintf("%s = ", x)
} else {
""
}
}
)
paste(names, dots, colla... |
3fa2564ba42c09b9ddcb8e03bcd2c994fee901714b51975284ce6bfb52a06c85 | R | 345 | 16 | # color identification --------------------------------------------------------
#
ColorForGroup <- function(subtype){
if (subtype == "saMDD") {
return("#ED0000FF")
}
if (subtype == "sdMDD") {
return("#42B540FF")
}
if (subtype == "mdMDD") {
return("#00468BFF")
}
return("#0099B4FF")
}
show_col(... |
c636476fccca457ee45548d350b4ecc3a288eb3db4b33e24d9082d63419fbdc1 | R | 348 | 11 | library(synapser)
library(synapserutils)
synLogin()
files <- syncFromSynapse('syn3157275',
path="data/synapse/DNA_methylation",
ifcollision="keep.local")
clin_file <- syncFromSynapse('syn3191087',
path="data/synapse",
... |
c6d8ff4f5427f3b6d6edf6d4e87347cbbfdc6874a37c2d57d668fe566d4d9c3a | R | 349 | 12 | source('./scripts/01_Setup.R')
library(data.table)
aa2= paste0(aa, '_filteredCNVscells.rds')
all_data=list()
for (i in 1:length(aa2)){
fname = file.path('./data/processed/rds/',aa2[i])
all_data[[i]] = readRDS(fname)}
all2 = data.table::rbindlist(all_data)
all2= data.frame(all2)
saveRDS(all2, file='./data/process... |
349bbe323a7d63fc93b6c94a3f93f47405902d3f5064c444e2bb88b37d5064f9 | R | 350 | 7 | # by: Zeliha Gozde Turan
# date: Feb 25, 2023
source('./scripts/01_Setup.R')
sample_infA= data.frame(read_xlsx('./data/processed/txt/Christos_Brain_dataset_manifest.xlsx', sheet = 1))
write.table(sample_infA, file = "./data/processed/txt/SampleInfo.tsv", row.names=FALSE, sep="\t")
saveRDS(sample_infA, file = "./data/p... |
0fae79415f308e08306aa3085ed489a3c36eba70f207bab01532f1735798fff9 | R | 351 | 10 |
globalReportOnGenesWEB = function(){
req <- curl::curl_fetch_memory(paste0("https://snca.atica.um.es/api_test/globalReportOnGenes?tissues=",
paste0(tissues,collapse=","),
"&categories=",paste0(categories,collapse=","),
"&genes=",paste0(genes,collapse=","),"/"))
myjson = jsonlite::fromJSON(rawToChar(re... |
21e8c0d79b3309f8644201190f518b712e83dce3642f8b5a3da43fb2fcdb1a65 | R | 351 | 19 |
#' Browse homepage of *R hyperSpec*
#'
#' Browse homepage of [**R hyperSpec**](https://r-hyperspec.github.io/)
#' family packages.
#'
#' @importFrom utils browseURL
#' @export
#'
#' @concept utils
#'
#' @examples
#' \dontrun{\donttest{
#' hy_browse_homepage()
#' }}
hy_browse_homepage <- function() {
browseURL("http... |
137de7b13ee886ba29f0da439c03c452b938f0a2f6f73bde56445a2d9f3e241e | R | 353 | 10 | ExcludeVars <- c("R_SESSION_TMPDIR","R_HISTFILE")
IncludeVars <- Sys.getenv()
IncludeVars <- IncludeVars[grep("^R_",names(IncludeVars),perl=TRUE)]
cat("const char *R_VARS[] = {\n")
for (i in 1:length(IncludeVars)){
if (names(IncludeVars)[i] %in% ExcludeVars)
next
cat('"',names(IncludeVars)[i],'","',IncludeVars[i],'... |
8843d8f431525bd0f6fbf46b83593ef8fd5aeef8e868d92cac4dc734c3d1c0f8 | R | 355 | 7 | #!/zs32/home/frwang/software/R-3.4.0/bin/Rscript
library(qvalue)
for(i in c(1:22)){
d = read.table(paste("sqtl.nopermute.chr",i,sep=""), head=F, sep=" ", stringsAsFactors=F)
d$qvalue = qvalue(d$V12)$qvalues
write.table(d[which(!is.na(d$qvalue)),], paste("sqtl.nopermute.chr",i,".qvalue",sep=""), quote=F, row... |
a623dd874222f98e5a9dbfa1fab07aafa0a7d59a9025fe1d5a0469c1126ed476 | R | 365 | 16 | #!../r
longline <- function(len){
n <- floor(len/10)
m = len %% 10
if (m>0){
x <- paste(rep(seq(0,9),n),collapse='')
y <- paste(seq(0,m-1),collapse='')
z <- paste(x,y,sep='')
} else {
z <- paste(rep(seq(0,9),n),collapse='')
}
z
}
cat("x<-\"", longline(1020), "\";",sep="");
cat("cat(x,\"\\n\"",")\n",sep=""... |
16cdae901f1993c09b9ca24690c6e101a976ee704423ac2e0a10c98e973d15d5 | R | 367 | 15 |
#' mochims__fraction_folded
#'
#' Calculate fraction folded in 2-state model.
#'
#' @param folding_energy folding energies for 2-state model (required)
#' @param RT constant (default:0.001987*(273+24))
#'
#' @return Fraction folded
#' @export
mochims__fraction_folded <- function(
folding_energy,
RT = 0.001987*(273... |
beb47647ed7347cf52b70b52509875843e54e41698bbc85346cc010f76d79696 | R | 368 | 16 | percent_label <- function(x, type = "CI", digits = 1,
func = round, lab.NA = NULL, ...) {
value <- func(100 * x, digits = digits, ...)
#
if (length(type) > 0 && type != "")
suffix <- paste0(" ", type)
else
suffix <- ""
res <- paste0(value, "%", suffix)
#
if (!is.null(l... |
ad4dc5eb34aa8e481ffd20e191b2b5ed82441003e717bbc0b8d36300e8c30a40 | R | 369 | 8 | plotSigMDS <- function(sigDiffDists, matFn){
if(!is.na(matFn)){ save(sigDiffDists, file=matFn) }
fit <- cmdscale(as.dist(sigDiffDists), eig=TRUE, k=2)
gdat <- as.data.frame(fit$points)
colnames(gdat) <- c('Coordinate1', 'Coordinate2')
print(ggplot(gdat, aes(x=Coordinate1, y=Coordinate2)) +
... |
e212044a59cb2d4b82dc9b0f468888b61d4084a2df5884f40fe7b9aa7f509850 | R | 372 | 12 |
library(data.table)
library(magrittr)
adc_pheno <- fread("data/adc/adc_np.pheno", na.strings = '-1')
shared_phenos <- c('HS', 'NACCMICRO', 'ASC', 'NACCINF', 'BRAAK', 'NEUR', 'LEWY')
ibd <- fread("data/rosmap/rosmap_adc.kin0")
rm_ids <- ibd[, .(FID2, ID2)]
fwrite(rm_ids, file = "data/rosmap/rosmap_adc_related.txt",
... |
10caf876e18c9ccdf6060a35699a47752e84fcb9f039ce5bbce7158e0a854025 | R | 375 | 10 |
globalReportOnGenesWEB = function(tissues,categories,genes){
req <- curl::curl_fetch_memory(paste0("https://snca.atica.um.es/api_test/globalReportOnGenes?tissues=",
paste0(tissues,collapse=","),
"&categories=",paste0(categories,collapse=","),
"&genes=",paste0(genes,collapse=","),"/"))
myjson = jsonlit... |
626a36dfccbfac84b32cc4630c19630e56d714e6fd6b6cda68158029297fa527 | R | 375 | 9 | library(synapser)
library(synapserutils)
synLogin()
out_path <- "data/synapse/rna_seq/"
syncFromSynapse('syn21088596', path=out_path, ifcollision="keep.local")
syncFromSynapse('syn21323366', path=out_path, ifcollision="keep.local")
syncFromSynapse('syn3505732', path=out_path, ifcollision="keep.local")
syncFromSynapse(... |
c036ffa901e934c0f562f4cf30ea14d761b2d79517eeb6ff3b5a8b8c72d06621 | R | 376 | 17 | #### Notes ####
#### Libraries ####
#### Sourced functions ####
#### Functions ####
# Annotate boxplot with number of observations per grouping
annotate_n <- function(x) {
return(c(y = median(x)*1.10, label = length(x)))
}
# Annotate boxplot with median value per grouping
annotate_median <- function(x) {
retu... |
53299893530c1ebc2a6fd4f93af135dcd413e44ad0e966e7aaca7f78a2bfea9d | R | 380 | 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... |
47cecd6d05913d3852322dffbdfc35325153804c488db06099f4de66e701f2b2 | R | 382 | 13 | #=================================
# fix NACC IIDs
#=================================
library(data.table)
library(magrittr)
library(stringi)
fam <- fread("tmp/act_no_dup.fam")
fam[, V2 := stri_replace_first_regex(V2, ".*_", "")]
# file.rename("data/plink/adc.fam", "data/plink/adc_original_iid.fam")
fwrite(fam, "tmp/... |
8a68afca43277c332f0935c9fd6bcec496eb630e51a52c4c5ea9da4f2a847349 | R | 382 | 8 | plotROC <- function(rocDat){
print(ggplot(rocDat) + geom_abline(slope=1, intercept=0) +
geom_path(aes(x=FP, y=TP, color=Comparison)) + theme_bw() +
xlab('False Positive Rate') + ylab('True Positive Rate'))
print(ggplot(rocDat) +
geom_path(aes(x=TP, y=Precision, color=Comparison)) +... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.