All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.julielab.geneexpbase.genemodel.GeneSets Maven / Gradle / Ivy

package de.julielab.geneexpbase.genemodel;

import java.util.Comparator;
import java.util.Optional;
import java.util.TreeSet;

public class GeneSets extends TreeSet {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6355234489729844255L;

	public GeneSets() {
		super(Comparator.comparingInt(GeneSet::getSmallestGeneBegin).thenComparingInt(System::identityHashCode));
	}

	public GeneSet getGeneSet(String taxId) {
		Optional any = stream().filter(gs -> gs.getTaxId().equals(taxId)).findAny();
		if (!any.isPresent())
			throw new IllegalArgumentException("These gene sets do not contain a gene set for taxonomy ID " + taxId);
		return any.get();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy