X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=bp_bin%2Fread_fastq;h=494797cae6f3b5f32bdbbd896817fb8cb889f4be;hb=6b4c2afa4b4b581a9c36083a1d059e846ee4b560;hp=c2f74cd7bb7a07219ac43ecfd574ad726f5b8f00;hpb=dae2e0bf49297310be0ca6a5a626de196691557f;p=biopieces.git diff --git a/bp_bin/read_fastq b/bp_bin/read_fastq index c2f74cd..494797c 100755 --- a/bp_bin/read_fastq +++ b/bp_bin/read_fastq @@ -1,6 +1,6 @@ #!/usr/bin/env ruby -# Copyright (C) 2007-2011 Martin A. Hansen. +# Copyright (C) 2007-2013 Martin A. Hansen. # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -40,8 +40,9 @@ casts << {:long=>'encoding', :short=>'e', :type=>'string', :mandatory=>false, :d options = Biopieces.options_parse(ARGV, casts) -num = 0 -last = false +num = 0 +first = true +last = false Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output| unless options[:data_in] and options[:data_in].first == '-' @@ -64,6 +65,9 @@ Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output| else raise SeqError, "Could not auto-detect quality score encoding" end + elsif first + raise SeqError, "Quality score outside valid range" unless entry.qual_valid?(encoding) + first = false end entry.convert_scores!(encoding, 'illumina13')