Skip to content

Instantly share code, notes, and snippets.

View mfcovington's full-sized avatar

Mike Covington mfcovington

View GitHub Profile
@mfcovington
mfcovington / test.bed
Created September 22, 2014 23:04
Sample files to demo problem for samtools/samtools#79
A01 800 810
[
{
"title" : "A modern ampelography: a genetic basis for leaf shape and venation patterning in grape",
"journal" : "Plant Physiology",
"year" : "2014",
"authors" : "Chitwood DH, Ranjan A, Martinez CC, Headland LR, Thiem T, Kumar R, Covington MF, Hatcher T, Naylor DT, Zimmerman S, Downs N, Raymundo N, Buckler ES, Maloof JN, Aradhya M, Prins B, Li L, Myles S, Sinha NR",
"pubmed" : "24285849",
"pdf" : "https://github.com/mfcovington/mfcovington.github.com/blob/master/resources/pdf/Plant Physiol.-2014-Chitwood-259-72.pdf?raw=true",
"si" : ""
@mfcovington
mfcovington / grab-appropriate-boundaries-file.pl
Last active August 29, 2015 14:01
Collecting best boundary files
#!/usr/bin/env perl
# Mike Covington
# created: 2014-05-23
#
# Description:
#
use strict;
use warnings;
use autodie;
use feature 'say';
@mfcovington
mfcovington / plot-boundaries.R
Last active August 29, 2015 14:01
Plotting Boundaries
library(ggplot2)
library(reshape)
par1 <- "M82"
par2 <- "PEN"
boundary.files <- list.files(pattern = "\\.boundaries$")
for (file in boundary.files) {
bounds <- read.table(file)
@mfcovington
mfcovington / gist:9811551
Created March 27, 2014 16:23
Links for Variant Calling iPlant Workshop

@benkasminbullock: Thanks for the question. Log::Reproducible takes a look at @ARGV to create an archive. Any module-specific options/args (--repronote, --reprodir) should get removed from @ARGV before @ARGV is accessed by the script that calls the reproduce() function. @ARGV is then used by the script as it would normally have been.

You bring up a good point. What if some other module tries to access @ARGV before Log::Reproducible? I was able to 'break' it by using another module that messed with @ARGV in a BEGIN block (even if the module was called after reproduce()). I could fix this with the following (as long as it is placed early enough in the code):

use Log::Reproducible;
BEGIN { reproduce(); }

Alternatively, I could fix it by placing the reproduce(); call inside an import subroutine in the module. This would prevent one from setting a script-level archive directory. However, I could restore this functionality by

@mfcovington
mfcovington / benchmark_add_range.pl
Created June 27, 2013 22:23
speed vs readability
#!/usr/bin/env perl
use strict;
use warnings;
use List::Util 'max';
use Benchmark 'cmpthese';
my $count = 100_000;
my %test_ranges = (
10 => 20,
Left align Right align Center align
This This This
column column column
will will will
be be be
left right center
aligned aligned aligned
@mfcovington
mfcovington / rainbow.R
Last active December 15, 2015 07:29
fun with ggplot
library(ggplot2)
df <- data.frame(x = rnorm(100000), y = rnorm(100000))
df.sub <- subset(df, x * y < 2.5 & x * y > -2.5)
ggplot(df.sub, aes(x, y, color = x * y)) +
geom_point(alpha = I(0.5)) +
scale_color_gradientn(colours = rainbow(10), limits=c(-2.5, 2.5)) +
theme(aspect.ratio = 1,
panel.background = element_rect(fill = "black"),
panel.grid = element_blank(),
plot.background = element_rect(fill = "black"),