示例#1
0
        /// <summary>
        /// Resolve ambuiguity in the delta alignments.
        /// </summary>
        public void ResolveAmbiguity()
        {
            TimeSpan  repeatResolutionSpan = new TimeSpan();
            Stopwatch runRepeatResolution  = new Stopwatch();
            FileInfo  inputFileinfo        = new FileInfo(this.FilePath);
            long      inputFileLength      = inputFileinfo.Length;

            inputFileinfo = null;

            runRepeatResolution.Restart();
            DeltaAlignmentParser parser = new DeltaAlignmentParser(this.FilePath);
            IList <IEnumerable <DeltaAlignment> > deltas = parser.Parse();

            runRepeatResolution.Stop();

            if (this.Verbose)
            {
                Console.WriteLine();
                Console.WriteLine("  Processed DeltaAlignment file: {0}", Path.GetFullPath(this.FilePath));
                Console.WriteLine("            Read/Processing time: {0}", runRepeatResolution.Elapsed);
                Console.WriteLine("            File Size           : {0}", inputFileLength);
            }

            runRepeatResolution.Restart();
            List <DeltaAlignment> outputDeltas        = RepeatResolver.ResolveAmbiguity(deltas);
            List <DeltaAlignment> orderedOutputDeltas = outputDeltas.OrderBy(a => a.FirstSequenceStart).ToList();

            runRepeatResolution.Stop();
            repeatResolutionSpan = repeatResolutionSpan.Add(runRepeatResolution.Elapsed);

            runRepeatResolution.Restart();
            this.WriteDelta(orderedOutputDeltas);
            runRepeatResolution.Stop();


            if (this.Verbose)
            {
                Console.WriteLine("  Compute time: {0}", repeatResolutionSpan);
                Console.WriteLine("  Write() time: {0}", runRepeatResolution.Elapsed);
            }
        }
示例#2
0
        /// <summary>
        /// Refine layout in the delta alignments.
        /// </summary>
        public void GenerateConsensus()
        {
            TimeSpan  timeSpan        = new TimeSpan();
            Stopwatch runAlgorithm    = new Stopwatch();
            FileInfo  inputFileinfo   = new FileInfo(this.FilePath);
            long      inputFileLength = inputFileinfo.Length;

            inputFileinfo = null;

            runAlgorithm.Restart();
            DeltaAlignmentParser   parser = new DeltaAlignmentParser(this.FilePath);
            IList <DeltaAlignment> deltas = parser.Parse();

            runAlgorithm.Stop();

            if (this.Verbose)
            {
                Console.WriteLine();
                Console.WriteLine("  Processed DeltaAlignment file: {0}", Path.GetFullPath(this.FilePath));
                Console.WriteLine("            Read/Processing time: {0}", runAlgorithm.Elapsed);
                Console.WriteLine("            File Size           : {0}", inputFileLength);
            }

            runAlgorithm.Restart();
            IEnumerable <ISequence> consensus = ConsensusGeneration.GenerateConsensus(deltas);

            runAlgorithm.Stop();
            timeSpan = timeSpan.Add(runAlgorithm.Elapsed);

            runAlgorithm.Restart();
            this.WriteSequences(consensus);
            runAlgorithm.Stop();


            if (this.Verbose)
            {
                Console.WriteLine("  Compute time: {0}", timeSpan);
                Console.WriteLine("  Write() time: {0}", runAlgorithm.Elapsed);
            }
        }