public bool Equals(IFunctionIdentifier other) { if (other == null) return false; else if (other is FunctionIdentifier) return this.Identifier == ((FunctionIdentifier)other).Identifier; else return false; }
protected FunctionPairBase(IGEPGeneticCode geneticCode, IFunctionIdentifier primaryFunction, IFunctionIdentifier parameterlessFunction) { this.PrimaryFunction = primaryFunction; this.ParameterlessFunction = parameterlessFunction; if (this.PrimaryFunction == null || this.ParameterlessFunction == null) throw new GeneticCodeException("Both the Primary Function and the Parameterless Function must be provided."); if (!geneticCode.FunctionSet[this.ParameterlessFunction].IsParameterless) throw new GeneticCodeException("The given Parameterless Function must actually be parameterless."); }
/// <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 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); }
public FunctionPair(IGEPGeneticCode geneticCode, IFunctionIdentifier primaryFunction, IFunctionIdentifier parameterlessFunction) : base(geneticCode, primaryFunction, parameterlessFunction) { }
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; }
public int CompareTo(IFunctionIdentifier other) { return this.Identifier.CompareTo(other.ToString()); }