Skip to content

Instantly share code, notes, and snippets.

View wwood's full-sized avatar

Ben J Woodcroft wwood

View GitHub Profile
@wwood
wwood / length.pl
Created October 30, 2012 00:23
length memoization
#!/usr/bin/env perl
use lib '/home/ben/l/git/bioperl-live';
use 5.006;
use strict;
use warnings;
use Bio::Seq;
use Bio::SeqFeature::SubSeq;
@wwood
wwood / default_bio_logger_log_level_tester.rb
Created April 2, 2012 06:29
default_bio_logger_log_level_tester.rb
#!/usr/bin/env ruby
require 'bio-logger'
if __FILE__ == $0
require 'optparse'
# Parse cmd line options
o = OptionParser.new do |opts|
opts.banner = "gag [options] <pileup_output>"
@wwood
wwood / escapenet_netusage.js
Created February 10, 2012 23:59
(working!) add the escapenet ISP to the list of supported ISPs in the netusage Firefox plugin
'escapenet': {
name: 'EscapeNet',
process: [
'POST https://www.esc.net.au/myaccount/myaccount_login.php Action=Run&Redirect=%2Fmyaccount%2Fadsl%2Fadsl_usage.php&username={USERNAME}&password={PASSWORD}&submit=Log+In',
[/Web access denied/, 'ERROR', /.*<td>([^<]+) \((\d+)Gb\).*\n.*usage is <\/td><td>(\d+) Mb of (\d+) Mb.*\n.*?Off-Peak Data<\/td><td>(\d+) Mb of (\d+) Mb.*\n.*?Rollover<\/td><td>(\d\d\/\d\d\/\d\d\d\d)/],
'GET https://www.esc.net.au/myaccount/myaccount_logout.php',
],
varsDisplay: {
@wwood
wwood / gist:1240198
Created September 25, 2011 03:40
Evidence that you cannot know from a blast archive whether the db queried was run with -parse_seqids if you output in CSV (outfmt 6)
sequenceserver/tests/database/nucleotide$ blast_formatter -version
blast_formatter: 2.2.25+
Package: blast 2.2.25, build Mar 21 2011 12:13:17
sequenceserver/tests/database/nucleotide$ ln -s Sinvicta2-2-3.cdna.subset.fasta parse.fa
sequenceserver/tests/database/nucleotide$ ln -s Sinvicta2-2-3.cdna.subset.fasta no_parse.fa
sequenceserver/tests/database/nucleotide$ makeblastdb -in parse.fa -parse_seqids -dbtype nucl
Building a new DB, current time: 09/25/2011 10:05:33
New DB name: parse.fa
@wwood
wwood / ensembl_production_prototype.rb
Created July 23, 2011 07:51
Prototype for getting the species prefixes for Ensembl identifiers for all species, using the production database
# This script is released under a GPL version 3 license or newer. Copyright by the author Ben Woodcroft.
require 'rubygems'
require 'ensembl'
require 'pp'
module Ensembl
module Production
class DBConnection < Ensembl::DBRegistry::Base
self.abstract_class = true
/* A mozilla Ubiquity helper to search for UniProt IDs */
CmdUtils.CreateCommand({
names: ["uniprot"],
icon: "http://www.uniprot.org/favicon.ico",
description: "Searches UniProt.",
help: "type 'uniprot something', enter. The something is like searching UniProt for an accession. For the format, add the format to the end of your accession - for instance 'uniprot C4IY21.txt'",
author: { name: "Ben J. Woodcroft", email: "b.woodcroft near pgrad.unimelb.edu.au"},
license: "GPL",
arguments: [{role: 'object', nountype: noun_arb_text}],
execute: function execute(args) {
@wwood
wwood / apiloc_commands.js
Created November 5, 2009 05:05
Local Mozilla Ubiquity commands
CmdUtils.CreateCommand({
names: ["genbank blast"],
arguments: [{role: 'object', nountype: noun_arb_text, label: 'genbank id'},
{role: 'goal', nountype: noun_arb_text, label: 'blast database'},
{role: 'instrument', nountype: noun_arb_text, label: 'blast program'},
{role: 'location', nountype: noun_arb_text, label: 'taxa'}],
homepage: "http://gist.github.com/73638",
help: 'genbank_blast <b>entrez_id</b> [with <b>blast_program</b>] [to <b>blast_database_name</b>]',
author: { name: "Ben J. Woodcroft", email: "b.woodcroft@pgrad.unimelb.edu.au"},
contributors: ["Ben J. Woodcroft"],
@wwood
wwood / scholar-search-simple.js
Created October 5, 2009 03:22
Google Scholar searching without the preview extras
CmdUtils.CreateCommand({
names: ["scholar"],
icon: "http://www.google.com/favicon.ico",
homepage: "http://static.isnotworking.com/scholar-search.html",
description: "A short description of your command.",
author: { name: "Ben Woodcroft", email: "b.woodcroft@pgrad.unimelb.edu.au"},
license: "MPL",
help: "Searches Google Scholar for articles",
arguments: [{role:'object', nountype: noun_arb_text, label:'keywords'}],
var ezp = 'http://ezp.lib.unimelb.edu.au/login?url=';
var link = FireGestures.getLinkURL();
var url = '';
var doc = FireGestures.sourceNode.ownerDocument;
if (!link){
url = ezp+doc.location.href;
} else {
url = link;
}
A list of commands to install Ubiquity. All are compatible with Parser 2 (Ubiquity 0.5)
http://gist.github.com/180078 - google scholar
http://gist.github.com/183528 - EuPathDB - PlasmoDB, ToxoDB.
http://gist.github.com/180067 - PubMed
http://gist.github.com/73638 - interacting with the Rails server I run locally
http://gist.github.com/168938 - Amigo Gene ontology searching
http://gist.github.com/168938 - Entrez commands
http://gist.github.com/270820 - Uniprot
http://gist.github.com/30649 - OrthoMCL