13223af41991e4a64a39568f27b7af7e88f74f22
[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.xml.binding.sifts.Entry.Entity;
26
27 import java.util.HashSet;
28
29 public interface SiftsClientI
30 {
31   /**
32    * Get the DB Accession Id for the SIFTs Entry
33    * 
34    * @return
35    */
36   public String getDbAccessionId();
37
38   /**
39    * Get DB Coordinate system for the SIFTs Entry
40    * 
41    * @return
42    */
43   public String getDbCoordSys();
44
45   /**
46    * Get DB Evidence for the SIFTs Entry
47    * 
48    * @return
49    */
50   public String getDbEvidence();
51
52   /**
53    * Get DB Source for the SIFTs Entry
54    * 
55    * @return
56    */
57   public String getDbSource();
58
59   /**
60    * Get DB version for the SIFTs Entry
61    * 
62    * @return
63    */
64   public String getDbVersion();
65
66   /**
67    * Get Number of Entities available in the SIFTs Entry
68    * 
69    * @return
70    */
71   public int getEntityCount();
72
73   /**
74    * Get a unique Entity by its Id
75    * 
76    * @param id
77    *          ID of the entity to fetch
78    * @return Entity
79    * @throws Exception
80    */
81   public Entity getEntityById(String id) throws Exception;
82
83   /**
84    * Get all accession Ids available in the current SIFTs entry
85    * 
86    * @return a unique set of discovered accession strings
87    */
88   public HashSet<String> getAllMappingAccession();
89
90   /**
91    * Check if the accessionId is available in current SIFTs Entry
92    * 
93    * @param accessionId
94    * @return
95    */
96   public boolean isFoundInSiftsEntry(String accessionId);
97
98   /**
99    * Get the standard DB referenced by the SIFTs Entry
100    * 
101    * @return
102    */
103   public String[] getEntryDBs();
104
105   /**
106    * Get the SIFTs Entry details
107    */
108   public void getEntryDetails();
109
110   /**
111    * 
112    * @param seq1
113    *          Sequence to map
114    * @param seq2
115    *          Structure Sequence
116    * @param seqID1
117    *          sequence id
118    * @param seqID2
119    *          structure sequence id
120    * @param seqType
121    *          type of sequence for the mapping (pep or protein)
122    * @param nochunks
123    * @return sequence->structure mapping as int [][]
124    */
125   public StringBuffer getMappingOutput(String seq1, String seq2,
126           String seqID1, String seqID2, String seqType, int nochunks);
127
128   /**
129    * 
130    * @param seq
131    *          sequence to generate mapping against the structure
132    * @param pdbFile
133    *          PDB file for the mapping
134    * @param chain
135    *          the chain of the entry to use for mapping
136    * @return StructureMapping
137    */
138   public StructureMapping getSiftsStructureMapping(SequenceI seq, String pdbFile,
139           String chain);
140   
141   /**
142    * Get residue by residue mapping for a given Sequence and SIFTs entity
143    * 
144    * @param entityId
145    *          Id of the target entity in the SIFTs entry
146    * @param seq
147    *          SequenceI
148    * @return generated mapping
149    * @throws Exception
150    */
151   public int[][] getGreedyMapping(String entityId, SequenceI seq,
152           java.io.PrintStream os) throws Exception;
153 }