git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6742805
)
JAL-2416 remove unused pep, dna alphabets, unused methods, code format
author
gmungoc
<g.m.carstairs@dundee.ac.uk>
Mon, 20 Feb 2017 10:35:32 +0000
(10:35 +0000)
committer
gmungoc
<g.m.carstairs@dundee.ac.uk>
Mon, 20 Feb 2017 10:35:32 +0000
(10:35 +0000)
tidy
src/jalview/analysis/AlignSeq.java
patch
|
blob
|
history
diff --git
a/src/jalview/analysis/AlignSeq.java
b/src/jalview/analysis/AlignSeq.java
index
ed4e3bc
..
86dd3bc
100755
(executable)
--- a/
src/jalview/analysis/AlignSeq.java
+++ b/
src/jalview/analysis/AlignSeq.java
@@
-20,7
+20,6
@@
*/
package jalview.analysis;
*/
package jalview.analysis;
-import jalview.analysis.scoremodels.PairwiseSeqScoreModel;
import jalview.analysis.scoremodels.ScoreMatrix;
import jalview.analysis.scoremodels.ScoreModels;
import jalview.datamodel.AlignmentAnnotation;
import jalview.analysis.scoremodels.ScoreMatrix;
import jalview.analysis.scoremodels.ScoreModels;
import jalview.datamodel.AlignmentAnnotation;
@@
-55,12
+54,6
@@
public class AlignSeq
private static final String NEWLINE = System.lineSeparator();
private static final String NEWLINE = System.lineSeparator();
- static String[] dna = { "A", "C", "G", "T", "-" };
-
- // "C", "T", "A", "G", "-"};
- static String[] pep = { "A", "R", "N", "D", "C", "Q", "E", "G", "H", "I",
- "L", "K", "M", "F", "P", "S", "T", "W", "Y", "V", "B", "Z", "X", "-" };
-
float[][] score;
float[][] E;
float[][] score;
float[][] E;
@@
-120,10
+113,6
@@
public class AlignSeq
float[][] lookup = ScoreModels.getInstance().getBlosum62().getMatrix();
float[][] lookup = ScoreModels.getInstance().getBlosum62().getMatrix();
- // ResidueProperties.getBLOSUM62();
-
- String[] intToStr = pep;
-
int defInt = 23;
StringBuffer output = new StringBuffer();
int defInt = 23;
StringBuffer output = new StringBuffer();
@@
-144,7
+133,7
@@
public class AlignSeq
*/
public AlignSeq(SequenceI s1, SequenceI s2, String type)
{
*/
public AlignSeq(SequenceI s1, SequenceI s2, String type)
{
- SeqInit(s1, s1.getSequenceAsString(), s2, s2.getSequenceAsString(),
+ seqInit(s1, s1.getSequenceAsString(), s2, s2.getSequenceAsString(),
type);
}
type);
}
@@
-161,7
+150,7
@@
public class AlignSeq
public AlignSeq(SequenceI s1, String string1, SequenceI s2,
String string2, String type)
{
public AlignSeq(SequenceI s1, String string1, SequenceI s2,
String string2, String type)
{
- SeqInit(s1, string1.toUpperCase(), s2, string2.toUpperCase(), type);
+ seqInit(s1, string1.toUpperCase(), s2, string2.toUpperCase(), type);
}
/**
}
/**
@@
-265,26
+254,6
@@
public class AlignSeq
}
/**
}
/**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public SequenceI getS1()
- {
- return s1;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public SequenceI getS2()
- {
- return s2;
- }
-
- /**
*
* @return aligned instance of Seq 1
*/
*
* @return aligned instance of Seq 1
*/
@@
-326,36
+295,13
@@
public class AlignSeq
* @param type
* DNA or PEPTIDE
*/
* @param type
* DNA or PEPTIDE
*/
- public void SeqInit(SequenceI s1, String string1, SequenceI s2,
+ public void seqInit(SequenceI s1, String string1, SequenceI s2,
String string2, String type)
{
this.s1 = s1;
this.s2 = s2;
setDefaultParams(type);
String string2, String type)
{
this.s1 = s1;
this.s2 = s2;
setDefaultParams(type);
- SeqInit(string1, string2);
- }
-
- /**
- * Construct score matrix for sequences with custom substitution matrix
- *
- * @param s1
- * - sequence 1
- * @param string1
- * - string to use for s1
- * @param s2
- * - sequence 2
- * @param string2
- * - string to use for s2
- * @param scoreMatrix
- * - substitution matrix to use for alignment
- */
- public void SeqInit(SequenceI s1, String string1, SequenceI s2,
- String string2, ScoreMatrix scoreMatrix)
- {
- this.s1 = s1;
- this.s2 = s2;
- setType(scoreMatrix.isDNA() ? AlignSeq.DNA : AlignSeq.PEP);
- lookup = scoreMatrix.getMatrix();
+ seqInit(string1, string2);
}
/**
}
/**
@@
-365,7
+311,7
@@
public class AlignSeq
* @param string1
* @param string2
*/
* @param string1
* @param string2
*/
- private void SeqInit(String string1, String string2)
+ private void seqInit(String string1, String string2)
{
s1str = extractGaps(jalview.util.Comparison.GapChars, string1);
s2str = extractGaps(jalview.util.Comparison.GapChars, string2);
{
s1str = extractGaps(jalview.util.Comparison.GapChars, string1);
s2str = extractGaps(jalview.util.Comparison.GapChars, string2);
@@
-440,13
+386,11
@@
public class AlignSeq
this.type = type2;
if (type.equals(AlignSeq.PEP))
{
this.type = type2;
if (type.equals(AlignSeq.PEP))
{
- intToStr = pep;
charToInt = ResidueProperties.aaIndex;
defInt = ResidueProperties.maxProteinIndex;
}
else if (type.equals(AlignSeq.DNA))
{
charToInt = ResidueProperties.aaIndex;
defInt = ResidueProperties.maxProteinIndex;
}
else if (type.equals(AlignSeq.DNA))
{
- intToStr = dna;
charToInt = ResidueProperties.nucleotideIndex;
defInt = ResidueProperties.maxNucleotideIndex;
}
charToInt = ResidueProperties.nucleotideIndex;
defInt = ResidueProperties.maxNucleotideIndex;
}
@@
-603,7
+547,7
@@
public class AlignSeq
.append(String.valueOf(s2str.length())).append(")")
.append(NEWLINE).append(NEWLINE);
.append(String.valueOf(s2str.length())).append(")")
.append(NEWLINE).append(NEWLINE);
- PairwiseSeqScoreModel pam250 = ScoreModels.getInstance().getPam250();
+ ScoreMatrix pam250 = ScoreModels.getInstance().getPam250();
for (int j = 0; j < nochunks; j++)
{
for (int j = 0; j < nochunks; j++)
{
@@
-686,46
+630,6
@@
public class AlignSeq
/**
* DOCUMENT ME!
*
/**
* DOCUMENT ME!
*
- * @param mat
- * DOCUMENT ME!
- */
- public void printScoreMatrix(int[][] mat)
- {
- int n = seq1.length;
- int m = seq2.length;
-
- for (int i = 0; i < n; i++)
- {
- // Print the top sequence
- if (i == 0)
- {
- Format.print(System.out, "%8s", s2str.substring(0, 1));
-
- for (int jj = 1; jj < m; jj++)
- {
- Format.print(System.out, "%5s", s2str.substring(jj, jj + 1));
- }
-
- System.out.println();
- }
-
- for (int j = 0; j < m; j++)
- {
- if (j == 0)
- {
- Format.print(System.out, "%3s", s1str.substring(i, i + 1));
- }
-
- Format.print(System.out, "%3d ", mat[i][j] / 10);
- }
-
- System.out.println();
- }
- }
-
- /**
- * DOCUMENT ME!
- *
* @param i
* DOCUMENT ME!
* @param j
* @param i
* DOCUMENT ME!
* @param j
@@
-860,7
+764,7
@@
public class AlignSeq
*
* @return DOCUMENT ME!
*/
*
* @return DOCUMENT ME!
*/
- public float max(float f1, float f2, float f3)
+ private static float max(float f1, float f2, float f3)
{
float max = f1;
{
float max = f1;
@@
-887,7
+791,7
@@
public class AlignSeq
*
* @return DOCUMENT ME!
*/
*
* @return DOCUMENT ME!
*/
- public float max(float f1, float f2)
+ private static float max(float f1, float f2)
{
float max = f1;
{
float max = f1;
@@
-909,7
+813,7
@@
public class AlignSeq
*
* @return DOCUMENT ME!
*/
*
* @return DOCUMENT ME!
*/
- public int[] stringToInt(String s, String type)
+ int[] stringToInt(String s, String type)
{
int[] seq1 = new int[s.length()];
{
int[] seq1 = new int[s.length()];