module NcRna 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.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 end