Skip to content

Instantly share code, notes, and snippets.

View drio's full-sized avatar
🐢
I don't know

David Rio drio

🐢
I don't know
View GitHub Profile
class DBEvent
attr_accessor :ref, :o_events, :sp
def initialize(sp, events)
@sp = sp
@ref = events.split('/')[0]
@raw_events = events
@o_events = Hash.new(Array.new) # Observed events
# Iterate over each observed event
#!/usr/bin/env ruby
# Generate random genomes:
#
# Creates a random genome with the number of contig you specify.
# You can pass the number of characters per line and the max size
# of the contigs.
#
class RandomGenome
# + hr: root string for the headers
#!/usr/bin/env ruby
# Basic Statistical Methods Module
# accepts: an array, the population/list
# returns: Result of running the measure (std_dev, mean, median)
#
module StatisticalTools
def self.std_dev(population)
n = 0
mean = 0.0
# one 1_1 2_1 two 1_2 2_2
def foo(h1, h2)
tmp = Hash.new {|hash, key| hash[key] = "" }
h1.each {|k,v| tmp[k] << v }
h2.each {|k,v| tmp[k] << " " + v }
tmp
end
hash1 = { "one" => "1_1" , "two" => "1_2" }
pb # reads used: 151750
ovarian # reads used: 639290
Number of reads that map with n mismatches: (for ovarian.psl)
---------
0:500848
1:6413
2:29
3:10
##gff-version 2
##solid-gff-version 0.2
##date 2009-03-30
##time 17:56:07
##color-code AA=0,AC=1,AG=2,AT=3,CA=1,CC=0,CG=3,CT=2,GA=2,GC=3,GG=0,GT=1,TA=3,TC=2,TG=1,TT=0
##primer-base F3=T
##max-num-mismatches 2
##max-read-length 25
##line-order fragment
##conversion unique
pipeline@head0100 / $ source /opt/matlabruntime/matlab.env && /share/apps/corona-1.0r9.9/bin/sunspot -v
Loading matlab 2006a 64-bit
Warning: Unable to open display , MATLAB is starting without a display.
You will not be able to display graphics on the screen.
Warning:
MATLAB is starting without a display, using internal event queue.
You will not be able to display graphics on the screen.
*** Applied Biosystems SOLiD Basecalling Analysis Software ***
'sunspot' version 1.0.4 (9.9, SVN 20186, 2008-06-26)
module FindFiles
def self.find(ldirs, re)
dirs = dirs.is_a?(String) ? File.open(ldirs).readlines : ldirs
your_files = []
dirs.each do |d|
Dir["#{d}/*"].each { |f| your_files << f if f =~ re }
end
your_files
end
end
#!/users/p-solid/local/bin/ruby19
#
# If you want to run against multiple data sets:
# ruby -e 'File.open(Dir["list*"].join).each_line{|l| puts "./create_splits.rb {File.basename(l.chomp)} #{l.chomp}"}'
#
require 'fileutils'
def run_lsf(str)
bs = "bsub -q solid -J GBM_drio_splits '#{str}'"
puts bs
#!/users/p-solid/local/bin/ruby19
#
# If you want to run against multiple data sets:
# ruby -e 'File.open(Dir["list*"].join).each_line{|l| puts "./create_splits.rb {File.basename(l.chomp)} #{l.chomp}"}'
#
require 'fileutils'
def run_lsf(str)
bs = "bsub -q solid -J GBM_drio_splits '#{str}'"
puts bs