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

org.opencb.biodata.models.pathway.BiopaxPathway Maven / Gradle / Ivy

The newest version!
/*
 * 
 *
 */

package org.opencb.biodata.models.pathway;

import java.util.*;


public class BiopaxPathway {
	String id, name, dbName, dbSource, dbVersion, parentPathway;
	List species = new ArrayList();
	List displayName = new ArrayList();
	List xref = new ArrayList();
	
	List physicalEntities = new ArrayList();
	List subPathways = new ArrayList();
	List interactions = new ArrayList();
	
	List> allInteractionsIDs = new ArrayList>();
	List> allEntitiesIDs = new ArrayList>();
	
	public Set addedEntities = new HashSet();
	public Set addedInteractions = new HashSet();
	
	public BiopaxPathway(String name, String dbName, String dbSource, String dbVersion, List species, List displayName, List xref) {
		this.name = name;
		this.dbName = dbName;
		this.dbSource = dbSource;
		this.dbVersion = dbVersion;
		this.species = species;
		this.displayName = displayName;
		this.xref = xref;
		
		this.id = this.dbSource + "_" + this.dbVersion + "_" + this.name;
	}
	
	public String getName() {
		return name;
	}
	
	public List getSubPathways() {
		return subPathways;
	}
	
	public List getInteractions() {
		return interactions;
	}
	
	public List getphysicalEntities() {
		return physicalEntities;
	}
	
	public List> getAllInteractionsIDs() {
		return allInteractionsIDs;
	}
	
	public List> getAllEntitiesIDs() {
		return allEntitiesIDs;
	}
	
	public void setParentPathway(String parent) {
		this.parentPathway = parent;
	}
	
	public void addInteraction(Interaction interaction) {
		if(!addedInteractions.contains(interaction.name)) {
			addedInteractions.add(interaction.name);
			interactions.add(interaction);
		}
	}
	
	public void addPhysicalEntity(PhysicalEntity entity) {
		if(!addedEntities.contains(entity.name)) {
			addedEntities.add(entity.name);
			physicalEntities.add(entity);
		}
	}
	
	public void addInteractionId(Map interactionObj) {
		if(!allInteractionsIDs.contains(interactionObj)) {
			allInteractionsIDs.add(interactionObj);
		}
	}
	
	public void addEntityId(Map entityObj) {
		if(!allEntitiesIDs.contains(entityObj)) {
			allEntitiesIDs.add(entityObj);
		}
	}
}