class OneBlast

Public Class Methods

new(database, blast_type = 'blastp') click to toggle source
# File lib/seqtrimnext/classes/one_blast.rb, line 5
def initialize(database, blast_type = 'blastp')

                @blast_type = blast_type
    @database = database
    @c=0 
end

Public Instance Methods

close() click to toggle source
# File lib/seqtrimnext/classes/one_blast.rb, line 35
def close

end
do_blast(seq_fasta) click to toggle source
# File lib/seqtrimnext/classes/one_blast.rb, line 13
def do_blast(seq_fasta)

        @f = File.new('one_blast_aux.fasta','w+')
        @f.puts ">SEQNAME_"+@c.to_s
        @f.puts seq_fasta
        @c = @c+1                      
        @f.close

    cmd = '~blast/programs/x86_64/bin/blastall -p '+@blast_type+' -d '+@database + ' -i one_blast_aux.fasta -o one_blast_aux.out'
        #puts cmd
        system(cmd)

    res =''
    File.open('one_blast_aux.out').each_line { |line|

        res = line
        

    }

end