git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-4235 JAL-3599 Try and report Eclipse Product Version for jalviewjsTranspile....
[jalview.git]
/
src
/
jalview
/
datamodel
/
ContactMatrix.java
diff --git
a/src/jalview/datamodel/ContactMatrix.java
b/src/jalview/datamodel/ContactMatrix.java
index
f2e207c
..
48b6e6b
100644
(file)
--- a/
src/jalview/datamodel/ContactMatrix.java
+++ b/
src/jalview/datamodel/ContactMatrix.java
@@
-1,7
+1,10
@@
package jalview.datamodel;
package jalview.datamodel;
+import java.awt.Color;
import java.math.BigInteger;
import java.util.ArrayList;
import java.math.BigInteger;
import java.util.ArrayList;
+import java.util.BitSet;
+import java.util.HashMap;
import java.util.List;
import java.util.Spliterator;
import java.util.StringTokenizer;
import java.util.List;
import java.util.Spliterator;
import java.util.StringTokenizer;
@@
-147,45
+150,43
@@
public abstract class ContactMatrix implements ContactMatrixI
}
@Override
}
@Override
- public boolean hasReferenceSeq()
+ public String getAnnotLabel()
{
{
- // TODO Auto-generated method stub
- return false;
+ return "Contact Matrix";
}
@Override
}
@Override
- public SequenceI getReferenceSeq()
+ public String getAnnotDescr()
{
{
- // TODO Auto-generated method stub
- return null;
+ return "Contact Matrix";
}
}
-
+ GroupSet grps = new GroupSet();
@Override
@Override
- public String getAnnotLabel()
+ public GroupSetI getGroupSet()
{
{
- return "Contact Matrix";
+ return grps;
}
}
-
@Override
@Override
- public String getAnnotDescr()
+ public void setGroupSet(GroupSet makeGroups)
{
{
- return "Contact Matrix";
+ grps = makeGroups;
}
}
-
public static String contactToFloatString(ContactMatrixI cm)
{
StringBuilder sb = new StringBuilder();
public static String contactToFloatString(ContactMatrixI cm)
{
StringBuilder sb = new StringBuilder();
- for (int c=0;c<cm.getWidth();c++)
+ for (int c = 0; c < cm.getWidth(); c++)
{
{
- ContactListI cl=cm.getContactList(c);
- if (cl!=null) {
- for (int h=0;h<=cl.getContactHeight();h++)
+ ContactListI cl = cm.getContactList(c);
+ if (cl != null)
{
{
- if (sb.length()>0) {
- sb.append('\t');
+ for (int h = 0; h <= cl.getContactHeight(); h++)
+ {
+ if (sb.length() > 0)
+ {
+ sb.append('\t');
+ }
+ sb.append(cl.getContactAt(h));
}
}
- sb.append(cl.getContactAt(h));
- }
}
}
return sb.toString();
}
}
return sb.toString();
@@
-195,29
+196,27
@@
public abstract class ContactMatrix implements ContactMatrixI
int rows)
{
float[][] vals = new float[cols][rows];
int rows)
{
float[][] vals = new float[cols][rows];
- StringTokenizer tabsep = new StringTokenizer(values,""+'\t');
- int c=0,r=0;
-
+ StringTokenizer tabsep = new StringTokenizer(values, "" + '\t');
+ int c = 0, r = 0;
while (tabsep.hasMoreTokens())
{
double elem = Double.valueOf(tabsep.nextToken());
while (tabsep.hasMoreTokens())
{
double elem = Double.valueOf(tabsep.nextToken());
- vals[c][r++]=(float) elem;
- if (r>=vals[c].length)
+ vals[c][r++] = (float) elem;
+ if (r >= vals[c].length)
{
{
- r=0;
+ r = 0;
c++;
}
c++;
}
- if (c>=vals.length)
+ if (c >= vals.length)
{
{
-
break;
}
}
if (tabsep.hasMoreElements())
{
break;
}
}
if (tabsep.hasMoreElements())
{
- Console.warn("Ignoring additional elements for Float string to contact matrix parsing.");
+ Console.warn(
+ "Ignoring additional elements for Float string to contact matrix parsing.");
}
}
-
return vals;
}
}
return vals;
}
}