@Test public void testGetFragAPsCompatibleWithClass() throws Exception { buildFragmentSpace(); ArrayList<IdFragmentAndAP> lst = FragmentSpace.getFragAPsCompatibleWithClass(APC1); assertEquals(4,lst.size(),"Size of compatible APs list is wrong."); IdFragmentAndAP ref1 = new IdFragmentAndAP(-1,0,1,3,-1,-1); IdFragmentAndAP ref2 = new IdFragmentAndAP(-1,1,1,0,-1,-1); IdFragmentAndAP ref3 = new IdFragmentAndAP(-1,1,1,1,-1,-1); IdFragmentAndAP ref4 = new IdFragmentAndAP(-1,2,1,1,-1,-1); boolean found1 = false; boolean found2 = false; boolean found3 = false; boolean found4 = false; for (IdFragmentAndAP id : lst) { if (id.sameFragAndAp(ref1)) found1 = true; if (id.sameFragAndAp(ref2)) found2 = true; if (id.sameFragAndAp(ref3)) found3 = true; if (id.sameFragAndAp(ref4)) found4 = true; } assertTrue(found1, "Missing first AP ID."); assertTrue(found2, "Missing second AP ID."); assertTrue(found3, "Missing third AP ID."); assertTrue(found4, "Missing fourth AP ID."); FragmentSpace.clearAll(); }
public static ArrayList<IdFragmentAndAP> getFragAPsCompatibleWithClass( String srcApCls) { ArrayList<IdFragmentAndAP> compatFragAps = new ArrayList<IdFragmentAndAP>(); ArrayList<String> compatApClasses = FragmentSpace.getCompatibleAPClasses(srcApCls); if (compatApClasses != null) { for (String compClass : compatApClasses) { compatFragAps.addAll( FragmentSpace.getFragsWithAPClass(compClass)); } } return compatFragAps; }
FragmentSpace { public static ArrayList<IdFragmentAndAP> getFragAPsCompatibleWithClass( String srcApCls) { ArrayList<IdFragmentAndAP> compatFragAps = new ArrayList<IdFragmentAndAP>(); ArrayList<String> compatApClasses = FragmentSpace.getCompatibleAPClasses(srcApCls); if (compatApClasses != null) { for (String compClass : compatApClasses) { compatFragAps.addAll( FragmentSpace.getFragsWithAPClass(compClass)); } } return compatFragAps; } }
FragmentSpace { public static ArrayList<IdFragmentAndAP> getFragAPsCompatibleWithClass( String srcApCls) { ArrayList<IdFragmentAndAP> compatFragAps = new ArrayList<IdFragmentAndAP>(); ArrayList<String> compatApClasses = FragmentSpace.getCompatibleAPClasses(srcApCls); if (compatApClasses != null) { for (String compClass : compatApClasses) { compatFragAps.addAll( FragmentSpace.getFragsWithAPClass(compClass)); } } return compatFragAps; }  }
FragmentSpace { public static ArrayList<IdFragmentAndAP> getFragAPsCompatibleWithClass( String srcApCls) { ArrayList<IdFragmentAndAP> compatFragAps = new ArrayList<IdFragmentAndAP>(); ArrayList<String> compatApClasses = FragmentSpace.getCompatibleAPClasses(srcApCls); if (compatApClasses != null) { for (String compClass : compatApClasses) { compatFragAps.addAll( FragmentSpace.getFragsWithAPClass(compClass)); } } return compatFragAps; }  static void defineFragmentSpace(ArrayList<IAtomContainer> scaffLib,
    		ArrayList<IAtomContainer> fragLib,
    		ArrayList<IAtomContainer> cappLib); static void defineFragmentSpace(ArrayList<IAtomContainer> scaffLib,
    		ArrayList<IAtomContainer> fragLib,
    		ArrayList<IAtomContainer> cappLib,
    		HashMap<String,ArrayList<String>> cpMap,
    		HashMap<String,Integer> boMap,
    		HashMap<String,String> capMap,
    		HashSet<String> forbEnds,
    		HashMap<String,ArrayList<String>> rcCpMap); static void defineFragmentSpace(String paramFile); static boolean isDefined(); static boolean useAPclassBasedApproach(); static String getAPClassForFragment(IdFragmentAndAP apId); static IAtomContainer getFragment(int frgTyp, int molIdx); static ArrayList<IAtomContainer> getScaffoldLibrary(); static ArrayList<IAtomContainer> getFragmentLibrary(); static ArrayList<IAtomContainer> getCappingLibrary(); static ArrayList<Integer> getCappingGroupsWithAPClass(String query); static void importCompatibilityMatrixFromFile(String inFile); static void importRCCompatibilityMatrixFromFile(String inFile); static HashMap<String, ArrayList<String>> getCompatibilityMatrix(); static ArrayList<String> getCompatibleAPClasses(String query); static HashMap<String,ArrayList<String>> getRCCompatibilityMatrix(); static HashMap<String, Integer> getBondOrderMap(); static Integer getBondOrderForAPClass(String apclass); static HashMap<String, String> getCappingMap(); static String getCappingClass(String srcApClass); static Set<String> getForbiddenEndList(); static Set<String> getAllAPClassesFromCPMap(); static Set<String> getAllAPClassesFromBOMap(); static HashMap<Integer,ArrayList<Integer>> getMapOfFragsPerNumAps(); static ArrayList<Integer> getFragsWithNumAps(int nAps); static HashMap<Integer,ArrayList<String>> getMapAPClassesPerFragment(); static ArrayList<String> getAPClassesPerFragment(int fragId); static HashMap<String,ArrayList<ArrayList<Integer>>> getMapFragsAPsPerAPClass(); static ArrayList<IdFragmentAndAP> getFragsWithAPClass(
								 String apclass); static ArrayList<IAtomContainer> getFragmentsCompatibleWithTheseAPs(
    		ArrayList<IdFragmentAndAP> srcAPs); static ArrayList<IdFragmentAndAP> getFragAPsCompatibleWithTheseAPs(
    		ArrayList<IdFragmentAndAP> srcAPs); static ArrayList<IdFragmentAndAP> getFragAPsCompatibleWithClass(
    		String srcApCls); static boolean imposeSymmetryOnAPsOfClass(String apClass); static boolean hasSymmetryConstrain(String apClass); static double getSymmetryConstrain(String apClass); static void setScaffoldLibrary(ArrayList<IAtomContainer> lib); static void setFragmentLibrary(ArrayList<IAtomContainer> lib); static void setCappingLibrary(ArrayList<IAtomContainer> lib); static void setCompatibilityMatrix(
					HashMap<String,ArrayList<String>> map); static void setRCCompatibilityMatrix(
					HashMap<String,ArrayList<String>> map); static void setBondOrderMap(HashMap<String, Integer> map); static void setCappingMap(HashMap<String, String> map); static void setForbiddenEndList(Set<String> lst); static void setFragPoolPerNumAP(HashMap<Integer,ArrayList<Integer>>
									    map); static void setFragsApsPerApClass(
			      HashMap<String,ArrayList<ArrayList<Integer>>> map); static void setAPClassesPerFrag(HashMap<Integer,ArrayList<String>> 
									    map); static void setSymmConstraints(HashMap<String,Double> map); static void clearAll(); }
