/* Copyright (c) 2011 Peter Troshin * * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 * * This library is free software; you can redistribute it and/or modify it under the terms of the * Apache License version 2 as published by the Apache Software Foundation * * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache * License for more details. * * A copy of the license is in apache_license.txt. It is also available here: * @see: http://www.apache.org/licenses/LICENSE-2.0.txt * * Any republication or derived work distributed in source code form * must include this copyright and license notice. */ package compbio.pipeline._jpred; import java.io.IOException; import java.util.HashSet; import java.util.Set; import javax.xml.stream.XMLStreamException; public class BlastHmmerComparator { /** * args[0] is assumed to be the name of a Blast output file * * @throws XMLStreamException * @throws IOException */ public static void main(String[] args) throws XMLStreamException, IOException { BlastParser res1 = new BlastParser(args[0]); JackHmmerHitParser res2 = new JackHmmerHitParser(args[1]); Set list = res1.iters.get(3); Set otherList = res2.hits; System.out.print("Iter " + 3 + " arg0: " + list.size()); System.out.println(" arg1: " + otherList.size()); BlastParser.printNames(getDiff(list, otherList)); BlastParser.printNames(getDiff(otherList, list)); // System.out.println("Diffs: " + getDiff(list, otherList)); // System.out.println("Diffs: " + getDiff(otherList, list)); } static Set getDiff(Set list, Set otherList) { Set diff = new HashSet(); for (Hit pseq : list) { if (otherList.contains(pseq)) { continue; } diff.add(pseq); } return diff; } }