Пример #1
0
        public void ValidateSAMParseAlignedSeqWithSeqPointer()
        {
            // Get values from XML node.
            string expectedSequence = Utility._xmlUtil.GetTextValue(
                Constants.SAMFileWithAllFieldsNode, Constants.ExpectedSeqWithPointersNode);
            string samFilePath = Utility._xmlUtil.GetTextValue(
                Constants.SAMFileWithAllFieldsNode, Constants.FilePathNode);
            string lineNumberForPointer = Utility._xmlUtil.GetTextValue(
                Constants.SAMFileWithAllFieldsNode, Constants.LineNumberToPointNode);

            // Parse a SAM file
            SAMParser parserObj = new SAMParser();

            parserObj.EnforceDataVirtualization = true;

            SequenceAlignmentMap seqList = parserObj.Parse(samFilePath);

            Assert.IsNotNull(seqList);

            // Get a pointer object
            SequencePointer pointerObj = GetSequencePointer(Int32.Parse(lineNumberForPointer));

            pointerObj.IndexOffsets[0] = 156;
            pointerObj.IndexOffsets[1] = 304;

            // Parse a SAM file using Sequence Pointer.
            SAMAlignedSequence alignedSeq = (SAMAlignedSequence)parserObj.ParseAlignedSequence(pointerObj);

            // Validate parsed SAM aligned sequence.
            Assert.AreEqual(expectedSequence,
                            alignedSeq.QuerySequence.ToString());

            Console.WriteLine(string.Format(null,
                                            "SAM Parser BVT : Sequence alignment aligned seq {0} validate successfully",
                                            alignedSeq.Sequences[0].ToString()));
            ApplicationLog.WriteLine(string.Format(null,
                                                   "SAM Parser BVT : Sequence alignment aligned seq validate successfully"));
        }