X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Refs.h;h=67c5d57a349ab589a479b6ac0608058e86cb973e;hb=791b978145b0d22865ee350db9d58072bb99d816;hp=f411622f0cfb74c974db580e8e16091f1503d16d;hpb=3ec78aa9af79921c44d62b65f88865a4b65880be;p=rsem.git diff --git a/Refs.h b/Refs.h index f411622..67c5d57 100644 --- a/Refs.h +++ b/Refs.h @@ -52,7 +52,7 @@ class Refs { } bool isValid(int sid, int dir, int pos, const std::string& readseq, int LEN, int C) { - if (sid <= 0 || sid > M || dir != 0 && dir != 1 || pos < 0 || pos + LEN > seqs[sid].getTotLen() || LEN > (int)readseq.length()) return false; + if (sid <= 0 || sid > M || (dir != 0 && dir != 1) || pos < 0 || pos + LEN > seqs[sid].getTotLen() || LEN > (int)readseq.length()) return false; const std::string& seq = seqs[sid].getSeq(dir); return countMismatch(seq, pos, readseq, LEN, C) <= C; } @@ -97,7 +97,10 @@ void Refs::makeRefs(char *inpF, RefSeqPolicy& policy, PolyARules& rules) { while((pt = getline(fin, line)) && line[0] != '>') { rawseq += line; } - assert(rawseq.size() > 0); + if (rawseq.size() <= 0) { + printf("Warning: Fasta entry %s has an empty sequence! It is omitted!\n", tag.c_str()); + continue; + } ++M; seqs.push_back(RefSeq(tag, policy.convert(rawseq), rules.getLenAt(tag))); }