*/
package jalview.analysis;
-import java.awt.Color;
-import java.awt.Graphics;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.StringTokenizer;
-
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.Mapping;
import jalview.util.MapList;
import jalview.util.MessageManager;
+import java.awt.Color;
+import java.awt.Graphics;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.StringTokenizer;
+
/**
*
*
*/
private void SeqInit(String string1, String string2)
{
- s1str = extractGaps(jalview.util.Comparison.GapChars, string1);
- s2str = extractGaps(jalview.util.Comparison.GapChars, string2);
+ s1str = extractGaps(Comparison.GapChars, string1);
+ s2str = extractGaps(Comparison.GapChars, string2);
if (s1str.length() == 0 || s2str.length() == 0)
{
if ((i + (j * len)) < astr1.length())
{
if (astr1.charAt(i + (j * len)) == astr2.charAt(i + (j * len))
- && !jalview.util.Comparison.isGap(astr1.charAt(i
+ && !Comparison.isGap(astr1.charAt(i
+ (j * len))))
{
pid++;
*
* @return mapping from positions in S1 to corresponding positions in S2
*/
- public jalview.datamodel.Mapping getMappingFromS1(boolean allowmismatch)
+ public Mapping getMappingFromS1(boolean allowmismatch)
{
ArrayList<Integer> as1 = new ArrayList<Integer>(), as2 = new ArrayList<Integer>();
int pdbpos = s2.getStart() + getSeq2Start() - 2;
}
MapList map = new MapList(mapseq1, mapseq2, 1, 1);
- jalview.datamodel.Mapping mapping = new Mapping(map);
+ Mapping mapping = new Mapping(map);
mapping.setTo(s2);
return mapping;
}
.floatValue();
}
- jalview.util.QuickSort.sortFloat(ids, alignment);
+ QuickSort.sortFloat(ids, alignment);
}
/**
}
}
- jalview.util.QuickSort.sortDouble(scores, seqs);
+ QuickSort.sortDouble(scores, seqs);
if (lastSortByScore != scoreLabel)
{
lastSortByScore = scoreLabel;
labs[l] = (fs[l].getDescription() != null ? fs[l]
.getDescription() : fs[l].getType());
}
- jalview.util.QuickSort.sort(labs, ((Object[]) feats[i]));
+ QuickSort.sort(labs, ((Object[]) feats[i]));
}
}
if (hasScore[i])
}
}
- jalview.util.QuickSort.sortDouble(scores, seqs);
+ QuickSort.sortDouble(scores, seqs);
}
else if (method == FEATURE_DENSITY)
{
// System.err.println("Sorting on Density: seq "+seqs[i].getName()+
// " Feats: "+nf+" Score : "+scores[i]);
}
- jalview.util.QuickSort.sortDouble(scores, seqs);
+ QuickSort.sortDouble(scores, seqs);
}
else
{
*/
package jalview.analysis;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.TreeMap;
-
import jalview.datamodel.AlignedCodon;
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.Alignment;
import jalview.util.MapList;
import jalview.util.MappingUtils;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.TreeMap;
+
/**
* grab bag of useful alignment manipulation operations Expect these to be
* refactored elsewhere at some point.
s.setStart(s.getStart() - ustream_ds);
s.setEnd(s_end + downstream.length);
}
- AlignmentI newAl = new jalview.datamodel.Alignment(
- sq.toArray(new SequenceI[0]));
+ AlignmentI newAl = new Alignment(sq.toArray(new SequenceI[0]));
for (SequenceI s : sq)
{
if (s.getAnnotation() != null)
* name. For use in mapping between different alignment views of the same
* sequences.
*
- * @see jalview.datamodel.AlignmentI#getSequencesByName()
+ * @see AlignmentI#getSequencesByName()
*/
public static Map<String, List<SequenceI>> getSequencesByName(
AlignmentI al)
*/
package jalview.analysis;
-import java.awt.Color;
-import java.util.*;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.Annotation;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceI;
+import jalview.schemes.ResidueProperties;
+import jalview.util.Comparison;
-import jalview.datamodel.*;
+import java.awt.Color;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Vector;
/**
* Calculates conservation values for a given set of sequences
{
for (s = 0; s < sSize; s++)
{
- sarray[s] = (SequenceI) sequences.get(s);
+ sarray[s] = sequences.get(s);
if (sarray[s].getLength() > maxLength)
{
maxLength = sarray[s].getLength();
for (j = 1; j <= len; j++)
{
- sqnum[j] = jalview.schemes.ResidueProperties.aaIndex[sq
+ sqnum[j] = ResidueProperties.aaIndex[sq
.charAt(j - 1)];
}
if (canonicaliseAa)
{ // lookup the base aa code symbol
- c = (char) jalview.schemes.ResidueProperties.aaIndex[sequences[j]
+ c = (char) ResidueProperties.aaIndex[sequences[j]
.getCharAt(i)];
if (c > 20)
{
else
{
// recover canonical aa symbol
- c = jalview.schemes.ResidueProperties.aa[c].charAt(0);
+ c = ResidueProperties.aa[c].charAt(0);
}
}
else
resultHash.put(type, ht.get("-"));
}
}
- else if (((Integer) resultHash.get(type)).equals((Integer) ht
+ else if (((Integer) resultHash.get(type)).equals(ht
.get(res)) == false)
{
resultHash.put(type, new Integer(-1));
c = sequences[i].getCharAt(j); // gaps do not have upper/lower case
- if (jalview.util.Comparison.isGap((c)))
+ if (Comparison.isGap((c)))
{
count++;
}
{
gapcons = countConsNGaps(i);
totGaps = gapcons[1];
- pgaps = ((float) totGaps * 100) / (float) sequences.length;
+ pgaps = ((float) totGaps * 100) / sequences.length;
consSymbs[i-start]=new String();
if (percentageGaps > pgaps)
quality = new Vector();
double max = -10000;
- int[][] BLOSUM62 = jalview.schemes.ResidueProperties.getBLOSUM62();
+ int[][] BLOSUM62 = ResidueProperties.getBLOSUM62();
// Loop over columns // JBPNote Profiling info
// long ts = System.currentTimeMillis();
if (Character.isDigit(c))
{
- value = (int) (c - '0');
+ value = c - '0';
}
else if (c == '*')
{
*/
package jalview.analysis;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Vector;
-
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.DBRefSource;
+import jalview.datamodel.Mapping;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
+import jalview.util.Comparison;
import jalview.util.DBRefUtils;
import jalview.ws.SequenceFetcher;
import jalview.ws.seqfetcher.ASequenceFetcher;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Vector;
+
/**
* Functions for cross-referencing sequence databases. user must first specify
* if cross-referencing from protein or dna (set dna==true)
for (int rs = 0; rs < retrieved.length; rs++)
{
// TODO: examine each sequence for 'redundancy'
- jalview.datamodel.DBRefEntry[] dbr = retrieved[rs]
+ DBRefEntry[] dbr = retrieved[rs]
.getDBRef();
if (dbr != null && dbr.length > 0)
{
{
// find any entry where we should put in the sequence being
// cross-referenced into the map
- jalview.datamodel.Mapping map = dbr[di].getMap();
+ Mapping map = dbr[di].getMap();
if (map != null)
{
if (map.getTo() != null && map.getMap() != null)
// check if this is the correct sequence type
{
typer[0] = nxt;
- boolean isDna = jalview.util.Comparison.isNucleotide(typer);
+ boolean isDna = Comparison.isNucleotide(typer);
if ((direct && isDna == dna) || (!direct && isDna != dna))
{
// skip this sequence because it is same molecule type
DBRefEntry[] poss = nxt.getDBRef(), cands = null;
if (direct)
{
- cands = jalview.util.DBRefUtils.searchRefs(poss, xrf);
+ cands = DBRefUtils.searchRefs(poss, xrf);
}
else
{
poss = CrossRef.findXDbRefs(dna, poss); //
- cands = jalview.util.DBRefUtils.searchRefs(poss, xrf);
+ cands = DBRefUtils.searchRefs(poss, xrf);
}
if (cands != null)
{
*/
package jalview.analysis;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Map;
-
import jalview.api.AlignViewportI;
import jalview.datamodel.AlignedCodon;
import jalview.datamodel.AlignedCodonFrame;
import jalview.util.MapList;
import jalview.util.ShiftList;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+
public class Dna
{
private static final String STOP_X = "X";
for (int gd = 0; gd < selection.length; gd++)
{
SequenceI dna = selection[gd];
- DBRefEntry[] dnarefs = DBRefUtils
- .selectRefs(dna.getDBRef(),
- jalview.datamodel.DBRefSource.DNACODINGDBS);
+ DBRefEntry[] dnarefs = DBRefUtils.selectRefs(dna.getDBRef(),
+ DBRefSource.DNACODINGDBS);
if (dnarefs != null)
{
// intersect with pep
import jalview.datamodel.SearchResults;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceGroup;
+import jalview.util.Comparison;
import java.util.Vector;
+import com.stevesoft.pat.Regex;
+
public class Finder
{
/**
AlignmentI alignment;
- jalview.datamodel.SequenceGroup selection = null;
+ SequenceGroup selection = null;
Vector idMatch = null;
boolean findAll = false;
- com.stevesoft.pat.Regex regex = null;
+ Regex regex = null;
/**
* hold's last-searched position between calles to find(false)
{
searchString = searchString.toUpperCase();
}
- regex = new com.stevesoft.pat.Regex(searchString);
+ regex = new Regex(searchString);
regex.setIgnoreCase(!caseSensitive);
searchResults = new SearchResults();
idMatch = new Vector();
for (int j = 0; j < item.length(); j++)
{
- if (!jalview.util.Comparison.isGap(item.charAt(j)))
+ if (!Comparison.isGap(item.charAt(j)))
{
noGapsSB.append(item.charAt(j));
spaces.addElement(new Integer(insertCount));
/**
* @return the selection
*/
- public jalview.datamodel.SequenceGroup getSelection()
+ public SequenceGroup getSelection()
{
return selection;
}
* @param selection
* the selection to set
*/
- public void setSelection(jalview.datamodel.SequenceGroup selection)
+ public void setSelection(SequenceGroup selection)
{
this.selection = selection;
}
/**
* @return the regex
*/
- public com.stevesoft.pat.Regex getRegex()
+ public Regex getRegex()
{
return regex;
}
import jalview.datamodel.SequenceNode;
import jalview.io.NewickFile;
import jalview.schemes.ResidueProperties;
+import jalview.util.Format;
import java.util.Enumeration;
import java.util.List;
}
/*
* sequenceString = new String[odata.length]; char gapChar =
- * jalview.util.Comparison.GapChars.charAt(0); for (int i = 0; i <
+ * Comparison.GapChars.charAt(0); for (int i = 0; i <
* odata.length; i++) { SequenceI oseq_aligned = odata[i].getSeq(gapChar);
* sequenceString[i] = oseq_aligned.getSequence(); }
*/
if (one2many.contains(nam))
{
countOne2Many++;
- // if (jalview.bin.Cache.log.isDebugEnabled())
- // jalview.bin.Cache.log.debug("One 2 many relationship for
+ // if (Cache.log.isDebugEnabled())
+ // Cache.log.debug("One 2 many relationship for
// "+nam.getName());
}
else
j.setPlaceholder(true);
}
}
- // if (jalview.bin.Cache.log.isDebugEnabled() && countOne2Many>0) {
- // jalview.bin.Cache.log.debug("There were "+countOne2Many+" alignment
+ // if (Cache.log.isDebugEnabled() && countOne2Many>0) {
+ // Cache.log.debug("There were "+countOne2Many+" alignment
// sequence ids (out of "+one2many.size()+" unique ids) linked to two or
// more leaves.");
// }
*/
public String toString()
{
- jalview.io.NewickFile fout = new jalview.io.NewickFile(getTopNode());
+ NewickFile fout = new NewickFile(getTopNode());
return fout.print(isHasBootstrap(), isHasDistances(),
isHasRootDistance()); // output all data available for tree
String[] seqdatas = seqData.getSequenceStrings(gapChar);
for (int i = 0; i < seqdatas.length; i++)
{
- sb.append(new jalview.util.Format("%-" + 15 + "s").form(sequence[i]
- .getName()));
+ sb.append(new Format("%-" + 15 + "s").form(sequence[i].getName()));
sb.append(" " + seqdatas[i] + "\n");
}
return sb.toString();
*/
package jalview.analysis;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
-
import jalview.datamodel.PDBEntry;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
+import jalview.util.Comparison;
+
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Vector;
public class SeqsetUtils
{
sqinfo.put("Description", seq.getDescription());
}
Vector sfeat = new Vector();
- jalview.datamodel.SequenceFeature[] sfarray = seq.getSequenceFeatures();
+ SequenceFeature[] sfarray = seq.getSequenceFeatures();
if (sfarray != null && sfarray.length > 0)
{
for (int i = 0; i < sfarray.length; i++)
public static boolean deuniquify(Hashtable map, SequenceI[] sequences,
boolean quiet)
{
- jalview.analysis.SequenceIdMatcher matcher = new SequenceIdMatcher(
- sequences);
+ SequenceIdMatcher matcher = new SequenceIdMatcher(sequences);
SequenceI msq = null;
Enumeration keys = map.keys();
Vector unmatched = new Vector();
int msflen = 0;
for (int i = 0, j = sequences.length; i < j; i++)
{
- String tempseq = jalview.analysis.AlignSeq.extractGaps(
- jalview.util.Comparison.GapChars,
+ String tempseq = AlignSeq.extractGaps(Comparison.GapChars,
sequences[i].getSequenceAsString());
if (tempseq.length() == 0)
* @return SequenceI
*/
private SequenceI findIdMatch(
- jalview.analysis.SequenceIdMatcher.SeqIdName nam)
+SequenceIdMatcher.SeqIdName nam)
{
Vector matches = new Vector();
while (names.containsKey(nam))
* SeqIdName
* @return SequenceI[]
*/
- private List<SequenceI> findAllIdMatches(
- jalview.analysis.SequenceIdMatcher.SeqIdName nam)
+ private List<SequenceI> findAllIdMatches(SequenceIdMatcher.SeqIdName nam)
{
ArrayList<SequenceI> matches = new ArrayList<SequenceI>();
while (names.containsKey(nam))
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
import jalview.util.Format;
+import jalview.util.QuickSort;
import java.util.ArrayList;
import java.util.Hashtable;
x++;
}
}
- jalview.util.QuickSort.sortFloat(vl, ca);
+ QuickSort.sortFloat(vl, ca);
int p = 0;
/*
x++;
}
}
- jalview.util.QuickSort.sortFloat(vl, ca);
+ QuickSort.sortFloat(vl, ca);
int valuesCount = 0;
rtnval[1] = 0;
package jalview.analysis.scoremodels;
+import jalview.api.AlignmentViewPanel;
+import jalview.api.FeatureRenderer;
import jalview.api.analysis.ScoreModelI;
import jalview.api.analysis.ViewBasedAnalysisI;
import jalview.datamodel.AlignmentView;
public class FeatureScoreModel implements ScoreModelI, ViewBasedAnalysisI
{
- jalview.api.FeatureRenderer fr;
+ FeatureRenderer fr;
@Override
- public boolean configureFromAlignmentView(
- jalview.api.AlignmentViewPanel view)
+ public boolean configureFromAlignmentView(AlignmentViewPanel view)
{
fr = view.cloneFeatureRenderer();
return true;