Skip to content

Instantly share code, notes, and snippets.

View michaelbarton's full-sized avatar

Michael Barton michaelbarton

View GitHub Profile
(defproject resolve-contig-one "1.0.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.2.0"]
[org.clojure/clojure-contrib "1.2.0"]
[clj-redis "0.0.12"]])
(use '[clojure.java.io :only [reader]])
(use '[clojure.string :only [split]])
(def read-keys [:id :status :pos-contig :pos-position :pos-strand :neg-contig :neg-position :neg-strand])
(defn split-line [x]
(split x #"\t"))
(defn create-read [x]
(with-meta
(use '[clojure.java.io :only [reader]])
(use '[clojure.string :only [split]])
(defrecord Read
[id status
pos-contig pos-position pos-strand
neg-contig neg-position neg-strand])
(defn split-line [x]
#!/usr/bin/env Rscript
library('plyr')
library('ggplot2')
source('lib/r/drop.levels.r')
source('lib/r/find.replace.R')
options(stringsAsFactors = FALSE)
#!/usr/bin/env ruby
require 'fastercsv'
require 'pp'
map = FCSV.open('addition.csv',:headers => true).inject(Hash.new) do |hash,row|
if row['Gene ']
hash['250327' + row['R124#']] = row['Gene ']
end
hash
end
class Git < Thor
desc "branch", "Name of current branch"
def branch
puts branch_name
end
private
def git(command,args)
require 'bio'
task :map_ids do
mappings = YAML.load(File.read('data/mapping.yml'))
v2_ids = File.readlines('data/v2_gene_ids.txt').map{|a| a.to_i}
end
task :select do
v2_ids = File.readlines('data/v2_gene_ids.txt').map{|a| a.to_i}
entries = Bio::FlatFile.auto('data/proteins.faa')
Dir['content/markup/*/*'].each do |file|
file =~ /\d+-\d+-\d+/
date = Regexp.last_match(0) + ' 00:00 GMT'
file =~ /\d+-\d+-\d+-(.+).markdown$/
title = Regexp.last_match(1)
english_title = title.gsub('-',' ').capitalize
content = File.open(file) do |pipe|
pipe.readline