/// <summary> /// /// </summary> /// <param name="pdbId"></param> /// <param name="crystInterfaces"></param> private void CompareCrystBuInterfaces(string pdbId, InterfaceChains[] crystInterfaces) { // key: pdb bu id, value: a list of same BUs for the input entry Dictionary <string, List <string> > pdbSameBuHash = null; // the unique PDB BUs for the entry string[] pdbDifBUs = GetEntryDifBUs(pdbId, "pdb", ref pdbSameBuHash); Dictionary <string, InterfaceChains[]> pdbBuInterfacesHash = buInterfaceRetriever.GetEntryBuInterfaces(pdbId, pdbDifBUs, "pdb"); if (pdbBuInterfacesHash.Count == 0) { CompareEntryCrystBuInterfaces(pdbId, crystInterfaces, "pisa"); } else { // key: pdb bu id, value: a list of pisa BUs which are same as the pdb bu Dictionary <string, List <string> > samePdbBuHash = null; // get those PISA BUs which are not same as any PDB BUs string[] difPisaBUs = GetBUsDifFromPdb(pdbId, "pisa", ref samePdbBuHash); foreach (string buId in pdbBuInterfacesHash.Keys) { InterfaceChains[] buInterfaces = (InterfaceChains[])pdbBuInterfacesHash[buId]; InterfacePairInfo[] interfaceCompPairs = interfaceComp.CompareInterfacesBetweenCrystals(crystInterfaces, buInterfaces); List <string> sameBuList = new List <string> (); if (pdbSameBuHash.ContainsKey(buId)) { sameBuList = pdbSameBuHash[buId]; } string[] sameBUs = new string[sameBuList.Count]; sameBuList.CopyTo(sameBUs); AssignInterfaceCompInfoIntoTable(pdbId, buId, interfaceCompPairs, sameBUs, (int)BuType.PDB); if (samePdbBuHash.ContainsKey(buId)) { List <string> difTypeSameBuList = samePdbBuHash[buId]; string[] difTypeSameBUs = new string[difTypeSameBuList.Count]; difTypeSameBuList.CopyTo(difTypeSameBUs); AssignInterfaceCompInfoIntoTableForSameBUs(pdbId, buId, interfaceCompPairs, difTypeSameBUs, "PdbPisaBuInterfaceComp", (int)BuType.PISA); } } if (difPisaBUs.Length > 0) { Dictionary <string, InterfaceChains[]> pisaBuInterfacesHash = buInterfaceRetriever.GetEntryBuInterfaces(pdbId, difPisaBUs, "pisa"); foreach (string buId in pisaBuInterfacesHash.Keys) { InterfaceChains[] buInterfaces = (InterfaceChains[])pisaBuInterfacesHash[buId]; InterfacePairInfo[] interfaceCompPairs = interfaceComp.CompareInterfacesBetweenCrystals(crystInterfaces, buInterfaces); AssignInterfaceCompInfoIntoTable(pdbId, buId, interfaceCompPairs, (int)BuType.PISA); } } } }
/// <summary> /// /// </summary> /// <param name="buInterfaces1"></param> /// <param name="buInterfaces2"></param> /// <returns></returns> private InterfacePairInfo[] CompareBuInterfaces(InterfaceChains[] buInterfaces1, InterfaceChains[] buInterfaces2) { InterfacePairInfo[] compResult = interfaceComp.CompareInterfacesBetweenCrystals(buInterfaces1, buInterfaces2); return(compResult); }