//----------------------------------------------------------------------------------- // Construction //----------------------------------------------------------------------------------- public EnumeratedSequenceAllocator(EnumeratedNucleotideSequence seq, NadirAST nodeDefinition, SequenceDesigner designer) // We require that all our domains have the same enumerated sequence, but that // doesn't mean that they all share the same id (why?). (eh?) { Trace.Assert(seq != null); this.enumeratedSequence = seq; this.nodeSequenceDefinition = nodeDefinition; this.designer = designer; // if (this.enumeratedSequence.Length != 0) { if (this.HasLength && this.Length != this.enumeratedSequence.Length) throw new InconsistentLengthException(this.Length); } // AddAllocationPattern(this.enumeratedSequence.UndecoratedPattern); // // We always verify both the normal and the complement form, as that's // easier than reliably keeping track of which of those two forms is // actually used in an actual strand. We wish we could be more careful about // that, because if we could keep track, it'd be a big perf improvement. // this.normalVerifier = new EnumeratedSequenceVerifier(this, false, designer); this.complementaryVerifier = new EnumeratedSequenceVerifier(this, true, designer); }
// public override string DisplayName { get { return this.Domains[0].DisplayName; } } // //----------------------------------------------------------------------------------- // Construction //----------------------------------------------------------------------------------- public EnumeratedSequenceVerifier(EnumeratedSequenceAllocator allocator, bool isComplemented, SequenceDesigner designer) : base(designer) { this.EnumeratedSequence = allocator.EnumeratedSequence; this.EnumeratedSequenceAllocator = allocator; this.IsComplemented = isComplemented; }
EnumeratedSequenceAllocator AllocatorOf(EnumeratedNucleotideSequence seq) { return designer.mpIdEnumSeqAllocator[seq.Id]; }