1 /* Copyright (c) 2009 Peter Troshin
\r
3 * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 1.0
\r
5 * This library is free software; you can redistribute it and/or modify it under the terms of the
\r
6 * Apache License version 2 as published by the Apache Software Foundation
\r
8 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
\r
9 * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache
\r
10 * License for more details.
\r
12 * A copy of the license is in apache_license.txt. It is also available here:
\r
13 * @see: http://www.apache.org/licenses/LICENSE-2.0.txt
\r
15 * Any republication or derived work distributed in source code form
\r
16 * must include this copyright and license notice.
\r
18 package compbio.pipeline._jpred;
\r
20 import java.io.FileNotFoundException;
\r
21 import java.util.HashSet;
\r
22 import java.util.Set;
\r
24 import javax.xml.stream.XMLStreamException;
\r
27 public class BlastBlastComparator {
\r
30 * args[0] is assumed to be the name of a Blast output file
\r
32 * @throws XMLStreamException
\r
33 * @throws FileNotFoundException
\r
35 public static void main(String[] args) throws FileNotFoundException,
\r
36 XMLStreamException {
\r
37 BlastParser res1 = new BlastParser(args[0]);
\r
38 BlastParser res2 = new BlastParser(args[1]);
\r
39 assert res1.iters.size() == res2.iters.size();
\r
41 for (Integer iterNum : res1.iters.keySet()) {
\r
42 Set<Hit> list = res1.iters.get(iterNum);
\r
43 Set<Hit> otherList = res2.iters.get(iterNum);
\r
44 System.out.print("Iter " + iterNum + " arg0: " + list.size());
\r
45 System.out.println(" arg1: " + otherList.size());
\r
46 BlastParser.printNames(getDiff(list, otherList));
\r
47 // System.out.println("Diffs: " + getDiff(list, otherList));
\r
48 // System.out.println("Diffs: " + getDiff(otherList, list));
\r
54 static Set<Hit> getDiff(Set<Hit> list, Set<Hit> otherList) {
\r
55 Set diff = new HashSet<Hit>();
\r
56 for (Hit pseq : list) {
\r
57 if (otherList.contains(pseq)) {
\r