Пример #1
0
 public bool Equals(ICodonIdentifier other)
 {
     if (other == null)
         return false;
     else if (other is CodonIdentifier)
         return this.Identifier == ((CodonIdentifier)other).Identifier;
     else
         return false;
 }
Пример #2
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.");
        }
Пример #3
0
 public int CompareTo(ICodonIdentifier other)
 {
     return this.Identifier.CompareTo(other.ToString());
 }
 public override void SetCodonType(ICodonIdentifier codonIdentifier, CodonType codonType)
 {
     Qry.Update(DM.Codon.CodonType, codonType.ToString())
         .Where(DM.Codon.Name, codonIdentifier.ToString())
         .Go();
 }
 public override ICodon GetCodon(ICodonIdentifier codonIdentifier)
 {
     var codonRow = new CodonRow();
     Qry.SelectAllFrom(codonRow)
         .InnerJoinSelectingAllOn(codonRow.FunctionPairRowColumn)
         .Where(codonRow.NameColumn, codonIdentifier.ToString())
         .GoAndExtract(ref codonRow);
     return codonRow.ToGEPCodon(this);
 }
Пример #6
0
 /// <summary>
 /// Gets the ICodon as specified by the given ICodonIdentifier.
 /// </summary>
 /// <param name="codonIdentifier"></param>
 /// <returns></returns>
 public abstract ICodon GetCodon(ICodonIdentifier codonIdentifier);
Пример #7
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 ICodon GetCodon(ICodonIdentifier codonIdentifier)
 {
     return this.Codons[codonIdentifier];
 }
Пример #10
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]))
 {
 }
Пример #11
0
 protected GEPCodonBase(IGEPGeneticCode geneticCode, ICodonIdentifier codonIdentifier, 
     CodonType codonType, IEnumerable<INucleotide> nucleotides, IFunctionPair functions) 
     : base(geneticCode, codonIdentifier, codonType, nucleotides)
 {
     this.Functions = functions;
 }