Exemplo n.º 1
0
        /// <summary>
        /// Get the alignment results
        /// </summary>
        /// <param name="serviceParameters">job id, control id</param>
        /// <returns>alignment</returns>
        public ClustalWResult FetchResultsAsync(ServiceParameters serviceParameters)
        {
            string output = _baseClient.GetOutputAsString(serviceParameters.JobId, serviceParameters.Parameters[CONTROLID].ToString());
            IList <ISequenceAlignment> alignments = _ClustalWParser.Parse(new StringReader(output));

            return(new ClustalWResult(alignments[0]));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Get the alignment results
        /// </summary>
        /// <param name="serviceParameters">job id, control id</param>
        /// <returns>alignment</returns>
        public ClustalWResult FetchResultsAsync(ServiceParameters serviceParameters)
        {
            IList <ISequenceAlignment> alignments = null;

            if (null == serviceParameters)
            {
                throw new ArgumentNullException("Parameters");
            }
            string output = _baseClient.GetOutputAsString(serviceParameters.JobId, serviceParameters.Parameters[CONTROLID].ToString());

            using (StringReader reader = new StringReader(output))
            {
                alignments = _ClustalWParser.Parse(reader);
            }

            return(new ClustalWResult(alignments[0]));
        }
 /// <summary>
 /// Parses the sequences from the given filename.
 /// </summary>
 /// <param name="parser">Sequence Parser</param>
 /// <param name="fileName">Filename to open/close</param>
 /// <returns>Set of parsed sequences.</returns>
 public static IEnumerable <ISequenceAlignment> Parse(this ISequenceAlignmentParser parser, string fileName)
 {
     using (FileStream fs = File.OpenRead(fileName))
     {
         foreach (var item in parser.Parse(fs))
         {
             yield return(item);
         }
     }
 }
        /// <summary>
        /// Parses the sequences from the open file.
        /// </summary>
        /// <param name="parser">Sequence Parser</param>
        /// <returns>Set of parsed sequences.</returns>
        public static IEnumerable <ISequenceAlignment> Parse(this ISequenceAlignmentParser parser)
        {
            var fs = ParserFormatterExtensions <ISequenceAlignmentParser> .GetOpenStream(parser, false);

            if (fs == null)
            {
                throw new Exception("You must open a parser before calling Parse.");
            }

            return(parser.Parse(fs));
        }
Exemplo n.º 5
0
        public void ValidateSamParserWithDVIscFile()
        {
            // Gets the expected sequence from the Xml
            string filePath = _utilityObj._xmlUtil.GetTextValue(
                Constants.SAMFileWithRefNode, Constants.FilePathNode);

            ISequenceAlignmentParser iSeqParser =
                SequenceAlignmentParsers.FindParserByFile(filePath);

            if (null != iSeqParser)
            {
                IVirtualSequenceAlignmentParser vParserObj =
                    iSeqParser as IVirtualSequenceAlignmentParser;
                if (null != vParserObj)
                {
                    vParserObj.EnforceDataVirtualization = true;
                }
                else
                {
                    Assert.Fail("SAM P1 Cases : Could not find the SAM Parser Object.");
                }

                string iscFilePath =
                    string.Concat(filePath, ".isc");

                iSeqParser.Parse(filePath);

                if (File.Exists(iscFilePath))
                {
                    Console.WriteLine(
                        "SAM P1 Cases : DV enabled as expected and isc file created successfully.");
                    ApplicationLog.WriteLine(
                        "SAM P1 Cases : DV enabled as expected and isc file created successfully.");
                }
                else
                {
                    Assert.Fail("SAM P1 Cases : DV not enabled as expected.");
                }
            }
            else
            {
                Assert.Fail("SAM P1 Cases : Could not find the SAM file");
            }
        }