Exemplo n.º 1
0
        protected CodonBase(IGeneticCode geneticCode, ICodonIdentifier codonIdentifier, CodonType codonType,
            IEnumerable<INucleotide> nucleotides)
        {
            this.CodonIdentifier = codonIdentifier;
            this.CodonType = codonType;
            this.Nucleotides = nucleotides as List<INucleotide> ?? nucleotides.ToList();

            if (this.Nucleotides.Count() != geneticCode.CodonLength)
                throw new GeneticCodeException("All Codons must be of the specified CodonLength in the Genetic Code.");
        }
 /// <summary>
 /// Retrieves the first IGEPCodon of the specified CodonType that primarily 
 /// encodes for the IFunction as identified
 /// by the given IFunctionIdentifier.
 /// </summary>
 /// <param name="functionIdentifier"></param>
 /// <param name="codonType"></param>
 /// <returns></returns>
 public abstract IGEPCodon GetCodonEncodingFunction(IFunctionIdentifier functionIdentifier, CodonType codonType = CodonType.Standard);
 public override void SetCodonType(ICodonIdentifier codonIdentifier, CodonType codonType)
 {
     Qry.Update(DM.Codon.CodonType, codonType.ToString())
         .Where(DM.Codon.Name, codonIdentifier.ToString())
         .Go();
 }
        public override IGEPCodon GetCodonEncodingFunction(IFunctionIdentifier functionIdentifier, CodonType codonType = CodonType.Standard)
        {
            var codonRow = new CodonRow();
            Qry.SelectAllFrom(codonRow)
                .InnerJoinSelectingAllOn(codonRow.FunctionPairRowColumn)
                .InnerJoinOn(codonRow.FunctionPairRow.PrimaryFunctionRowColumn)
                .Where(codonRow.CodonTypeColumn, codonType.ToString())
                .Where(codonRow.FunctionPairRow.PrimaryFunctionRow.FunctionIdentifierColumn, functionIdentifier.ToString())
                .GoAndExtract(ref codonRow);

            return codonRow.ToGEPCodon(this);
        }
Exemplo n.º 5
0
 /// <summary>
 /// Sets the ICodon as specified by the given ICodonIdentifier to the specified CodonType.
 /// </summary>
 /// <param name="codonIdentifier"></param>
 /// <param name="codonType"></param>
 public abstract void SetCodonType(ICodonIdentifier codonIdentifier, CodonType codonType);
 public override void SetCodonType(ICodonIdentifier codonIdentifier, CodonType codonType)
 {
     this.Codons[codonIdentifier].CodonType = codonType;
 }
 public override IGEPCodon GetCodonEncodingFunction(IFunctionIdentifier functionIdentifier, CodonType codonType = CodonType.Standard)
 {
     return this.Codons.FirstOrDefault(c => c.Value.CodonType == codonType && c.Value.Functions.PrimaryFunction.Equals(functionIdentifier)).Value;
 }
Exemplo n.º 8
0
 protected CodonBase(IGeneticCode geneticCode, ICodonIdentifier codonIdentifier, CodonType codonType,
     IEnumerable<INucleotideIdentifier> nucleotides) :
     this(geneticCode: geneticCode, codonIdentifier: codonIdentifier, codonType: codonType,
     nucleotides: nucleotides.Select(i => geneticCode.Nucleotides[i]))
 {
 }
Exemplo n.º 9
0
 protected GEPCodonBase(IGEPGeneticCode geneticCode, ICodonIdentifier codonIdentifier, 
     CodonType codonType, IEnumerable<INucleotide> nucleotides, IFunctionPair functions) 
     : base(geneticCode, codonIdentifier, codonType, nucleotides)
 {
     this.Functions = functions;
 }