Skip to content

Instantly share code, notes, and snippets.

View chasemc's full-sized avatar
:octocat:

Chase Clark chasemc

:octocat:
View GitHub Profile
@chasemc
chasemc / 16S_Local-BLAST.rmd
Last active June 27, 2018 00:29
Messy little script to run local BLAST against 16S database
---
title: "16S"
author: "Chase Clark"
date: "May 15, 2018"
output: html_document
---
```{r eval=FALSE}
# download file
#download.file(url = "ftp://ftp.ncbi.nlm.nih.gov/blast/db/16SMicrobial.tar.gz", destfile = "16SMicrobial.tar.gz", mode = 'wb')
@chasemc
chasemc / fast_pvclust.r
Last active July 5, 2018 23:15
fast pvclust
# library(wordspace)
# library(pvclust)
# largeMatrix is a matrix, where rows are samples and columns are variables
cosineDistanceFunction <- function(x) wordspace::dist.matrix(x, method = "cosine", as.dist = TRUE)
results <- pvclust(largeMatrix, method.dist = cosineDistanceFunction, nboot=1000)
@chasemc
chasemc / findmzXMLsha.r
Created September 17, 2018 21:26
This gets the sha1 [single] (SHA of entire mzXML file up the SHA1 node) and the filesha1 [maybe multiple] (the SHA of the original data files)
# requires xml2 and magrittr
findmzXMLsha <- function(singlemzXMLpath){
sha <- list(sha1 = NA, filesha1 = NA)
singlemzXMLpath %>%
xml2::read_xml() %>%
xml2::xml_ns_strip() %>%
xml2::xml_find_first(., "//mzXML/sha1" ) %>%
@chasemc
chasemc / readmzXML.r
Created September 22, 2018 04:26
read mzxml into R for serialization faster than with xml2::serialize
# a <- path to mzXml
a %>%
readLines %>%
serialize(., NULL) %>%
memCompress(., type = "gzip") %>%
list(.) %>%
return(.) -> d
@chasemc
chasemc / auto_prior.rmd
Created December 19, 2018 23:37
auto_prior
---
title: "Sponge Picking"
author: "Chase Clark"
date: "November 4, 2018"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
@chasemc
chasemc / MALDI_Processing_ShinyApp.R
Created February 6, 2019 22:46
Shiny-modules display of MALDIquant spectrum processing steps
library(shiny)
library(MALDIquant)
library(shinyBS)
#' QC module variance and smoothing
#'
#' @param id namespace
#'
#' @return modulke UI
#' @export
@chasemc
chasemc / bin.R
Created March 12, 2019 22:23
Mass Binning
#' binnR
#'
#' @param vectorList NA
#' @param ppm NA
#' @param massStart NA
#' @param massEnd NA
#'
#' @return NA
@chasemc
chasemc / boxplotRant.Rmd
Created March 30, 2019 01:27
boxplotRant.Rmd
---
title: "Untitled"
author: "Chase Clark"
date: "March 29, 2019"
output: html_document
---
```{r}
library(ggpubr)
We can't make this file beautiful and searchable because it's too large.
"V1","V2","V3","V4","V5","V6","V7","V8","V9","V10","V11","V12","V13","V14","V15","V16","V17","V18","V19","V20","V21","V22","V23","V24","V25","V26","V27","V28","V29","V30","V31","V32","V33","V34","V35","V36","V37","V38","V39","V40","V41","V42","V43","V44","V45","V46","V47","V48","V49","V50","V51","V52","V53","V54","V55","V56","V57","V58","V59","V60","V61","V62","V63","V64","V65","V66","V67","V68","V69","V70","V71","V72","V73","V74","V75","V76","V77","V78","V79","V80","V81","V82","V83","V84","V85","V86","V87","V88","V89","V90","V91","V92","V93","V94","V95","V96","V97","V98","V99","V100","V101","V102","V103","V104","V105","V106","V107","V108","V109","V110","V111","V112","V113","V114","V115","V116","V117","V118","V119","V120","V121","V122","V123","V124","V125","V126","V127","V128","V129","V130","V131","V132","V133","V134","V135","V136","V137","V138","V139","V140","V141","V142","V143","V144","V145","V146","V147","V148","V149","V150","V151","V152","V153","V154","V155","V156","V157","V158","V159","V160","V161","V162
We can't make this file beautiful and searchable because it's too large.
"V1","V2","V3","V4","V5","V6","V7","V8","V9","V10","V11","V12","V13","V14","V15","V16","V17","V18","V19","V20","V21","V22","V23","V24","V25","V26","V27","V28","V29","V30","V31","V32","V33","V34","V35","V36","V37","V38","V39","V40","V41","V42","V43","V44","V45","V46","V47","V48","V49","V50","V51","V52","V53","V54","V55","V56","V57","V58","V59","V60","V61","V62","V63","V64","V65","V66","V67","V68","V69","V70","V71","V72","V73","V74","V75","V76","V77","V78","V79","V80","V81","V82","V83","V84","V85","V86","V87","V88","V89","V90","V91","V92","V93","V94","V95","V96","V97","V98","V99","V100","V101","V102","V103","V104","V105","V106","V107","V108","V109","V110","V111","V112","V113","V114","V115","V116","V117","V118","V119","V120","V121","V122","V123","V124","V125","V126","V127","V128","V129","V130","V131","V132","V133","V134","V135","V136","V137","V138","V139","V140","V141","V142","V143","V144","V145","V146","V147","V148","V149","V150","V151","V152","V153","V154","V155","V156","V157","V158","V159","V160","V161","V162