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.IOException;
\r
21 import java.util.HashSet;
\r
22 import java.util.Set;
\r
24 import javax.xml.stream.XMLStreamException;
\r
26 public class BlastHmmerComparator {
\r
29 * args[0] is assumed to be the name of a Blast output file
\r
31 * @throws XMLStreamException
\r
32 * @throws IOException
\r
34 public static void main(String[] args) throws XMLStreamException,
\r
36 BlastParser res1 = new BlastParser(args[0]);
\r
37 JackHmmerHitParser res2 = new JackHmmerHitParser(args[1]);
\r
38 Set<Hit> list = res1.iters.get(3);
\r
39 Set<Hit> otherList = res2.hits;
\r
40 System.out.print("Iter " + 3 + " arg0: " + list.size());
\r
41 System.out.println(" arg1: " + otherList.size());
\r
42 BlastParser.printNames(getDiff(list, otherList));
\r
43 BlastParser.printNames(getDiff(otherList, list));
\r
44 // System.out.println("Diffs: " + getDiff(list, otherList));
\r
45 // System.out.println("Diffs: " + getDiff(otherList, list));
\r
49 static Set<Hit> getDiff(Set<Hit> list, Set<Hit> otherList) {
\r
50 Set diff = new HashSet<Hit>();
\r
51 for (Hit pseq : list) {
\r
52 if (otherList.contains(pseq)) {
\r