JAL-1479 added support for SIFTs mapping output viewing and implemented exception...
[jalview.git] / src / jalview / api / SiftsClientI.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3  * Copyright (C) $$Year-Rel$$ The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3
10  * of the License, or (at your option) any later version.
11  *  
12  * Jalview is distributed in the hope that it will be useful, but 
13  * WITHOUT ANY WARRANTY; without even the implied warranty 
14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15  * PURPOSE.  See the GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License
18  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
19  * The Jalview Authors are detailed in the 'AUTHORS' file.
20  */
21 package jalview.api;
22
23 import jalview.datamodel.SequenceI;
24 import jalview.structure.StructureMapping;
25 import jalview.ws.sifts.MappingOutputPojo;
26 import jalview.ws.sifts.SiftsException;
27 import jalview.xml.binding.sifts.Entry.Entity;
28
29 import java.util.HashSet;
30
31 public interface SiftsClientI
32 {
33   /**
34    * Get the DB Accession Id for the SIFTs Entry
35    * 
36    * @return
37    */
38   public String getDbAccessionId();
39
40   /**
41    * Get DB Coordinate system for the SIFTs Entry
42    * 
43    * @return
44    */
45   public String getDbCoordSys();
46
47   /**
48    * Get DB Evidence for the SIFTs Entry
49    * 
50    * @return
51    */
52   public String getDbEvidence();
53
54   /**
55    * Get DB Source for the SIFTs Entry
56    * 
57    * @return
58    */
59   public String getDbSource();
60
61   /**
62    * Get DB version for the SIFTs Entry
63    * 
64    * @return
65    */
66   public String getDbVersion();
67
68   /**
69    * Get Number of Entities available in the SIFTs Entry
70    * 
71    * @return
72    */
73   public int getEntityCount();
74
75   /**
76    * Get a unique Entity by its Id
77    * 
78    * @param id
79    *          ID of the entity to fetch
80    * @return Entity
81    * @throws Exception
82    */
83   public Entity getEntityById(String id) throws SiftsException;
84
85   /**
86    * Get all accession Ids available in the current SIFTs entry
87    * 
88    * @return a unique set of discovered accession strings
89    */
90   public HashSet<String> getAllMappingAccession();
91
92   /**
93    * Check if the accessionId is available in current SIFTs Entry
94    * 
95    * @param accessionId
96    * @return
97    */
98   public boolean isFoundInSiftsEntry(String accessionId);
99
100   /**
101    * Get the standard DB referenced by the SIFTs Entry
102    * 
103    * @return
104    */
105   public String[] getEntryDBs();
106
107   /**
108    * 
109    * @param mop
110    *          MappingOutputPojo
111    * @return Sequence<->Structure mapping as int[][]
112    */
113   public StringBuffer getMappingOutput(MappingOutputPojo mop);
114
115   /**
116    * 
117    * @param seq
118    *          sequence to generate mapping against the structure
119    * @param pdbFile
120    *          PDB file for the mapping
121    * @param chain
122    *          the chain of the entry to use for mapping
123    * @return StructureMapping
124    * @throws SiftsException
125    */
126   public StructureMapping getSiftsStructureMapping(SequenceI seq,
127           String pdbFile, String chain) throws SiftsException;
128   
129   /**
130    * Get residue by residue mapping for a given Sequence and SIFTs entity
131    * 
132    * @param entityId
133    *          Id of the target entity in the SIFTs entry
134    * @param seq
135    *          SequenceI
136    * @return generated mapping
137    * @throws Exception
138    */
139   public int[][] getGreedyMapping(String entityId, SequenceI seq,
140           java.io.PrintStream os) throws SiftsException;
141 }