From 48935da8225797aada1fe5f0863385b6b57ee67e Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Thu, 20 Oct 2022 10:50:42 +0100 Subject: [PATCH] JAL-2349 adjusted range calculation to be inclusive rather than inclusive, exclusive of bounds --- src/jalview/datamodel/ContactListImpl.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/jalview/datamodel/ContactListImpl.java b/src/jalview/datamodel/ContactListImpl.java index 6eb4cdb..561048e 100644 --- a/src/jalview/datamodel/ContactListImpl.java +++ b/src/jalview/datamodel/ContactListImpl.java @@ -10,7 +10,6 @@ public class ContactListImpl implements ContactListI { ContactListProviderI clist; - public static ContactListI newContactList(ContactListProviderI list) { return new ContactListImpl(list); @@ -53,7 +52,7 @@ public class ContactListImpl implements ContactListI cr.setFrom_column(from_column); cr.setTo_column(to_column); double tot = 0; - for (int i = from_column; i < to_column; i++) + for (int i = from_column; i <= to_column; i++) { double contact = getContactAt(i); tot += contact; @@ -80,7 +79,7 @@ public class ContactListImpl implements ContactListI } if (tot > 0) { - cr.setMean(tot / (to_column - from_column)); + cr.setMean(tot / (1 + to_column - from_column)); } else { -- 1.7.10.2