示例#1
0
 public ProvidePDBInfoOptions(string pdbId, double interfaceDefDist, bool interfaceUseVanDerWaalsRadii, double graphNeighourDistance, ResidueNodeCenterDefinition nodeCenterDef)
 {
     PDBId                        = pdbId;
     ComputeRasa                  = true;
     ComputeInterface             = true;
     InterfaceDefDistance         = interfaceDefDist;
     InterfaceUseVanDerWaalsRadii = interfaceUseVanDerWaalsRadii;
     ComputeGraph                 = true;
     GraphNeighbourDistance       = graphNeighourDistance;
     GraphNodeCenterDef           = nodeCenterDef;
 }
示例#2
0
        //public static Dictionary<string, ProteinGraph> Do(PDBFile file, double neighbourDistance, ResidueNodeCenterDefinition centerdef)
        //{
        //    var dict = new Dictionary<string, ProteinGraph>();
        //    foreach (var chain in file.Chains)
        //    {

        //        var graph = new ProteinGraph();

        //        graph.PDBFile = file;
        //        graph.NeighbourDistance = neighbourDistance;
        //        graph.NodeCenterDefinition = centerdef;

        //        //Compute Nodes:
        //        foreach (var residue in chain.Residues)
        //        {
        //            var node = new ResidueNode(residue, graph);
        //            switch (centerdef)
        //            {
        //                case ResidueNodeCenterDefinition.CAlpha:
        //                    node.SetValuesTo(residue.CAlpha);
        //                    break;
        //                case ResidueNodeCenterDefinition.BalancePoint:
        //                    node.SetValuesTo(residue.Atoms.BalancePoint());
        //                    break;
        //                default:
        //                    break;
        //            }
        //            graph.Nodes.Add(node);
        //        }

        //        var nodeList = graph.Nodes.ToList();
        //        //compute edges:
        //        for (int i = 0; i < nodeList.Count - 1; i++)
        //        {
        //            for (int k = i + 1; k < nodeList.Count; k++)
        //            {
        //                var nodeOne = nodeList[i];
        //                var nodetwo = nodeList[k];
        //                var dist = nodeOne.Distance(nodetwo);
        //                if (dist <= neighbourDistance)
        //                {
        //                    var edge = new SimpleEdge<ResidueNode>(nodeOne, nodetwo);
        //                    graph.Edges.Add(edge);
        //                }
        //            }
        //        }

        //        dict.Add(chain.Name, graph);
        //    }
        //    return dict;
        //}
        public static Dictionary <string, IDictionary <string, ProteinGraph> > Do(IEnumerable <PDBFile> files, double neighbourDistance, ResidueNodeCenterDefinition centerdef)
        {
            var dict = new Dictionary <string, IDictionary <string, ProteinGraph> >();

            foreach (var file in files)
            {
                dict.Add(file.Name, Do(file, neighbourDistance, centerdef));
            }
            return(dict);
        }
示例#3
0
        public static Dictionary <string, ProteinGraph> Do(PDBFile file, double neighbourDistance, ResidueNodeCenterDefinition centerdef)
        {
            var dict = new Dictionary <string, ProteinGraph>();

            foreach (var chain in file.Chains)
            {
                var graph = new ProteinGraph();
                graph.Data = new ProteinGraphData();

                graph.Data.PDBFile              = file;
                graph.Data.NeighbourDistance    = neighbourDistance;
                graph.Data.NodeCenterDefinition = centerdef;

                //Compute Nodes:
                foreach (var residue in chain.Residues)
                {
                    if (residue.CAlpha != null)
                    {
                        var node = graph.CreateNode();
                        node.Data        = new ResidueNodeData(residue);
                        node.Data.IsCore = residue.IsCore;
                        node.Data.ZScore = residue.ZScore;
                        switch (centerdef)
                        {
                        case ResidueNodeCenterDefinition.CAlpha:
                            node.Data.SetValuesTo(residue.CAlpha);
                            break;

                        case ResidueNodeCenterDefinition.BalancePoint:
                            node.Data.SetValuesTo(residue.Atoms.BalancePoint());
                            break;

                        default:
                            break;
                        }
                    }
                }

                var nodeList = graph.Nodes.ToList();
                //compute edges:
                for (int i = 0; i < nodeList.Count - 1; i++)
                {
                    for (int k = i + 1; k < nodeList.Count; k++)
                    {
                        var nodeOne = nodeList[i];
                        var nodetwo = nodeList[k];
                        var dist    = nodeOne.Data.Distance(nodetwo.Data);
                        if (dist <= neighbourDistance)
                        {
                            var edge = graph.CreateEdge(nodeOne, nodetwo);
                            edge.Data = new SimpleEdgeData();
                        }
                    }
                }

                dict.Add(chain.Name, graph);
            }
            return(dict);
        }