// Path: src/main/java/ch/picard/ppimapbuilder/data/ontology/GeneOntologyTerm.java
// public class GeneOntologyTerm extends OntologyTerm implements JSONable, Serializable {
// 
// 	private static final long serialVersionUID = 1L;
// 
// 	private final String term;
// 	private final GeneOntologyCategory category;
// 	public static final int TERM_LENGTH = 10;
// 
// 	public GeneOntologyTerm(String identifier) {
// 		this(identifier, "", null);
// 	}
// 
// 	public GeneOntologyTerm(String identifier, String term, char category) {
// 		this(identifier, term, GeneOntologyCategory.getByLetter(category));
// 	}
// 
// 	public GeneOntologyTerm(String identifier, String term, GeneOntologyCategory category) {
// 		super(identifier);
// 		this.term = term;
// 		this.category = category;
// 	}
// 
// 	public String getTerm() {
// 		return term;
// 	}
// 
// 	public GeneOntologyCategory getCategory() {
// 		return category;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return getIdentifier();
// 	}
// 
// 	@Override
// 	public String toJSON() {
// 		JsonObject out = new JsonObject();
// 		out.add("id", getIdentifier());
// 		out.add("term", term);
// 		return out.toString();
// 	}
// }
// 
// Path: src/main/java/ch/picard/ppimapbuilder/data/ontology/GeneOntologyTermSet.java
// public class GeneOntologyTermSet extends HashSet<GeneOntologyTerm> {
// 
// 	private static final long serialVersionUID = 1L;
// 
// 	public GeneOntologyTermSet() {
// 		super();
// 	}
// 
// 	public GeneOntologyTermSet(Collection<GeneOntologyTerm> terms) {
// 		super(terms);
// 	}
// 
// 	public GeneOntologyTermSet getByCategory(GeneOntologyCategory category) {
// 		GeneOntologyTermSet result = new GeneOntologyTermSet();
// 		for (GeneOntologyTerm geneOntologyTerm : this) {
// 			if(geneOntologyTerm.getCategory().equals(category))
// 				result.add(geneOntologyTerm);
// 		}
// 		return result;
// 	}
// 
// 	public List<String> asStringList() {
// 		ArrayList<String> list = new ArrayList<String>();
// 		for (GeneOntologyTerm go : this)
// 			list.add(go.toString());
// 		return list;
// 	}
// }


import ch.picard.ppimapbuilder.data.ontology.GeneOntologyTerm;
import ch.picard.ppimapbuilder.data.ontology.GeneOntologyTermSet;
import junit.framework.Assert;
import org.junit.Test;
import java.io.InputStream;
/*   
 * This file is part of PPiMapBuilder.
 *
 * PPiMapBuilder is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * PPiMapBuilder 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
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with PPiMapBuilder.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * Copyright 2015 Echeverria P.C., Dupuis P., Cornut G., Gravouil K., Kieffer A., Picard D.
 * 
 */    	
    
package ch.picard.ppimapbuilder.data.ontology.goslim;



public class GOSlimOBOParserTest {

