This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use warnings;use strict; | |
my ($header,$sequence); | |
$header = <>; | |
chomp $header; | |
while(my $line = <>){ | |
chomp $line; | |
if($line =~ /^>/){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my %sites; | |
while(<>){ | |
next if( 1 .. /Rich Roberts/); | |
next unless /\S/; | |
my(@names) = split /[\s\)\(]+/; | |
my $site = IUB_to_regexp(uc($names[-1])); | |
if(not exists $sites{$site} and not exists $sites{$site}){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```{r error,dev='svg'} | |
library(ggplot2) | |
ggplot(movies,aes(x=rating)) + geom_histogram(aes(fill=..count..)) | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <fstream> | |
#include <Rcpp.h> | |
using namespace Rcpp; | |
// [[Rcpp::export]] | |
CharacterVector read_fasta(std::string file) { | |
CharacterVector records; | |
std::ifstream in(file.c_str()); | |
in.get(); // remove first '>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(Rcpp) | |
require(GenomicRanges) | |
sourceCpp('read_gff.cpp') | |
read_gff = function(file, grouping='feature_id', attribute_sep='=') { | |
data = data.frame(lapply(gff2df(file, attribute_sep), all_numeric, what="vector")) | |
if(!grouping %in% colnames(data)){ | |
stop(paste(grouping, "does not exist in", file, ", valid columns are", paste(colnames(data), collapse=" "))) | |
} | |
stopifnot(grouping %in% colnames(data)) | |
lapply(split(data, factor(data$seqid)), function(df) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#toc { | |
top: 0px; | |
left: 0px; | |
height: 100%; | |
position: fixed; | |
width: 150px; | |
padding-top: 20px; | |
color: white; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JAVA PROFILE 1.0.1, created Fri Jul 19 08:47:09 2013 | |
Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions | |
are met: | |
- Redistributions of source code must retain the above copyright | |
notice, this list of conditions and the following disclaimer. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
url = 'http://teamcolors.arc90.com/' | |
library(httr) | |
get_colors = function(league=c('NBA', 'NFL', 'NHL', 'MLB')){ | |
league = match.arg(league) | |
color_data = parse_html(GET('http://teamcolors.arc90.com/')) | |
rbind.fill(xpathApply(color_data, | |
paste('//*[@id="', league, '"]/li[@class="team"]', sep=''), | |
parse_team)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.Rproj.user | |
.Rhistory | |
.RData | |
*.Rproj | |
*.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
withOptions <- function(optlist, expr) | |
{ | |
oldopt <- options(optlist) | |
on.exit(options(oldopt)) | |
expr <- substitute(expr) | |
eval.parent(expr) | |
} | |
less = function(x) { | |
withOptions(list(pager='less', dplyr.print_min=.Machine$integer.max, width=10000L), page(x, method='print')) |
OlderNewer