require 'blast_functions' require 'types' require 'chimeric_seqs' include ChimericSeqs ##################################################################### ## MAIN FUNCTION ##################################################################### def artifact?(seq, query, db_name, db_path, options, new_seqs) artifact = FALSE # MISASSEMBLED DETECTION if misassembled_detection(query) #If seq is misassembled stop chimera analisys seq.hit = query.hits.first artifact = TRUE seq.type = MISASSEMBLED seq.warnings('ERROR#1') end # OVERLAPPING HSPS ON SUBJECT DETECTION =begin if !artifact hit_reference = query.hits.first.dup query, overlapping = overlapping_hsps_on_subject(query) if overlapping if query.hits.first.nil? seq.hit = hit_reference else seq.hit = query.hits.first end artifact = TRUE seq.type = OTHER seq.warnings('ERROR#2') end end =end # MULTIPLE HSP DETECTION if !artifact && multiple_hsps(query, 3) seq.hit = query.hits.first seq.warnings('ERROR#3') end # CHIMERA DETECTION if !artifact && !options[:chimera].include?('d') chimera = search_chimeras(seq, query, options, db_name, db_path) if !chimera.nil? new_seqs.concat(chimera) seq.db_name = db_name seq.type = CHIMERA artifact = TRUE end end if artifact if $verbose > 1 puts seq.prot_annot_calification end seq.db_name = db_name seq.save_fasta = FALSE seq.ignore = TRUE end return artifact end