Exemplo n.º 1
0
 public static ThermodynamicsResult ComputeThermodynamics(INucleotideSequence seq, ExperimentalConfiguration config) // const
     {
     return ThermodynamicsData.ComputeThermodynamics(config, seq.Nucleotides, Strand.IsFivePrimePhosphorylated(seq)?1:0);
     }
Exemplo n.º 2
0
    //------------------------------------------------------------------
    // INamedSequence

    public abstract string GetDecoratedName(string coreName, PrettyPrintContext context, INucleotideSequence root, NAMED_SEQUENCE_DECORATOR caller, out NAMED_SEQUENCE_DECORATOR callee);
Exemplo n.º 3
0
 public void UpdateThermodynamics(ExperimentalConfiguration config, INucleotideSequence sequence)
     {
     if (config != this.Configuration || sequence.Nucleotides != this.Nucleotides)
         { 
         this.Nucleotides    = sequence.Nucleotides;
         this.Configuration  = config;
         this.Thermodynamics = ComputeThermodynamics(sequence, config);
         }
     }
Exemplo n.º 4
0
    //--------------------------------------------------------------------------
    // INamedSequence

    public override string GetDecoratedName(string coreName, PrettyPrintContext ppContext, INucleotideSequence root, NAMED_SEQUENCE_DECORATOR caller, out NAMED_SEQUENCE_DECORATOR callee)
        {
        return this.GetDecoratedNameDoubleHelper(coreName, ppContext, root, caller, out callee, "{0}'", NAMED_SEQUENCE_DECORATOR.COMPLEMENT);
        }
Exemplo n.º 5
0
    //--------------------------------------------------------------------------
    // Construction

    public ExtractedSequence(DistillationContext context, SymbolTable symtab, INucleotideSequence target, int intFirst, int cnt) : base(context, symtab, target)
        {
        this.id = EnumeratedNucleotideSequence.NewId();
        //
        StringExtractor.Confine(0, target.Length, ref intFirst, ref cnt); // note, though: target's length can change
        this.stringExtractor = new StringExtractor(intFirst, cnt);
        //
        this.isOurDecoration = dec => 
            { 
            if (dec.Ich >= this.stringExtractor.IchFirst && dec.Ich < this.stringExtractor.IchMax)
                return true;
            if (this.stringExtractor.IchFirst == 0 && dec.Ich < 0)
                return true;
            if (this.stringExtractor.IchMax >= this.target.Length && dec.Ich == this.target.Length)
                return true;
            return false; 
            };
        }
Exemplo n.º 6
0
    //--------------------------------------------------------------------------
    // Construction

    ComplementedSequence(DistillationContext context, SymbolTable symtab, INucleotideSequence target) : base(context, symtab, target)
        {
        }
Exemplo n.º 7
0
 public static INucleotideSequence Create(DistillationContext context, SymbolTable symtab, INucleotideSequence target)
     {
     return new ComplementedSequence(context, symtab, target);
     }
Exemplo n.º 8
0
 public static INucleotideSequence Create(IReverseSequenceIdContainer idmgr, DistillationContext context, SymbolTable symtab, INucleotideSequence target)
     {
     return new ReversedSequence(idmgr, context, symtab, target);
     }
Exemplo n.º 9
0
    //--------------------------------------------------------------------------
    // INamedSequence

    public override string GetDecoratedName(string coreName, PrettyPrintContext context, INucleotideSequence root, NAMED_SEQUENCE_DECORATOR caller, out NAMED_SEQUENCE_DECORATOR callee)
        {
        return this.GetDecoratedNameDoubleHelper(coreName, context, root, caller, out callee, "reversed({0})", NAMED_SEQUENCE_DECORATOR.REVERSE);
        }
Exemplo n.º 10
0
    //--------------------------------------------------------------------------
    // Construction

    ReversedSequence(IReverseSequenceIdContainer idmgr, DistillationContext context, SymbolTable symtab, INucleotideSequence target) : base(context, symtab, target)
        {
        this.id = idmgr.IdForReversedTarget(target.Id);
        }
Exemplo n.º 11
0
 protected string GetDecoratedNameDoubleHelper(string coreName, PrettyPrintContext context, INucleotideSequence root, NAMED_SEQUENCE_DECORATOR caller, out NAMED_SEQUENCE_DECORATOR callee, 
         string format, 
         NAMED_SEQUENCE_DECORATOR usFlavor
         )
 // Shared code for reversing and complementing
     {
     callee = usFlavor;
     //
     if (this == root)
         return context.FormatDisplayName(coreName, this.Id);
     //
     if (this.target is INamedSequence)
         {
         INamedSequence decorator = this.target as INamedSequence;
         NAMED_SEQUENCE_DECORATOR decoratorFlavor;
         if (caller == usFlavor)
             {
             // us and caller are of same flavor: just forward on to the target so that the two cancel
             return decorator.GetDecoratedName(coreName, context, root, NAMED_SEQUENCE_DECORATOR.NONE, out decoratorFlavor);
             }
         else
             {
             // get from target
             string his = (this.target as INamedSequence).GetDecoratedName(coreName, context, root, usFlavor, out decoratorFlavor);
             //
             if (decoratorFlavor==usFlavor)
                 return his;
             else
                 return string.Format(format, his);
             }
         }
     return string.Format(format, context.FormatDisplayName(coreName, this.Id));
     }
Exemplo n.º 12
0
    //--------------------------------------------------------------------------
    // INamedSequence

    public override string GetDecoratedName(string coreName, PrettyPrintContext context, INucleotideSequence root, NAMED_SEQUENCE_DECORATOR caller, out NAMED_SEQUENCE_DECORATOR callee)
    // Default implementation that just stops at us if we're the root and forwards on to target if not
        {
        callee = NAMED_SEQUENCE_DECORATOR.NONE;
        //
        if (this == root)
            return context.FormatDisplayName(coreName, this.Id);
        //
        if (this.target is INamedSequence)
            {
            INamedSequence decorator = this.target as INamedSequence;
            NAMED_SEQUENCE_DECORATOR decoratorFlavor;
            return decorator.GetDecoratedName(coreName, context, root, NAMED_SEQUENCE_DECORATOR.NONE, out decoratorFlavor);
            }
        //
        return context.FormatDisplayName(coreName, this.Id);
        }
Exemplo n.º 13
0
    //--------------------------------------------------------------------------
    // Construction

    public ComputedSequence(DistillationContext context, SymbolTable symtab, INucleotideSequence target) : base(context, symtab)
        {
        this.target = target;
        }
Exemplo n.º 14
0
    //--------------------------------------------------------------------------
    // INamedSequence

    public override string GetDecoratedName(string coreName, PrettyPrintContext context, INucleotideSequence root, NAMED_SEQUENCE_DECORATOR caller, out NAMED_SEQUENCE_DECORATOR callee)
        {
        callee = NAMED_SEQUENCE_DECORATOR.NONE;
        return context.FormatDisplayName(coreName, this.Id);
        }