001/* 002 * BioJava development code 003 * 004 * This code may be freely distributed and modified under the 005 * terms of the GNU Lesser General Public Licence. This should 006 * be distributed with the code. If you do not have a copy, 007 * see: 008 * 009 * http://www.gnu.org/copyleft/lesser.html 010 * 011 * Copyright for this code is held jointly by the individual 012 * authors. These should be listed in @author doc comments. 013 * 014 * For more information on the BioJava project and its aims, 015 * or to join the biojava-l mailing list, visit the home page 016 * at: 017 * 018 * http://www.biojava.org/ 019 * 020 * Created on 01-21-2010 021 */ 022 023package org.biojava.nbio.core.sequence.features; 024 025import org.biojava.nbio.core.sequence.loader.UniprotProxySequenceReader; 026 027import java.util.LinkedHashMap; 028import java.util.Map; 029 030/** 031 * If you have a uniprot ID then it is possible to get a collection 032 * of other id(s) that the protein is known by. This is a place holder 033 * for the alternative source database and the id for the same protein. 034 * Currently implement when the {@link UniprotProxySequenceReader} is used 035 * to load a protein sequence 036 * 037 * @author Scooter Willis 038 * @author Paolo Pavan 039 */ 040public class DBReferenceInfo extends Qualifier { 041 private Map<String, String> properties = new LinkedHashMap<>(); 042 private String database = ""; 043 private String id = ""; 044 045 /** 046 * The source database and id 047 * @param database 048 * @param id 049 */ 050 public DBReferenceInfo(String database, String id){ 051 super("db_xref",""); 052 this.database = database; 053 this.id = id; 054 } 055 056 /** 057 * Add a property and type to associate with this DBReferenceInfo 058 * @param type 059 * @param value 060 */ 061 062 public void addProperty(String type, String value){ 063 properties.put(type, value); 064 } 065 066 /** 067 * Get the properties 068 * @return the properties 069 */ 070 public Map<String, String> getProperties() { 071 return properties; 072 } 073 074 /** 075 * @param properties the properties to set 076 */ 077 public void setProperties(Map<String, String> properties) { 078 this.properties = properties; 079 } 080 081 /** 082 * @return the database 083 */ 084 public String getDatabase() { 085 return database; 086 } 087 088 /** 089 * @param database the database to set 090 */ 091 public void setDatabase(String database) { 092 this.database = database; 093 } 094 095 /** 096 * @return the id 097 */ 098 public String getId() { 099 return id; 100 } 101 102 /** 103 * @param id the id to set 104 */ 105 public void setId(String id) { 106 this.id = id; 107 } 108 109 @Override 110 public String toString() { 111 return database + ":" + id + ":" + properties; 112 } 113 114 115 116}