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

org.molgenis.omx.xgap.Gene Maven / Gradle / Ivy

There is a newer version: 1.3.0
Show newest version

/* File:        org.molgenis.omx/model/Gene.java
 * Generator:   org.molgenis.generators.DataTypeGen 4.0.0-testing
 *
 * THIS FILE HAS BEEN GENERATED, PLEASE DO NOT EDIT!
 */
 

package org.molgenis.omx.xgap;

import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;

import org.molgenis.data.AttributeMetaData;
import org.molgenis.data.support.MapEntity;
import org.molgenis.data.Entity;

/**
 * Gene:  Trait annotations specific for genes..
 * @author MOLGENIS generator
 */
@javax.persistence.Entity
@javax.persistence.Table(name = "Gene"
)

@javax.xml.bind.annotation.XmlAccessorType(javax.xml.bind.annotation.XmlAccessType.FIELD)
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value={"EI_EXPOSE_REP", "EI_EXPOSE_REP2"}, justification="Exposing internal representation is accepted")
public class Gene extends org.molgenis.omx.observ.ObservationTarget implements org.molgenis.data.Entity, org.molgenis.omx.xgap.Locus
{
    /** default serial version ID */
    private static final long serialVersionUID = 1L;
    
    public final static String ENTITY_NAME = "Gene";
    
	// fieldname constants
	public final static String CHROMOSOME = "Chromosome";
	public final static String CM = "cM";
	public final static String BPSTART = "bpStart";
	public final static String BPEND = "bpEnd";
	public final static String SEQ = "Seq";
	public final static String SYMBOL = "Symbol";
	public final static String ORIENTATION = "Orientation";
	public final static String CONTROL = "Control";
	public final static String ID = "id";
	
	// member variables (including setters.getters for interface)
	public String getEntityName()
	{
		return ENTITY_NAME;
	}
	

	//Reference to the chromosome this     position belongs to.[type=xref]

    @javax.persistence.ManyToOne(fetch=javax.persistence.FetchType.EAGER /*cascade={javax.persistence.CascadeType.MERGE, javax.persistence.CascadeType.PERSIST, javax.persistence.CascadeType.REFRESH}*/)
    @javax.persistence.JoinColumn(name="Chromosome")  
	
				

	private org.molgenis.omx.xgap.Chromosome chromosome = null;

	//genetic map position in centi morgan (cM).[type=decimal]

	@javax.persistence.Column(name="cM")
	@javax.xml.bind.annotation.XmlElement(name="cM")
	
				

	private Double cM =  null;

	//numeric basepair postion (5') on the chromosome[type=long]

	@javax.persistence.Column(name="bpStart")
	@javax.xml.bind.annotation.XmlElement(name="bpStart")
	
				

	private Long bpStart =  null;

	//numeric basepair postion (3') on the chromosome[type=long]

	@javax.persistence.Column(name="bpEnd")
	@javax.xml.bind.annotation.XmlElement(name="bpEnd")
	
				

	private Long bpEnd =  null;

	//The FASTA text representation of the sequence.[type=text]

	@javax.persistence.Lob
	@javax.persistence.Column(name="Seq")
	
				

	private String seq =  null;

	//Main symbol this gene is known by (not necessarily unique, in constrast to 'name')[type=string]

	@javax.persistence.Column(name="Symbol", length=255)
	@javax.xml.bind.annotation.XmlElement(name="symbol")
	
				

	private String symbol =  null;

	//Orientation of the gene on the genome (F=forward, R=reverse)[type=enum]

	@javax.persistence.Column(name="Orientation")
	@javax.xml.bind.annotation.XmlElement(name="orientation")
	
				

	private String orientation =  null;
	@javax.persistence.Transient
	private String orientation_label = null;
	@javax.persistence.Transient
	private static final java.util.List orientation_options;
	
	static {
		orientation_options = new java.util.ArrayList();
		orientation_options.add(new org.molgenis.util.ValueLabel("F","F"));
		orientation_options.add(new org.molgenis.util.ValueLabel("R","R"));
	}

	//Indicating whether this is a 'housekeeping' gene that can be used as control.[type=bool]

