Class: OneBlast

Inherits:
Object
  • Object
show all
Defined in:
lib/seqtrimnext/classes/one_blast.rb

Instance Method Summary collapse

Constructor Details

#initialize(database, blast_type = 'blastp') ⇒ OneBlast

Returns a new instance of OneBlast.



5
6
7
8
9
10
# File 'lib/seqtrimnext/classes/one_blast.rb', line 5

def initialize(database, blast_type = 'blastp')

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

Instance Method Details

#closeObject



35
36
37
# File 'lib/seqtrimnext/classes/one_blast.rb', line 35

def close

end

#do_blast(seq_fasta) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# 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