From 68fc457b73ae13f44a559db01b17203a18cc77ad Mon Sep 17 00:00:00 2001 From: "cmzmasek@gmail.com" Date: Wed, 3 Jul 2013 22:32:15 +0000 Subject: [PATCH] inprogress --- forester/ruby/scripts/copy.rb | 10 ++++++++++ forester/ruby/scripts/g.rb | 2 +- forester/ruby/scripts/gl.rb | 9 +++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 forester/ruby/scripts/copy.rb create mode 100644 forester/ruby/scripts/gl.rb diff --git a/forester/ruby/scripts/copy.rb b/forester/ruby/scripts/copy.rb new file mode 100644 index 0000000..2263329 --- /dev/null +++ b/forester/ruby/scripts/copy.rb @@ -0,0 +1,10 @@ +require 'fileutils' +Dir.foreach(".") do |f| + next if f == '.' or f == '..' + if f =~ /^([A-Z0-9]{3,5}).*\..+/ + tax = $1 + FileUtils.cp f, "all/" + tax + ".fasta" + elsif + puts "ignored " + f.to_s + end +end \ No newline at end of file diff --git a/forester/ruby/scripts/g.rb b/forester/ruby/scripts/g.rb index 6d1adf4..a4ccd52 100644 --- a/forester/ruby/scripts/g.rb +++ b/forester/ruby/scripts/g.rb @@ -1,6 +1,6 @@ File.open( "g" ) do | file | while line = file.gets - if line =~ /^(\S{3,5})\s+\S{3,5}/ + if line =~ /^([A-Z0-9]{3,5})/ puts "/home/czmasek/DATA/GENOME_HMMSCAN/CDHIT_095_PFAM270X/" + $1 + ".hmmscan " + $1 else puts line diff --git a/forester/ruby/scripts/gl.rb b/forester/ruby/scripts/gl.rb new file mode 100644 index 0000000..ebb99a9 --- /dev/null +++ b/forester/ruby/scripts/gl.rb @@ -0,0 +1,9 @@ +File.open( "gl.txt" ) do | file | + while line = file.gets + if line =~ /^([A-Z0-9]{3,5})/ + puts $1 + "\t" + "/home/czmasek/DATA/SEQUENCES/GENOMES/PROTEIN_PREDICTIONS_CDHIT_095/ALL/" + $1 + ".fasta" + else + puts line + end + end +end \ No newline at end of file -- 1.7.10.2