	@javax.persistence.Column(name="Control")
	@javax.xml.bind.annotation.XmlElement(name="control")
	
				

	private Boolean control =  null;

	//automatically generated internal id, only for internal use.[type=int]

	

	//constructors
	public Gene()
	{
		//set the type for a new instance
		set__Type(this.getClass().getSimpleName());
	}
	
	//getters and setters
	/**
	 * Get the Reference to the chromosome this     position belongs to..
	 * @return chromosome.
	 */
	public org.molgenis.omx.xgap.Chromosome getChromosome()
	{
		return this.chromosome;
	}	
	
	/**
	 * Set the Reference to the chromosome this     position belongs to..
	 * @param chromosome
	 */
	public void setChromosome( org.molgenis.omx.xgap.Chromosome chromosome)
	{
		
		this.chromosome = chromosome;
	}

	

	/**
	 * Get the genetic map position in centi morgan (cM)..
	 * @return cM.
	 */
	public Double getCM()
	{
		return this.cM;
	}	
	
	/**
	 * Set the genetic map position in centi morgan (cM)..
	 * @param cM
	 */
	public void setCM( Double cM)
	{
		
		this.cM = cM;
	}

	

	/**
	 * Get the numeric basepair postion (5') on the chromosome.
	 * @return bpStart.
	 */
	public Long getBpStart()
	{
		return this.bpStart;
	}	
	
	/**
	 * Set the numeric basepair postion (5') on the chromosome.
	 * @param bpStart
	 */
	public void setBpStart( Long bpStart)
	{
		
		this.bpStart = bpStart;
	}

	

	/**
	 * Get the numeric basepair postion (3') on the chromosome.
	 * @return bpEnd.
	 */
	public Long getBpEnd()
	{
		return this.bpEnd;
	}	
	
	/**
	 * Set the numeric basepair postion (3') on the chromosome.
	 * @param bpEnd
	 */
	public void setBpEnd( Long bpEnd)
	{
		
		this.bpEnd = bpEnd;
	}

	

	/**
	 * Get the The FASTA text representation of the sequence..
	 * @return seq.
	 */
	public String getSeq()
	{
		return this.seq;
	}	
	
	/**
	 * Set the The FASTA text representation of the sequence..
	 * @param seq
	 */
	public void setSeq( String seq)
	{
		
		this.seq = seq;
	}

	

	/**
	 * Get the Main symbol this gene is known by (not necessarily unique, in constrast to 'name').
	 * @return symbol.
	 */
	public String getSymbol()
	{
		return this.symbol;
	}	
	
	/**
	 * Set the Main symbol this gene is known by (not necessarily unique, in constrast to 'name').
	 * @param symbol
	 */
	public void setSymbol( String symbol)
	{
		
		this.symbol = symbol;
	}

	

	/**
	 * Get the Orientation of the gene on the genome (F=forward, R=reverse).
	 * @return orientation.
	 */
	public String getOrientation()
	{
		return this.orientation;
	}	
	
	/**
	 * Set the Orientation of the gene on the genome (F=forward, R=reverse).
	 * @param orientation
	 */
	public void setOrientation( String orientation)
	{
		
		this.orientation = orientation;
	}

	
	/**
	 * Get tha label for enum Orientation.
	 */
	public String getOrientationLabel()
	{
		return this.orientation_label;
	}
	/**
	 * Orientation is enum. This method returns all available enum options.
	 */
	public java.util.List getOrientationOptions()
	{
		return orientation_options;
	}	
	

	/**
	 * Get the Indicating whether this is a 'housekeeping' gene that can be used as control..
	 * @return control.
	 */
	public Boolean getControl()
	{
		return this.control;
	}	
	
	/**
	 * Set the Indicating whether this is a 'housekeeping' gene that can be used as control..
	 * @param control
	 */
	public void setControl( Boolean control)
	{
		
		this.control = control;
	}

	

	

	


