Skip to content

Instantly share code, notes, and snippets.

View jayhesselberth's full-sized avatar

Jay Hesselberth jayhesselberth

View GitHub Profile
{
"index_name": "usethis",
"start_urls": [
{
"url": "https://usethis.r-lib.org/index.html",
"selectors_key": "homepage",
"tags": [
"homepage"
]
},
@jayhesselberth
jayhesselberth / gist:6aed2c2e8f54c67bc046c8861443992d
Created August 2, 2018 10:58
Academic-industry NIH funding by state
library(nihexporter)
library(tidyverse)
library(rlang)
library(cowplot)
grant_funds <- function(codes, code_name) {
code_name <- rlang::sym(code_name)
projects %>%
filter(activity %in% codes) %>%
``` r
library(nihexporter)
#> Loading required package: jsonlite
#> Loading required package: httr
#> Loading required package: dplyr
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
library(tidyverse)
# How abundant is Xrn1?
tab <- readr::read_tsv("https://yeastgfp.yeastgenome.org/allOrfData.txt")
all <- tab %>%
select(yORF, abundance) %>%
mutate(abundance = as.numeric(abundance)) %>%
na.omit()
``` r
library(tidyverse)
# How abundant is Xrn1?
tab <- readr::read_tsv("https://yeastgfp.yeastgenome.org/allOrfData.txt")
#> Warning: Missing column names filled in: 'X33' [33]
#> Parsed with column specification:
#> cols(
#> .default = col_logical(),
library(tidyverse)
library(stringr)
test <- tribble(
~expr, ~time,
'bedtools:random', '1',
'bed_random', '2'
)
test %>%
* installing *source* package 'valr' ...
** libs
*** arch - i386
d:/Compiler/gcc-4.9.3/mingw_32/bin/g++ -std=gnu++11 -I"D:/RCompile/recent/R/include" -DNDEBUG -I../inst/include -I"d:\RCompile\CRANpkg\lib\3.4/Rcpp/include" -I"d:\RCompile\CRANpkg\lib\3.4/BH/include" -I"d:\RCompile\CRANpkg\lib\3.4/dplyr/include" -I"d:/Compiler/gcc-4.9.3/local330/include" -pedantic -O2 -Wall -mtune=core2 -c RcppExports.cpp -o RcppExports.o
In file included from d:\RCompile\CRANpkg\lib\3.4/dplyr/include/dplyr.h:11:0,
from ../inst/include/valr.h:5,
from RcppExports.cpp:4:
d:\RCompile\CRANpkg\lib\3.4/dplyr/include/tools/all_na.h:15:40: warning: ISO C99 requires rest arguments to be used
RCPP_RETURN_VECTOR( all_na_impl, x ) ;
#! /usr/bin/env python
''' seqtools-design-barcodes: Design barcoded Illumina adaptors.
Constraints:
1. No homopolyeric runs
2. Minimum GC content is 40%
3. Hamming dist > 1 (for barcodes > 4 nt)
4. At least 3 bases in represented in each bar code
5. Relatively equal base representation at each position for bar
codes in a set