	@Test
	public void testParseOBOFile() throws Exception {
		GOSlim expected = new GOSlim("oboFileTest");
		expected.add(new GeneOntologyTerm("GO:0005975", "carbohydrate metabolic process", 'P'));
		expected.add(new GeneOntologyTerm("GO:0006091", "generation of precursor metabolites and energy", 'P'));
		expected.add(new GeneOntologyTerm("GO:0006260", "DNA replication", 'P'));
		expected.add(new GeneOntologyTerm("GO:0006281", "DNA repair", 'P'));
		expected.add(new GeneOntologyTerm("GO:0006355", "regulation of transcription, DNA-templated", 'P'));
		expected.add(new GeneOntologyTerm("GO:0006399", "tRNA metabolic process", 'P'));
		expected.add(new GeneOntologyTerm("GO:0006457", "protein folding", 'P'));
		expected.add(new GeneOntologyTerm("GO:0006461", "protein complex assembly", 'P'));
		expected.add(new GeneOntologyTerm("GO:0006486", "protein glycosylation", 'P'));
		expected.add(new GeneOntologyTerm("GO:0006914", "autophagy", 'P'));
		expected.add(new GeneOntologyTerm("GO:0007005", "mitochondrion organization", 'P'));
		expected.add(new GeneOntologyTerm("GO:0007010", "cytoskeleton organization", 'P'));
		expected.add(new GeneOntologyTerm("GO:0007031", "peroxisome organization", 'P'));
// Path: src/main/java/ch/picard/ppimapbuilder/data/ontology/GeneOntologyTerm.java
// public class GeneOntologyTerm extends OntologyTerm implements JSONable, Serializable {
// 
// 	private static final long serialVersionUID = 1L;
// 
// 	private final String term;
// 	private final GeneOntologyCategory category;
// 	public static final int TERM_LENGTH = 10;
// 
// 	public GeneOntologyTerm(String identifier) {
// 		this(identifier, "", null);
// 	}
// 
// 	public GeneOntologyTerm(String identifier, String term, char category) {
// 		this(identifier, term, GeneOntologyCategory.getByLetter(category));
// 	}
// 
// 	public GeneOntologyTerm(String identifier, String term, GeneOntologyCategory category) {
// 		super(identifier);
// 		this.term = term;
// 		this.category = category;
// 	}
// 
// 	public String getTerm() {
// 		return term;
// 	}
// 
// 	public GeneOntologyCategory getCategory() {
// 		return category;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return getIdentifier();
// 	}
// 
// 	@Override
// 	public String toJSON() {
// 		JsonObject out = new JsonObject();
// 		out.add("id", getIdentifier());
// 		out.add("term", term);
// 		return out.toString();
// 	}
// }
// 
// Path: src/main/java/ch/picard/ppimapbuilder/data/ontology/GeneOntologyTermSet.java
// public class GeneOntologyTermSet extends HashSet<GeneOntologyTerm> {
// 
// 	private static final long serialVersionUID = 1L;
// 
// 	public GeneOntologyTermSet() {
// 		super();
// 	}
// 
// 	public GeneOntologyTermSet(Collection<GeneOntologyTerm> terms) {
// 		super(terms);
// 	}
// 
// 	public GeneOntologyTermSet getByCategory(GeneOntologyCategory category) {
// 		GeneOntologyTermSet result = new GeneOntologyTermSet();
// 		for (GeneOntologyTerm geneOntologyTerm : this) {
// 			if(geneOntologyTerm.getCategory().equals(category))
// 				result.add(geneOntologyTerm);
// 		}
// 		return result;
// 	}
// 
// 	public List<String> asStringList() {
// 		ArrayList<String> list = new ArrayList<String>();
// 		for (GeneOntologyTerm go : this)
// 			list.add(go.toString());
// 		return list;
// 	}
// }


// Path: src/test/java/ch/picard/ppimapbuilder/data/ontology/goslim/GOSlimOBOParserTest.java
import ch.picard.ppimapbuilder.data.ontology.GeneOntologyTerm;
import ch.picard.ppimapbuilder.data.ontology.GeneOntologyTermSet;
import junit.framework.Assert;
import org.junit.Test;
import java.io.InputStream;

/*   
 * This file is part of PPiMapBuilder.
 *
 * PPiMapBuilder is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * PPiMapBuilder 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
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with PPiMapBuilder.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * Copyright 2015 Echeverria P.C., Dupuis P., Cornut G., Gravouil K., Kieffer A., Picard D.
 * 
 */    	
    
package ch.picard.ppimapbuilder.data.ontology.goslim;



public class GOSlimOBOParserTest {

	@Test
	public void testParseOBOFile() throws Exception {
		GOSlim expected = new GOSlim("oboFileTest");
		expected.add(new GeneOntologyTerm("GO:0005975", "carbohydrate metabolic process", 'P'));
		expected.add(new GeneOntologyTerm("GO:0006091", "generation of precursor metabolites and energy", 'P'));
		expected.add(new GeneOntologyTerm("GO:0006260", "DNA replication", 'P'));
		expected.add(new GeneOntologyTerm("GO:0006281", "DNA repair", 'P'));
		expected.add(new GeneOntologyTerm("GO:0006355", "regulation of transcription, DNA-templated", 'P'));
		expected.add(new GeneOntologyTerm("GO:0006399", "tRNA metabolic process", 'P'));
		expected.add(new GeneOntologyTerm("GO:0006457", "protein folding", 'P'));
		expected.add(new GeneOntologyTerm("GO:0006461", "protein complex assembly", 'P'));
		expected.add(new GeneOntologyTerm("GO:0006486", "protein glycosylation", 'P'));
		expected.add(new GeneOntologyTerm("GO:0006914", "autophagy", 'P'));
		expected.add(new GeneOntologyTerm("GO:0007005", "mitochondrion organization", 'P'));
		expected.add(new GeneOntologyTerm("GO:0007010", "cytoskeleton organization", 'P'));
		expected.add(new GeneOntologyTerm("GO:0007031", "peroxisome organization", 'P'));
		expected.add(new GeneOntologyTerm("GO:0007033", "vacuole organization", 'P'));