	/**
	 * Generic getter. Get the property by using the name.
	 */
	@Override
	public Object get(String name)
	{
		name = name.toLowerCase();
		if (name.equals("id"))
			return getId();
		if (name.equals("identifier"))
			return getIdentifier();
		if (name.equals("name"))
			return getName();
		if (name.equals("__type"))
			return get__Type();
		if(name.equals("__type_label"))
			return get__TypeLabel();			
		if (name.equals("description"))
			return getDescription();
		if (name.equals("chromosome"))
			return getChromosome();
		if (name.equals("cm"))
			return getCM();
		if (name.equals("bpstart"))
			return getBpStart();
		if (name.equals("bpend"))
			return getBpEnd();
		if (name.equals("seq"))
			return getSeq();
		if (name.equals("symbol"))
			return getSymbol();
		if (name.equals("orientation"))
			return getOrientation();
		if(name.equals("orientation_label"))
			return getOrientationLabel();			
		if (name.equals("control"))
			return getControl();
		return null;
	}	
	
	@Override
	public void set(org.molgenis.data.Entity entity, boolean strict)
	{
		//set Id
		// query formal name, else lowercase name
		if(entity.getInt("id") != null) this.setId(entity.getInt("id"));
		else if(entity.getInt("id") != null) this.setId(entity.getInt("id"));
		else if(strict) this.setId(entity.getInt("id")); // setting null is not an option due to function overloading
		if( entity.getInt("gene_id") != null) this.setId(entity.getInt("gene_id"));
		else if( entity.getInt("Gene_id") != null) this.setId(entity.getInt("Gene_id"));
		//set Identifier
		// query formal name, else lowercase name
		if(entity.getString("identifier") != null) this.setIdentifier(entity.getString("identifier"));
		else if(entity.getString("Identifier") != null) this.setIdentifier(entity.getString("Identifier"));
		else if(strict) this.setIdentifier(entity.getString("identifier")); // setting null is not an option due to function overloading
		if( entity.getString("gene_identifier") != null) this.setIdentifier(entity.getString("gene_identifier"));
		else if( entity.getString("Gene_Identifier") != null) this.setIdentifier(entity.getString("Gene_Identifier"));
		//set Name
		// query formal name, else lowercase name
		if(entity.getString("name") != null) this.setName(entity.getString("name"));
		else if(entity.getString("Name") != null) this.setName(entity.getString("Name"));
		else if(strict) this.setName(entity.getString("name")); // setting null is not an option due to function overloading
		if( entity.getString("gene_name") != null) this.setName(entity.getString("gene_name"));
		else if( entity.getString("Gene_Name") != null) this.setName(entity.getString("Gene_Name"));
		//set __Type
		// query formal name, else lowercase name
		if(entity.getString("__type") != null) this.set__Type(entity.getString("__type"));
		else if(entity.getString("__Type") != null) this.set__Type(entity.getString("__Type"));
		else if(strict) this.set__Type(entity.getString("__type")); // setting null is not an option due to function overloading
		if( entity.getString("gene___type") != null) this.set__Type(entity.getString("gene___type"));
		else if( entity.getString("Gene___Type") != null) this.set__Type(entity.getString("Gene___Type"));
		//set Description
		// query formal name, else lowercase name
		if(entity.getString("description") != null) this.setDescription(entity.getString("description"));
		else if(entity.getString("description") != null) this.setDescription(entity.getString("description"));
		else if(strict) this.setDescription(entity.getString("description")); // setting null is not an option due to function overloading
		if( entity.getString("gene_description") != null) this.setDescription(entity.getString("gene_description"));
		else if( entity.getString("Gene_description") != null) this.setDescription(entity.getString("Gene_description"));
		//set Chromosome
		// query formal name, else lowercase name
		if( entity.getEntity("Chromosome", org.molgenis.omx.xgap.Chromosome.class) != null) { 
			this.setChromosome(entity.getEntity("Chromosome", org.molgenis.omx.xgap.Chromosome.class));				
		}
		else if( entity.getEntity("chromosome", org.molgenis.omx.xgap.Chromosome.class) != null) { 
			this.setChromosome(entity.getEntity("chromosome", org.molgenis.omx.xgap.Chromosome.class));				
		}
		else if( entity.getEntity("Gene_Chromosome", org.molgenis.omx.xgap.Chromosome.class) != null) { 
			this.setChromosome(entity.getEntity("Gene_Chromosome", org.molgenis.omx.xgap.Chromosome.class));				
		}
		else if( entity.getEntity("gene_chromosome", org.molgenis.omx.xgap.Chromosome.class) != null) { 
			this.setChromosome(entity.getEntity("Gene_Chromosome", org.molgenis.omx.xgap.Chromosome.class));				
		}
		//set CM
		// query formal name, else lowercase name
		if(entity.getDouble("cm") != null) this.setCM(entity.getDouble("cm"));
		else if(entity.getDouble("cM") != null) this.setCM(entity.getDouble("cM"));
		else if(strict) this.setCM(entity.getDouble("cm")); // setting null is not an option due to function overloading
		if( entity.getDouble("gene_cm") != null) this.setCM(entity.getDouble("gene_cm"));
		else if( entity.getDouble("Gene_cM") != null) this.setCM(entity.getDouble("Gene_cM"));
		//set BpStart
		// query formal name, else lowercase name
		if(entity.getLong("bpstart") != null) this.setBpStart(entity.getLong("bpstart"));
		else if(entity.getLong("bpStart") != null) this.setBpStart(entity.getLong("bpStart"));
		else if(strict) this.setBpStart(entity.getLong("bpstart")); // setting null is not an option due to function overloading
		if( entity.getLong("gene_bpstart") != null) this.setBpStart(entity.getLong("gene_bpstart"));
		else if( entity.getLong("Gene_bpStart") != null) this.setBpStart(entity.getLong("Gene_bpStart"));
		//set BpEnd
		// query formal name, else lowercase name
		if(entity.getLong("bpend") != null) this.setBpEnd(entity.getLong("bpend"));
		else if(entity.getLong("bpEnd") != null) this.setBpEnd(entity.getLong("bpEnd"));
		else if(strict) this.setBpEnd(entity.getLong("bpend")); // setting null is not an option due to function overloading
		if( entity.getLong("gene_bpend") != null) this.setBpEnd(entity.getLong("gene_bpend"));
		else if( entity.getLong("Gene_bpEnd") != null) this.setBpEnd(entity.getLong("Gene_bpEnd"));
		//set Seq
		// query formal name, else lowercase name
		if(entity.getString("seq") != null) this.setSeq(entity.getString("seq"));
		else if(entity.getString("Seq") != null) this.setSeq(entity.getString("Seq"));
		else if(strict) this.setSeq(entity.getString("seq")); // setting null is not an option due to function overloading
		if( entity.getString("gene_seq") != null) this.setSeq(entity.getString("gene_seq"));
		else if( entity.getString("Gene_Seq") != null) this.setSeq(entity.getString("Gene_Seq"));
		//set Symbol
		// query formal name, else lowercase name
		if(entity.getString("symbol") != null) this.setSymbol(entity.getString("symbol"));
		else if(entity.getString("Symbol") != null) this.setSymbol(entity.getString("Symbol"));
		else if(strict) this.setSymbol(entity.getString("symbol")); // setting null is not an option due to function overloading
		if( entity.getString("gene_symbol") != null) this.setSymbol(entity.getString("gene_symbol"));
		else if( entity.getString("Gene_Symbol") != null) this.setSymbol(entity.getString("Gene_Symbol"));
		//set Orientation
		// query formal name, else lowercase name
		if(entity.getString("orientation") != null) this.setOrientation(entity.getString("orientation"));
		else if(entity.getString("Orientation") != null) this.setOrientation(entity.getString("Orientation"));
		else if(strict) this.setOrientation(entity.getString("orientation")); // setting null is not an option due to function overloading
		if( entity.getString("gene_orientation") != null) this.setOrientation(entity.getString("gene_orientation"));
		else if( entity.getString("Gene_Orientation") != null) this.setOrientation(entity.getString("Gene_Orientation"));
		//set Control
		// query formal name, else lowercase name
		if(entity.getBoolean("control") != null) this.setControl(entity.getBoolean("control"));
		else if(entity.getBoolean("Control") != null) this.setControl(entity.getBoolean("Control"));
		else if(strict) this.setControl(entity.getBoolean("control")); // setting null is not an option due to function overloading
		if( entity.getBoolean("gene_control") != null) this.setControl(entity.getBoolean("gene_control"));
		else if( entity.getBoolean("Gene_Control") != null) this.setControl(entity.getBoolean("Gene_Control"));
	}
	
