Skip to content

Instantly share code, notes, and snippets.

View svigneau's full-sized avatar

Sebastien Vigneau svigneau

View GitHub Profile
@brantfaircloth
brantfaircloth / rnalater.md
Last active April 13, 2021 14:33
Homebrew RNALater

Disclaimer

Before using this for samples that are precious, you should thoroughly test the solution that you make. The best way to do that would be a side-by-side with commercial RNALater.

Source

The following recipe is from the patent. It always pays to read these.

In a beaker, combine 40 ml 0.5 M EDTA, 25 ml 1M Sodium Citrate, 700 gm Ammonium Sulfate
@woobe
woobe / README.md
Last active March 15, 2018 06:27
[Blog]: Towards (Yet) Another R Colour Palette Generator
@tomhopper
tomhopper / PRESS.R
Last active July 2, 2025 14:24
Functions that return the PRESS statistic (predictive residual sum of squares) and predictive r-squared for a linear model (class lm) in R
#' @title PRESS
#' @author Thomas Hopper
#' @description Returns the PRESS statistic (predictive residual sum of squares).
#' Useful for evaluating predictive power of regression models.
#' @param linear.model A linear regression model (class 'lm'). Required.
#'
PRESS <- function(linear.model) {
#' calculate the predictive residuals
pr <- residuals(linear.model)/(1-lm.influence(linear.model)$hat)
#' calculate the PRESS
@svigneau
svigneau / bedgraph_to_wig.pl
Last active February 24, 2024 01:22
Perl script to convert bedGraph to fixedStep wig format with defined step size.
#!/usr/bin/perl
# Description: This script converts bedGraph to fixedStep wig format with defined step size. Input file may be compressed as .gz.
# Coordinates in bedGraph input are assumed to be 0-based (http://genome.ucsc.edu/goldenPath/help/bedgraph.html).
# Coordinates in wig output are 1-based (http://genome.ucsc.edu/goldenPath/help/wiggle.html).
# Usage: bedgraph_to_wig.pl --bedgraph input.bedgraph --wig output.wig --step step_size [--compact]
# --bedgraph : specify input file in bedGraph format.
# --wig : specify output file in fixedStep format.
# --step : specify step size. Note that span is set to be identical to step.
@jeromyanglim
jeromyanglim / example-r-markdown.rmd
Created May 17, 2012 04:23
Example of using R Markdown
This post examines the features of [R Markdown](http://www.rstudio.org/docs/authoring/using_markdown)
using [knitr](http://yihui.name/knitr/) in Rstudio 0.96.
This combination of tools provides an exciting improvement in usability for
[reproducible analysis](http://stats.stackexchange.com/a/15006/183).
Specifically, this post
(1) discusses getting started with R Markdown and `knitr` in Rstudio 0.96;
(2) provides a basic example of producing console output and plots using R Markdown;
(3) highlights several code chunk options such as caching and controlling how input and output is displayed;
(4) demonstrates use of standard Markdown notation as well as the extended features of formulas and tables; and
(5) discusses the implications of R Markdown.