Clover icon

Coverage Report

  1. Project Clover database Thu Dec 4 2025 14:43:25 GMT
  2. Package jalview.ws.jws2.jabaws2

File AAConClient.java

 

Coverage histogram

../../../../img/srcFileCovDistChart1.png
57% of files have more coverage

Code metrics

2
12
5
1
108
65
7
0.58
2.4
5
1.4

Classes

Class Line # Actions
AAConClient 38 12 7
0.1052631610.5%
 

Contributing tests

This file is covered by 3 tests. .

Source view

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.ws.jws2.jabaws2;
22   
23    import jalview.api.FeatureColourI;
24    import jalview.datamodel.AlignmentAnnotation;
25    import jalview.datamodel.AlignmentI;
26    import jalview.datamodel.features.FeatureMatcherSetI;
27    import jalview.util.MessageManager;
28    import jalview.ws.uimodel.AlignAnalysisUIText;
29   
30    import java.util.ArrayList;
31    import java.util.List;
32    import java.util.Map;
33    import java.util.Set;
34    import java.util.TreeSet;
35   
36    import compbio.data.sequence.Score;
37   
 
38    public class AAConClient extends JabawsAnnotationInstance
39    {
40    // configuration for factory
 
41  0 toggle public static String getServiceActionText()
42    {
43  0 return "calculating Amino acid consensus using AACon service";
44    }
45   
46   
47   
48    private static String CALC_ID = "jabaws2.AACon";
49   
 
50  4 toggle public static AlignAnalysisUIText getAlignAnalysisUIText()
51    {
52  4 return new AlignAnalysisUIText(
53    compbio.ws.client.Services.AAConWS.toString(),
54    AAConClient.class, CALC_ID, false, true, true, true,
55    true, 2, MessageManager.getString("label.aacon_calculations"),
56    MessageManager.getString("tooltip.aacon_calculations"),
57    MessageManager.getString("label.aacon_settings"),
58    MessageManager.getString("tooltip.aacon_settings"));
59    }
60   
61    // instance
 
62  0 toggle public AAConClient(Jws2Instance handle)
63    {
64  0 super(handle);
65    }
66   
 
67  0 toggle @Override
68    List<AlignmentAnnotation> annotationFromScoreManager(AlignmentI seqs,
69    Map<String, FeatureColourI> featureColours,
70    Map<String, FeatureMatcherSetI> featureFilters)
71    {
72  0 return aacons_annotation(seqs.getWidth(), seqs, null);
73    }
74   
 
75  0 toggle private List<AlignmentAnnotation> aacons_annotation(int alWidth,
76    AlignmentI alignViewport, boolean[] gapMap)
77    {
78  0 Map<String, TreeSet<Score>> scoremap = scoremanager.asMap();
79  0 ArrayList<AlignmentAnnotation> ourAnnot = new ArrayList<>();
80  0 for (String score : scoremap.keySet())
81    {
82  0 Set<Score> scores = scoremap.get(score);
83  0 for (Score scr : scores)
84    {
85  0 if (scr.getRanges() != null && scr.getRanges().size() > 0)
86    {
87    /**
88    * annotation in range annotation = findOrCreate(scr.getMethod(),
89    * true, null, null); Annotation[] elm = new Annotation[alWidth];
90    * Iterator<Float> vals = scr.getScores().iterator(); for (Range rng :
91    * scr.getRanges()) { float val = vals.next().floatValue(); for (int i
92    * = rng.from; i <= rng.to; i++) { elm[i] = new Annotation("", "", '
93    * ', val); } } annotation.annotations = elm;
94    * annotation.validateRangeAndDisplay();
95    */
96    }
97    else
98    {
99  0 createAnnotationRowsForScores(alignViewport, null, ourAnnot,
100    getCalcId(),
101    scr.getScores().size(), scr);
102    }
103    }
104    }
105  0 return ourAnnot;
106    }
107   
108    }