From: gmungoc Date: Fri, 18 Nov 2016 08:55:47 +0000 (+0000) Subject: JAL-98 with the two types missing from last commit Profiles[I] ! X-Git-Tag: Release_2_10_1~11^2^2~1^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fbug%2FJAL-98consensusMemory;p=jalview.git JAL-98 with the two types missing from last commit Profiles[I] ! --- diff --git a/src/jalview/datamodel/Profiles.java b/src/jalview/datamodel/Profiles.java new file mode 100644 index 0000000..98a8c6d --- /dev/null +++ b/src/jalview/datamodel/Profiles.java @@ -0,0 +1,43 @@ +package jalview.datamodel; + +public class Profiles implements ProfilesI +{ + + private ProfileI[] profiles; + + public Profiles(ProfileI[] p) + { + profiles = p; + } + + /** + * Returns the profile for the given column, or null if none found + * + * @param col + */ + @Override + public ProfileI get(int col) + { + return profiles != null && col >= 0 && col < profiles.length ? profiles[col] + : null; + } + + /** + * Returns the first column (base 0) covered by the profiles + */ + @Override + public int getStartColumn() + { + return 0; + } + + /** + * Returns the last column (base 0) covered by the profiles + */ + @Override + public int getEndColumn() + { + return profiles == null ? 0 : profiles.length - 1; + } + +} diff --git a/src/jalview/datamodel/ProfilesI.java b/src/jalview/datamodel/ProfilesI.java new file mode 100644 index 0000000..6719de6 --- /dev/null +++ b/src/jalview/datamodel/ProfilesI.java @@ -0,0 +1,12 @@ +package jalview.datamodel; + +public interface ProfilesI +{ + + ProfileI get(int i); + + int getStartColumn(); + + int getEndColumn(); + +} diff --git a/src/jalview/workers/ConsensusThread.java b/src/jalview/workers/ConsensusThread.java index b6c7a91..debe45d 100644 --- a/src/jalview/workers/ConsensusThread.java +++ b/src/jalview/workers/ConsensusThread.java @@ -200,7 +200,8 @@ public class ConsensusThread extends AlignCalcWorker { long nseq = getSequences().length; - AAFrequency.completeConsensus(consensusAnnotation, hconsensus, 0, + AAFrequency.completeConsensus(consensusAnnotation, hconsensus, + hconsensus.getStartColumn(), hconsensus.getEndColumn() + 1, alignViewport.isIgnoreGapsConsensus(), alignViewport.isShowSequenceLogo(), nseq);