FragmentSpace { public static ArrayList<IdFragmentAndAP> getFragAPsCompatibleWithClass( String srcApCls) { ArrayList<IdFragmentAndAP> compatFragAps = new ArrayList<IdFragmentAndAP>(); ArrayList<String> compatApClasses = FragmentSpace.getCompatibleAPClasses(srcApCls); if (compatApClasses != null) { for (String compClass : compatApClasses) { compatFragAps.addAll( FragmentSpace.getFragsWithAPClass(compClass)); } } return compatFragAps; }  static void defineFragmentSpace(ArrayList<IAtomContainer> scaffLib,
    		ArrayList<IAtomContainer> fragLib,
    		ArrayList<IAtomContainer> cappLib); static void defineFragmentSpace(ArrayList<IAtomContainer> scaffLib,
    		ArrayList<IAtomContainer> fragLib,
    		ArrayList<IAtomContainer> cappLib,
    		HashMap<String,ArrayList<String>> cpMap,
    		HashMap<String,Integer> boMap,
    		HashMap<String,String> capMap,
    		HashSet<String> forbEnds,
    		HashMap<String,ArrayList<String>> rcCpMap); static void defineFragmentSpace(String paramFile); static boolean isDefined(); static boolean useAPclassBasedApproach(); static String getAPClassForFragment(IdFragmentAndAP apId); static IAtomContainer getFragment(int frgTyp, int molIdx); static ArrayList<IAtomContainer> getScaffoldLibrary(); static ArrayList<IAtomContainer> getFragmentLibrary(); static ArrayList<IAtomContainer> getCappingLibrary(); static ArrayList<Integer> getCappingGroupsWithAPClass(String query); static void importCompatibilityMatrixFromFile(String inFile); static void importRCCompatibilityMatrixFromFile(String inFile); static HashMap<String, ArrayList<String>> getCompatibilityMatrix(); static ArrayList<String> getCompatibleAPClasses(String query); static HashMap<String,ArrayList<String>> getRCCompatibilityMatrix(); static HashMap<String, Integer> getBondOrderMap(); static Integer getBondOrderForAPClass(String apclass); static HashMap<String, String> getCappingMap(); static String getCappingClass(String srcApClass); static Set<String> getForbiddenEndList(); static Set<String> getAllAPClassesFromCPMap(); static Set<String> getAllAPClassesFromBOMap(); static HashMap<Integer,ArrayList<Integer>> getMapOfFragsPerNumAps(); static ArrayList<Integer> getFragsWithNumAps(int nAps); static HashMap<Integer,ArrayList<String>> getMapAPClassesPerFragment(); static ArrayList<String> getAPClassesPerFragment(int fragId); static HashMap<String,ArrayList<ArrayList<Integer>>> getMapFragsAPsPerAPClass(); static ArrayList<IdFragmentAndAP> getFragsWithAPClass(
								 String apclass); static ArrayList<IAtomContainer> getFragmentsCompatibleWithTheseAPs(
    		ArrayList<IdFragmentAndAP> srcAPs); static ArrayList<IdFragmentAndAP> getFragAPsCompatibleWithTheseAPs(
    		ArrayList<IdFragmentAndAP> srcAPs); static ArrayList<IdFragmentAndAP> getFragAPsCompatibleWithClass(
    		String srcApCls); static boolean imposeSymmetryOnAPsOfClass(String apClass); static boolean hasSymmetryConstrain(String apClass); static double getSymmetryConstrain(String apClass); static void setScaffoldLibrary(ArrayList<IAtomContainer> lib); static void setFragmentLibrary(ArrayList<IAtomContainer> lib); static void setCappingLibrary(ArrayList<IAtomContainer> lib); static void setCompatibilityMatrix(
					HashMap<String,ArrayList<String>> map); static void setRCCompatibilityMatrix(
					HashMap<String,ArrayList<String>> map); static void setBondOrderMap(HashMap<String, Integer> map); static void setCappingMap(HashMap<String, String> map); static void setForbiddenEndList(Set<String> lst); static void setFragPoolPerNumAP(HashMap<Integer,ArrayList<Integer>>
									    map); static void setFragsApsPerApClass(
			      HashMap<String,ArrayList<ArrayList<Integer>>> map); static void setAPClassesPerFrag(HashMap<Integer,ArrayList<String>> 
									    map); static void setSymmConstraints(HashMap<String,Double> map); static void clearAll();  }