예제 #1
0
        public Aa(IAa other, bool nTerminus, bool cTerminus)
        {
            _atoms = new ArraySource <IAtom>(this, other);

            ResidueNumber = other.ResidueNumber;
            IsNTerminus   = nTerminus;
            IsCTerminus   = cTerminus;

            AtomDefinition[] definitions = AaTable.GetAtomDefinitions(ResidueNumber, IsNTerminus, IsCTerminus);

            Matrix unidentifiedAtomTransform = Matrix.Identity;

            //if (TransformSetting == TransformSettings.Transform)
            {
                Vector3[] vLocal = new Vector3[] { definitions[N_].Xyz, definitions[CA_].Xyz, definitions[C_].Xyz };
                Vector3[] vOther = new Vector3[] { other[N_].Xyz, other[CA_].Xyz, other[C_].Xyz };
                unidentifiedAtomTransform = VectorMath.GetRmsdAlignmentMatrix(vLocal, false, vOther, false);
            }

            // Create atoms at final positions
            for (int i = 0; i < definitions.Length; i++)
            {
                Vector3 position = Vector3.Transform(definitions[i].Xyz, unidentifiedAtomTransform);
                Atom    atom     = new Atom(definitions[i], position);
                Add(atom);
            }

            this[N_].Xyz  = other[N_].Xyz;
            this[CA_].Xyz = other[CA_].Xyz;
            this[C_].Xyz  = other[C_].Xyz;
            this[O_].Xyz  = other[O_].Xyz;

            for (int i = Aa.SidechainStart_; i < other.Count; i++)
            {
                IAtom otherAtom = other[i];
                IAtom thisAtom  = this[otherAtom.Name];
                if (thisAtom != null)
                {
                    thisAtom.Xyz = otherAtom.Xyz;
                }
            }

            // Remove parent context - this will result in atoms NOT BEING IN THE ORIGINAL LOCATION
            this.Parent = null;
        }
예제 #2
0
 public Aa(char letter, bool nTerminus, bool cTerminus)
     : this(AaTable.GetResidueTypeIndex(letter), nTerminus, cTerminus)
 {
 }
예제 #3
0
 public Aa(string residueName, bool nTerminus, bool cTerminus)
     : this(AaTable.GetResidueTypeIndex(residueName), nTerminus, cTerminus)
 {
 }