/** * Prints out the XML representation of an AFPChain from a file containing exactly two FASTA * sequences. * * @param args A String array of fasta-file structure-1-name structure-2-name * @throws StructureException * @throws IOException */ public static void main(String[] args) throws StructureException, IOException { if (args.length != 3) { System.err.println( "Usage: FastaAFPChainConverter fasta-file structure-1-name structure-2-name"); return; } File fasta = new File(args[0]); Structure structure1 = StructureTools.getStructure(args[1]); Structure structure2 = StructureTools.getStructure(args[2]); if (structure1 == null) throw new IllegalArgumentException("No structure for " + args[1] + " was found"); if (structure2 == null) throw new IllegalArgumentException("No structure for " + args[2] + " was found"); AFPChain afpChain = fastaFileToAfpChain(fasta, structure1, structure2); String xml = AFPChainXMLConverter.toXML(afpChain); System.out.println(xml); }
@Test public void testIndependence() throws IOException, StructureException { String[] names = new String[] {"1hiv.A", "4i4q", "1n0r.A"}; int[] orders = new int[] {2, 3, 4}; for (int i = 0; i < names.length; i++) { Structure s = StructureTools.getStructure(names[i]); Atom[] atoms = StructureTools.getRepresentativeAtomArray(s); CeSymmResult result = CeSymm.analyze(atoms); assertTrue(result.isSignificant()); assertEquals(result.getSymmOrder(), orders[i]); } }