//-----------------------------------------------------------------------------------
    // 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);
        }
示例#2
0
 public void PrintFinalOutput(SequenceDesigner designer, NadirContext context)
     {
     FixDomainNames(this.resultToOutput);
     if (designer != null)
         OutputResult(designer.Context, this.resultToOutput, designer.Context.Scoring.BestScores);
     else
         OutputResult(new SequenceDesignContext(context), this.resultToOutput, new SortedList<DesignScoreResult, SequencesSaveState>());
     }
示例#3
0
 public Mutator(SequenceDesigner designer, AllocationStatistics stats)
     {
     this.designer          = designer;
     this.stats             = stats;
     this.sweepInProgress   = false;
     bool isInosineUsed     = designer.mutableAllocators.Select(alloc => alloc.AllowsAnyMutableInosine).Aggregate((before, cur) => before || cur);
     this.iNtMax            = isInosineUsed ? rgchNucleotides.Length : rgchNucleotides.Length - 1;
     this.allowUpHill       = false;
     ResetSweep();
     }
示例#4
0
 public void PrintInterimOuput(SequenceDesigner designer)
     {
     FixDomainNames(this.distillationResult);
     OutputResult(designer.Context, this.distillationResult, designer.Context.Scoring.BestScores);
     }
示例#5
0
    //-----------------------------------------------------------------------------------
    // Ctor
    //-----------------------------------------------------------------------------------

    public Verifier(SequenceDesigner designer)
        {
        this.Designer = designer;
        }
示例#6
0
    // 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;
        }
示例#7
0
    //-----------------------------------------------------------------------------------
    // Construction
    //-----------------------------------------------------------------------------------

    public StrandVerifier(Strand strand, SequenceDesigner designer) : base(designer)
        {
        this.strand = strand;
        }