	@Override
	public String toString()
	{
		return this.toString(false);
	}
	
	public String toString(boolean verbose)
	{
		StringBuilder sb = new StringBuilder("Gene(");
		sb.append("id='" + getId()+"' ");	
		sb.append("identifier='" + getIdentifier()+"' ");	
		sb.append("name='" + getName()+"' ");	
		sb.append("__Type='" + get__Type()+"' ");	
		sb.append("description='" + getDescription()+"' ");	
		sb.append("chromosome='" + getChromosome()+"' ");	
		sb.append("cM='" + getCM()+"' ");	
		sb.append("bpStart='" + getBpStart()+"' ");	
		sb.append("bpEnd='" + getBpEnd()+"' ");	
		sb.append("seq='" + getSeq()+"' ");	
		sb.append("symbol='" + getSymbol()+"' ");	
		sb.append("orientation='" + getOrientation()+"' ");	
		sb.append("control='" + getControl()+"'");	
		sb.append(");");
		return sb.toString();
	}

	@Override
	public Integer getIdValue()
	{
		return getId();
	}		
	

	@Override
	public Iterable getAttributeNames()
	{
		Set attributeNames = new LinkedHashSet();
		for (AttributeMetaData attr : new GeneMetaData().getAttributes())
		{
			attributeNames.add(attr.getName());
		}

		return attributeNames;
	}
	
