예제 #1
0
        public static List <ATOM_Record> FindAtomInteractingWithOtherProteinInterfaces(ATOM_Record atom, InteractionBetweenProteinInterfacesListContainer interactionBetweenProteinInterfacesContainer, FindAtomInteractingWithAnotherProteinInterfaceOptions findAtomInteractingWithAnotherProteinInterfaceOptions)
        {
            if (ParameterValidation.IsAtomNullOrEmpty(atom))
            {
                throw new ArgumentNullException(nameof(atom));
            }

            if (ParameterValidation.IsInteractionBetweenProteinInterfacesListContainerNullOrEmpty(interactionBetweenProteinInterfacesContainer))
            {
                ////////Console.WriteLine("empty");
                return(null);
            }

            List <InteractionBetweenProteinInterfaces> searchList = null;

            if (findAtomInteractingWithAnotherProteinInterfaceOptions == FindAtomInteractingWithAnotherProteinInterfaceOptions.FindAtomsInteractingWithOtherProteinInterfaces)
            {
                searchList = interactionBetweenProteinInterfacesContainer.InteractionBetweenProteinInterfacesList;
            }
            else if (findAtomInteractingWithAnotherProteinInterfaceOptions == FindAtomInteractingWithAnotherProteinInterfaceOptions.FindAtomsInteractingWithNonProteinInterfaces)
            {
                searchList = interactionBetweenProteinInterfacesContainer.InteractionBetweenNonProteinInterfacesList;
            }
            else
            {
                throw new NotImplementedException();
            }

            if (searchList == null)
            {
                ////////Console.WriteLine("returning null");
                return(null);
            }

            var result = new List <ATOM_Record>();

            foreach (InteractionBetweenProteinInterfaces interaction in searchList)
            {
                if (interaction.Atom1.Atom == atom && interaction.Atom2.Atom != atom)
                {
                    //return interaction.Atom1.Atom;
                    result.Add(interaction.Atom2.Atom);
                }

                if (interaction.Atom1.Atom != atom && interaction.Atom2.Atom == atom)
                {
                    //return interaction.Atom2.Atom;
                    result.Add(interaction.Atom1.Atom);
                }
            }

            //if (result.Count == 0)
            //{
            //    //////Console.WriteLine("returning empty list");
            //}

            return(result);
        }
예제 #2
0
        public static Point1D AtomResidueSequencePoint1D(ATOM_Record atom)
        {
            if (ParameterValidation.IsAtomNullOrEmpty(atom))
            {
                throw new ArgumentOutOfRangeException(nameof(atom));
            }

            return(new Point1D(atom.resSeq.FieldValue));
        }
예제 #3
0
        public static Point3D AtomPoint3D(ATOM_Record atom)
        {
            if (ParameterValidation.IsAtomNullOrEmpty(atom))
            {
                throw new ArgumentOutOfRangeException(nameof(atom));
            }

            return(new Point3D(atom.x.FieldValue, atom.y.FieldValue, atom.z.FieldValue));
        }