Module: NcRna

Defined in:
lib/full_lengther_next/classes/nc_rna.rb

Instance Method Summary collapse

Instance Method Details

#find_nc_rna(seq, blast_query) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/full_lengther_next/classes/nc_rna.rb', line 4

def find_nc_rna(seq, blast_query)
	
	# used to detect if the sequence and the blast are from different query
	if seq.seq_name != blast_query.query_def
		raise "BLAST query name and sequence are different"
	end
	
	q=blast_query
	
	if (!q.hits[0].nil?) # There is match in blast.
		nc_annotations = "#{q.query_def}\t#{seq.fasta_length}\t#{q.hits[0].acc}\tncRNA\tPutative ncRNA\t\t#{q.hits[0].e_val}\t#{q.hits[0].ident}\t\t\t\t#{q.hits[0].q_frame}\t#{q.hits[0].q_beg}\t#{q.hits[0].q_end}\t#{q.hits[0].s_beg.to_i}\t#{q.hits[0].s_end.to_i}\t#{q.hits[0].definition}\t"
		seq.annotate(:ncrna,nc_annotations,true)
	else
		unknown_annot = seq.get_annotations(:tcode_unknown).first
		seq.annotate(:tcode, unknown_annot[:message],true)
	end
end