	@Override
	public java.util.List getLabelAttributeNames()
	{
		java.util.List result = new java.util.ArrayList();
		result.add("Identifier");
		return result;
	}

	@Override
	public void set(String attributeName, Object value)
	{
		if("id".equalsIgnoreCase(attributeName)) {
			this.setId((Integer)value); 
			return;
		}
		if("Identifier".equalsIgnoreCase(attributeName)) {
			this.setIdentifier((String)value); 
			return;
		}
		if("Name".equalsIgnoreCase(attributeName)) {
			this.setName((String)value); 
			return;
		}
		if("__Type".equalsIgnoreCase(attributeName)) {
			this.set__Type((String)value); 
			return;
		}
		if("description".equalsIgnoreCase(attributeName)) {
			this.setDescription((String)value); 
			return;
		}
		if("Chromosome".equalsIgnoreCase(attributeName)) {
			org.molgenis.omx.xgap.Chromosome e = new org.molgenis.omx.xgap.Chromosome();
			e.set((Entity)value);
			this.setChromosome(e); 
			return;
		}
		if("cM".equalsIgnoreCase(attributeName)) {
			this.setCM((Double)value); 
			return;
		}
		if("bpStart".equalsIgnoreCase(attributeName)) {
			this.setBpStart((Long)value); 
			return;
		}
		if("bpEnd".equalsIgnoreCase(attributeName)) {
			this.setBpEnd((Long)value); 
			return;
		}
		if("Seq".equalsIgnoreCase(attributeName)) {
			this.setSeq((String)value); 
			return;
		}
		if("Symbol".equalsIgnoreCase(attributeName)) {
			this.setSymbol((String)value); 
			return;
		}
		if("Orientation".equalsIgnoreCase(attributeName)) {
			this.setOrientation((String)value); 
			return;
		}
		if("Control".equalsIgnoreCase(attributeName)) {
			this.setControl((Boolean)value); 
			return;
		}
	}

	@Override
	public boolean equals(Object obj)
	{
		if (this == obj) return true;
		if (obj == null) return false;
		if (!super.equals(obj)) return false;
		if (getClass() != obj.getClass()) return false;
		return true;
	}
	
	@Override
	public int hashCode()
	{
		int result = super.hashCode();
		return result;
	}
	
	@Override
	public org.molgenis.data.EntityMetaData getEntityMetaData()
	{
		return new GeneMetaData();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy