Created
April 23, 2009 15:08
-
-
Save drio/100536 to your computer and use it in GitHub Desktop.
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
#!/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 | |
system bs | |
end | |
def run(str) | |
puts str | |
system str | |
end | |
split_size = "25000000" | |
run_name = ARGV[0] | |
csfasta = ARGV[1] | |
if ARGV.size != 2 | |
puts "Usage: #{__FILE__} <run_name> <csfasta>" | |
exit 1 | |
end | |
raise "./splits not found" unless File.exists?("./splits") | |
Dir.chdir("./splits") | |
raise "#{run_name} dir already exists" if File.exists?(run_name) | |
FileUtils.mkdir run_name | |
Dir.chdir(run_name) | |
run_lsf "cat #{csfasta} | grep -v '^#' | split -a4 -d -l #{split_size}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment