Sha256: 3d8e875e960e26764fd2d905a7b0eca12c84b6fe4e73ad47bcbf946bd8301b25

Contents?: true

Size: 1.67 KB

Versions: 5

Compression:

Stored size: 1.67 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
	# UNMAPPED CONTIG DETECTION
	if query.nil? && seq.unmapped? #If seq is misassembled stop chimera analisys
		seq.hit = nil
		artifact = true
		seq.type = UNMAPPED
	end

	if !query.nil?
		# MISASSEMBLED DETECTION
		if !artifact && 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
	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-1.0.6 lib/full_lengther_next/artifacts.rb
full_lengther_next-1.0.5 lib/full_lengther_next/artifacts.rb
full_lengther_next-1.0.4 lib/full_lengther_next/artifacts.rb
full_lengther_next-1.0.3 lib/full_lengther_next/artifacts.rb
full_lengther_next-1.0.2 lib/full_lengther_next/artifacts.rb