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
we already have c defined
[jalview.git]
/
src
/
jalview
/
analysis
/
AlignSeq.java
diff --git
a/src/jalview/analysis/AlignSeq.java
b/src/jalview/analysis/AlignSeq.java
index
464abb0
..
0af85f1
100755
(executable)
--- a/
src/jalview/analysis/AlignSeq.java
+++ b/
src/jalview/analysis/AlignSeq.java
@@
-1,6
+1,6
@@
/*
\r
* Jalview - A Sequence Alignment Editor and Viewer
\r
/*
\r
* Jalview - A Sequence Alignment Editor and Viewer
\r
-* Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
+* Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
*
\r
* This program is free software; you can redistribute it and/or
\r
* modify it under the terms of the GNU General Public License
\r
*
\r
* This program is free software; you can redistribute it and/or
\r
* modify it under the terms of the GNU General Public License
\r
@@
-63,14
+63,14
@@
public class AlignSeq
int[] seq2;
\r
SequenceI s1;
\r
SequenceI s2;
\r
int[] seq2;
\r
SequenceI s1;
\r
SequenceI s2;
\r
- String s1str;
\r
- String s2str;
\r
+ public String s1str;
\r
+ public String s2str;
\r
int maxi;
\r
int maxj;
\r
int[] aseq1;
\r
int[] aseq2;
\r
int maxi;
\r
int maxj;
\r
int[] aseq1;
\r
int[] aseq2;
\r
- public String astr1 = "";
\r
- public String astr2 = "";
\r
+ public String astr1="";
\r
+ public String astr2="";
\r
\r
/** DOCUMENT ME!! */
\r
public int seq1start;
\r
\r
/** DOCUMENT ME!! */
\r
public int seq1start;
\r
@@
-96,7
+96,6
@@
public class AlignSeq
int defInt = 23;
\r
StringBuffer output = new StringBuffer();
\r
String type;
\r
int defInt = 23;
\r
StringBuffer output = new StringBuffer();
\r
String type;
\r
- Runtime rt;
\r
\r
/**
\r
* Creates a new AlignSeq object.
\r
\r
/**
\r
* Creates a new AlignSeq object.
\r
@@
-107,7
+106,6
@@
public class AlignSeq
*/
\r
public AlignSeq(SequenceI s1, SequenceI s2, String type)
\r
{
\r
*/
\r
public AlignSeq(SequenceI s1, SequenceI s2, String type)
\r
{
\r
- rt = Runtime.getRuntime();
\r
SeqInit(s1, s1.getSequence(), s2, s2.getSequence(), type);
\r
}
\r
\r
SeqInit(s1, s1.getSequence(), s2, s2.getSequence(), type);
\r
}
\r
\r
@@
-124,7
+122,6
@@
public class AlignSeq
String string2,
\r
String type)
\r
{
\r
String string2,
\r
String type)
\r
{
\r
- rt = Runtime.getRuntime();
\r
SeqInit(s1, string1, s2, string2, type);
\r
}
\r
\r
SeqInit(s1, string1, s2, string2, type);
\r
}
\r
\r
@@
-261,9
+258,18
@@
public class AlignSeq
String string2,
\r
String type)
\r
{
\r
String string2,
\r
String type)
\r
{
\r
+
\r
s1str = extractGaps(jalview.util.Comparison.GapChars, string1);
\r
s2str = extractGaps(jalview.util.Comparison.GapChars, string2);
\r
\r
s1str = extractGaps(jalview.util.Comparison.GapChars, string1);
\r
s2str = extractGaps(jalview.util.Comparison.GapChars, string2);
\r
\r
+ if(s1str.length()==0 || s2str.length()==0)
\r
+ {
\r
+ System.out.println("ALL GAPS: " +
\r
+ (s1str.length()==0?s1.getName():" ")
\r
+ +(s2str.length()==0?s2.getName():""));
\r
+ return;
\r
+ }
\r
+
\r
this.s1 = s1;
\r
this.s2 = s2;
\r
\r
this.s1 = s1;
\r
this.s2 = s2;
\r
\r
@@
-745,17
+751,24
@@
public class AlignSeq
\r
for (int i = 0; i < s.length(); i++)
\r
{
\r
\r
for (int i = 0; i < s.length(); i++)
\r
{
\r
- String ss = s.substring(i, i + 1).toUpperCase();
\r
+ // String ss = s.substring(i, i + 1).toUpperCase();
\r
+ char c = s.charAt(i);
\r
+ if ('a' <= c && c <= 'z')
\r
+ {
\r
+ // TO UPPERCASE !!!
\r
+ c -= ('a' - 'A');
\r
+ }
\r
+
\r
\r
try
\r
{
\r
if (type.equals("pep"))
\r
{
\r
\r
try
\r
{
\r
if (type.equals("pep"))
\r
{
\r
- seq1[i] = ((Integer) ResidueProperties.aaHash.get(ss)).intValue();
\r
+ seq1[i] = ResidueProperties.aaIndex[c];
\r
}
\r
else if (type.equals("dna"))
\r
{
\r
}
\r
else if (type.equals("dna"))
\r
{
\r
- seq1[i] = ((Integer) dnaHash.get(ss)).intValue();
\r
+ seq1[i] = ResidueProperties.nucleotideIndex[c];
\r
}
\r
\r
if (seq1[i] > 23)
\r
}
\r
\r
if (seq1[i] > 23)
\r