public AminoacidInProtein(char altLoc, string resName, string chainId, int residueSeq, IDictionary <AtomInAminoacid, Vector3> atomInAminoacidPos, IDictionary <AtomInAminoacid, int> atomInAminoacidSerial) { this.ChainId = chainId; this.ResidueSeq = residueSeq; this.AltLoc = altLoc; this.ResName = resName; this.Aminoacid = Aminoacid.Generate(resName); this.AtomInAminoacidPos = new ReadOnlyDictionary <AtomInAminoacid, Vector3>(atomInAminoacidPos); this.AtomInAminoacidSerial = new ReadOnlyDictionary <AtomInAminoacid, int>(atomInAminoacidSerial); }
public static Aminoacid Generate(AminoacidType type) { Aminoacid aminoacid = null; if (!Aminoacids.TryGetValue(type, out aminoacid)) { throw new ArgumentException("Unhandled AminoacidType:" + type.ToString()); } return(Aminoacids[type]); }
public override bool Equals(object obj) { Aminoacid aminoacid = obj as Aminoacid; if (aminoacid == null) { return(false); } else { return(Type == aminoacid.Type); } }
public override bool Equals(object obj) { Aminoacid atom = obj as Aminoacid; if (atom == null) { return(false); } else { return(this.Type == atom.Type); } }
/// <summary>直接使用名字作为HashCode(保证在同一个氨基酸中作为Key存储哈希表) </summary> public override int GetHashCode() { return(Name.GetHashCode() + Aminoacid.GetHashCode()); }