Sha256: 651f1e671241af761b0693cec37dd8cdcbcaea11ce54737c9e5aa7fef64b96c5

Contents?: true

Size: 1.44 KB

Versions: 5

Compression:

Stored size: 1.44 KB

Contents

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



Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
full_lengther_next-0.6.2 lib/full_lengther_next/classes/artifacts.rb
full_lengther_next-0.6.1 lib/full_lengther_next/classes/artifacts.rb
full_lengther_next-0.6.0 lib/full_lengther_next/classes/artifacts.rb
full_lengther_next-0.5.7 lib/full_lengther_next/classes/artifacts.rb
full_lengther_next-0.5.6 lib/full_lengther_next/classes/artifacts.rb