private void ValidateSQHeader(string refSeqName)
{
if (refSeqName != Properties.Resource.SAM_NO_REFERENCE_DEFINED_INDICATOR)// the '*' to indicate the read is unmapped
{
string message;
List<SequenceRange> rages = this.refSequences.Where(SR => string.Compare(SR.ID, refSeqName, StringComparison.OrdinalIgnoreCase) == 0).ToList();
if (rages.Count == 0)
{
message = string.Format(CultureInfo.InvariantCulture, Properties.Resource.SQHeaderMissing, refSeqName, CultureInfo.CurrentCulture);
throw new ArgumentException(message);
}
if (rages.Count > 1)
{
message = string.Format(CultureInfo.InvariantCulture, Properties.Resource.DuplicateSQHeader, refSeqName, CultureInfo.CurrentCulture);
throw new ArgumentException(message);
}
}
}