Exemplo n.º 1
0
        /// <summary>
        /// Validate short visit.
        /// </summary>
        /// <param name="item"></param>
        public void Visit(ShortDataItem item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            AB_RootDataTag tag = RetrieveTag(item);

            ValidateAreEqual(GetData(tag.Value, value => short.Parse(value, CultureInfo.InvariantCulture)), item.Value);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Visit short item.
 /// </summary>
 /// <param name="item"></param>
 public void Visit(ShortDataItem item)
 {
     if (item == null)
     {
         throw new ArgumentNullException("item");
     }
     byte[] values = GetItemValue(item);
     item.Value =
         ParserHelper.ConvertSegmentsToArray(
             ParserHelper.SegmentArray(values, 2, true),
             (segment => BitConverter.ToInt16(segment, 0)));
     Context.DataItems.Add(item);
 }
        private static void LoadColorWheelData(Ab1Metadata metadata, IParserContext context)
        {
            List <KeyValuePair <byte, int> > nucleotideIndices = GetNucleotideDataIndex(context);
            IEnumerable <ShortDataItem>      dataItems         = context.DataItems.OfType <ShortDataItem>();

            nucleotideIndices.ForEach(
                pair =>
            {
                ShortDataItem item =
                    dataItems.First(i => i.Entry.TagNumber == pair.Value && i.Entry.TagName == Constants.DataTagName);
                metadata.SetColorData(
                    pair.Key,
                    new Ab1ColorData(metadata.PeakLocations, item.Value));
            });
        }