Skip to content

Commit

Permalink
update Sequence type error message
Browse files Browse the repository at this point in the history
  • Loading branch information
IsmailM committed Sep 30, 2018
1 parent ac3d201 commit 3508605
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
2 changes: 1 addition & 1 deletion lib/genevalidator/blast.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def print_blast_info_text(remote)
if remote
warn '==> BLAST search and subsequent analysis will be done on a remote'
warn ' database. Please use a local database for larger analysis.'
else
else
warn '==> Running BLAST. This may take a while.'
end
warn '' # a blank line
Expand Down
9 changes: 0 additions & 9 deletions lib/genevalidator/exceptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,6 @@ module GeneValidator
class ClasspathError < RuntimeError
end

# Exception raised when the command line type argument
# does not corrsepond to the type of the sequences in the fasta file
class SequenceTypeError < RuntimeError
def to_s
"\nSequence Type error: Possible cause include that the blast output" \
" was not obtained against a protein database.\n"
end
end

# Exception raised when an unexisting file is accessed
class FileNotFoundException < RuntimeError
end
Expand Down
11 changes: 5 additions & 6 deletions lib/genevalidator/hsp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,11 @@ def init_tabular_attribute(hash)

def assert_seq_type(query)
seq_type = BlastUtils.guess_sequence_type(query)
raise SequenceTypeError if seq_type != :protein
rescue SequenceTypeError
warn '*** A BLAST Hit failed the sequence-type validation (i.e. the BLAST'
warn ' hit sequence seems to be a nucleotide sequence).'
warn ' Ensure that the BLAST database used is a protein database.'
warn ' Ignoring and continuing with analysis.'
return if seq_type == :protein
warn '*** A BLAST hit looks like a nucleotide sequence. Continuing' \
' with the analysis anyway.'
warn ' Make sure that you used a protein database or the analysis' \
' results will be incorrect!'
end
end
end

0 comments on commit 3508605

Please sign in to comment.