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-2089 patch broken merge to master for Release 2.10.0b1
[jalview.git]
/
src
/
jalview
/
analysis
/
AAFrequency.java
diff --git
a/src/jalview/analysis/AAFrequency.java
b/src/jalview/analysis/AAFrequency.java
index
3a79959
..
fb49541
100755
(executable)
--- a/
src/jalview/analysis/AAFrequency.java
+++ b/
src/jalview/analysis/AAFrequency.java
@@
-1,6
+1,6
@@
/*
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
- * Copyright (C) 2015 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
*
* This file is part of Jalview.
*
@@
-32,7
+32,6
@@
import jalview.util.QuickSort;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.List;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.List;
-import java.util.Set;
/**
* Takes in a vector or array of sequences and column start and column end and
/**
* Takes in a vector or array of sequences and column start and column end and
@@
-520,7
+519,7
@@
public class AAFrequency
Hashtable[] hconsensus)
{
final char gapCharacter = alignment.getGapCharacter();
Hashtable[] hconsensus)
{
final char gapCharacter = alignment.getGapCharacter();
- Set<AlignedCodonFrame> mappings = alignment.getCodonFrames();
+ List<AlignedCodonFrame> mappings = alignment.getCodonFrames();
if (mappings == null || mappings.isEmpty())
{
return;
if (mappings == null || mappings.isEmpty())
{
return;
@@
-541,12
+540,16
@@
public class AAFrequency
{
continue;
}
{
continue;
}
- char[] codon = MappingUtils.findCodonFor(seq, col, mappings);
- int codonEncoded = CodingUtils.encodeCodon(codon);
- if (codonEncoded >= 0)
+ List<char[]> codons = MappingUtils
+ .findCodonsFor(seq, col, mappings);
+ for (char[] codon : codons)
{
{
- codonCounts[codonEncoded + 2]++;
- ungappedCount++;
+ int codonEncoded = CodingUtils.encodeCodon(codon);
+ if (codonEncoded >= 0)
+ {
+ codonCounts[codonEncoded + 2]++;
+ ungappedCount++;
+ }
}
}
codonCounts[1] = ungappedCount;
}
}
codonCounts[1] = ungappedCount;
@@
-621,8
+624,11
@@
public class AAFrequency
String modalCodon = String.valueOf(CodingUtils
.decodeCodon(modalCodonEncoded));
if (sortedCodonCounts.length > 1
String modalCodon = String.valueOf(CodingUtils
.decodeCodon(modalCodonEncoded));
if (sortedCodonCounts.length > 1
- && sortedCodonCounts[codons.length - 2] == modalCodonEncoded)
+ && sortedCodonCounts[codons.length - 2] == sortedCodonCounts[codons.length - 1])
{
{
+ /*
+ * two or more codons share the modal count
+ */
modalCodon = "+";
}
float pid = sortedCodonCounts[sortedCodonCounts.length - 1] * 100
modalCodon = "+";
}
float pid = sortedCodonCounts[sortedCodonCounts.length - 1] * 100