001/** 002 * Copyright (C) 2010-2015 The Roslin Institute <contact andy.law@roslin.ed.ac.uk> 003 * 004 * This file is part of JEnsembl: a Java API to Ensembl data sources developed by the 005 * Bioinformatics Group at The Roslin Institute, The Royal (Dick) School of 006 * Veterinary Studies, University of Edinburgh. 007 * 008 * Project hosted at: http://jensembl.sourceforge.net 009 * 010 * This is free software: you can redistribute it and/or modify 011 * it under the terms of the GNU General Public License (version 3) as published by 012 * the Free Software Foundation. 013 * 014 * This software is distributed in the hope that it will be useful, 015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 017 * GNU General Public License for more details. 018 * 019 * You should have received a copy of the GNU General Public License 020 * in this software distribution. If not, see: http://opensource.org/licenses/gpl-3.0.html 021 */ 022package uk.ac.roslin.ensembl.datasourceaware.core; 023 024import uk.ac.roslin.ensembl.config.EnsemblCoreObjectType; 025import uk.ac.roslin.ensembl.dao.factory.DAOCoreFactory; 026import uk.ac.roslin.ensembl.model.ObjectType; 027import uk.ac.roslin.ensembl.model.core.Analysis; 028import uk.ac.roslin.ensembl.model.core.ProteinFeature; 029 030//@todo - this was just a demo class - not properly modelled 031//need to refactor to use Mappings 032public class DAProteinFeature extends DACoreObject implements ProteinFeature { 033 034 private int translationID; 035 private int sourceStart; 036 private int sourceEnd; 037 private String targetName; 038 private int targetStart; 039 private int targetEnd; 040 private Integer analysisID = null; 041 private Double score; 042 private Double eValue; 043 private Double percentIdentity; 044 045 046 public DAProteinFeature() { 047 } 048 049 public DAProteinFeature(DAOCoreFactory factory) { 050 super(factory); 051 } 052 053 @Override 054 public Integer getAnalysisID() { 055 return analysisID; 056 } 057 058 @Override 059 public void setAnalysisID(Integer analysisID) { 060 this.analysisID = analysisID; 061 } 062 063 @Override 064 public Analysis getAnalysis() { 065 if (this.getDaoFactory()==null) { 066 return null; 067 } 068 return this.getDaoFactory().getAnalysis(this.getAnalysisID()); 069 } 070 071 @Override 072 public Double getEValue() { 073 return eValue; 074 } 075 076 @Override 077 public void setEValue(Double eValue) { 078 this.eValue = eValue; 079 } 080 081 @Override 082 public Double getPercentIdentity() { 083 return percentIdentity; 084 } 085 086 @Override 087 public void setPercentIdentity(Double percentIdentity) { 088 this.percentIdentity = percentIdentity; 089 } 090 091 @Override 092 public Double getScore() { 093 return score; 094 } 095 096 @Override 097 public void setScore(Double score) { 098 this.score = score; 099 } 100 101 @Override 102 public int getSourceEnd() { 103 return sourceEnd; 104 } 105 106 @Override 107 public void setSourceEnd(int sourceEnd) { 108 this.sourceEnd = sourceEnd; 109 } 110 111 @Override 112 public int getSourceStart() { 113 return sourceStart; 114 } 115 116 @Override 117 public void setSourceStart(int sourceStart) { 118 this.sourceStart = sourceStart; 119 } 120 121 @Override 122 public int getTargetEnd() { 123 return targetEnd; 124 } 125 126 @Override 127 public void setTargetEnd(int targetEnd) { 128 this.targetEnd = targetEnd; 129 } 130 131 @Override 132 public String getTargetName() { 133 return targetName; 134 } 135 136 @Override 137 public void setTargetName(String targetName) { 138 this.targetName = targetName; 139 } 140 141 @Override 142 public int getTargetStart() { 143 return targetStart; 144 } 145 146 @Override 147 public void setTargetStart(int targetStart) { 148 this.targetStart = targetStart; 149 } 150 151 @Override 152 public int getTranslationID() { 153 return translationID; 154 } 155 156 @Override 157 public void setTranslationID(int translationID) { 158 this.translationID = translationID; 159 } 160 161 @Override 162 public ObjectType getType() { 163 return EnsemblCoreObjectType.proteinFeature; 164 } 165}