*/
package jalview.datamodel;
-import java.util.ArrayList;
-import java.util.List;
-
import jalview.util.MapList;
import jalview.util.MappingUtils;
+import java.util.ArrayList;
+import java.util.List;
+
/**
* Stores mapping between the columns of a protein alignment and a DNA alignment
* and a list of individual codon to amino acid mappings between sequences.
*/
package jalview.datamodel;
+import jalview.analysis.AlignmentUtils;
+import jalview.io.FastaFile;
+import jalview.util.Comparison;
+import jalview.util.MessageManager;
+
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Set;
import java.util.Vector;
-import jalview.analysis.AlignmentUtils;
-import jalview.io.FastaFile;
-import jalview.util.MessageManager;
-
/**
* Data structure to hold and manipulate a multiple sequence alignment
*/
{
int i = 0;
- if (jalview.util.Comparison.isNucleotide(seqs))
+ if (Comparison.isNucleotide(seqs))
{
type = NUCLEOTIDE;
}
/*
* (non-Javadoc)
*
- * @see jalview.datamodel.AlignmentI#findGroup(jalview.datamodel.SequenceI)
+ * @see AlignmentI#findGroup(jalview.datamodel.SequenceI)
*/
@Override
public SequenceGroup findGroup(SequenceI s)
* (non-Javadoc)
*
* @see
- * jalview.datamodel.AlignmentI#findAllGroups(jalview.datamodel.SequenceI)
+ * AlignmentI#findAllGroups(jalview.datamodel.SequenceI)
*/
@Override
public SequenceGroup[] findAllGroups(SequenceI s)
/*
* (non-Javadoc)
*
- * @see jalview.datamodel.AlignmentI#findName(java.lang.String, boolean)
+ * @see AlignmentI#findName(java.lang.String, boolean)
*/
@Override
public SequenceI findName(String token, boolean b)
/*
* (non-Javadoc)
*
- * @see jalview.datamodel.AlignmentI#findName(SequenceI, java.lang.String,
+ * @see AlignmentI#findName(SequenceI, java.lang.String,
* boolean)
*/
@Override
/*
* (non-Javadoc)
*
- * @see jalview.datamodel.AlignmentI#findIndex(jalview.datamodel.SequenceI)
+ * @see AlignmentI#findIndex(jalview.datamodel.SequenceI)
*/
@Override
public int findIndex(SequenceI s)
* (non-Javadoc)
*
* @see
- * jalview.datamodel.AlignmentI#findIndex(jalview.datamodel.SearchResults)
+ * AlignmentI#findIndex(jalview.datamodel.SearchResults)
*/
@Override
public int findIndex(SearchResults results)
/*
* (non-Javadoc)
*
- * @see jalview.datamodel.AlignmentI#isAligned()
+ * @see AlignmentI#isAligned()
*/
@Override
public boolean isAligned()
/*
* (non-Javadoc)
*
- * @see jalview.datamodel.AlignmentI#isAligned(boolean)
+ * @see AlignmentI#isAligned(boolean)
*/
@Override
public boolean isAligned(boolean includeHidden)
/*
* (non-Javadoc)
*
- * @seejalview.datamodel.AlignmentI#deleteAnnotation(jalview.datamodel.
+ * @seeAlignmentI#deleteAnnotation(jalview.datamodel.
* AlignmentAnnotation)
*/
@Override
/*
* (non-Javadoc)
*
- * @seejalview.datamodel.AlignmentI#addAnnotation(jalview.datamodel.
+ * @seeAlignmentI#addAnnotation(jalview.datamodel.
* AlignmentAnnotation)
*/
@Override
/*
* (non-Javadoc)
*
- * @seejalview.datamodel.AlignmentI#addAnnotation(jalview.datamodel.
+ * @seeAlignmentI#addAnnotation(jalview.datamodel.
* AlignmentAnnotation, int)
*/
@Override
for (int j = current.getLength(); j > maxLength; j--)
{
if (j > maxLength
- && !jalview.util.Comparison.isGap(current.getCharAt(j)))
+ && !Comparison.isGap(current.getCharAt(j)))
{
maxLength = j;
break;
boolean hitres = false;
for (int j = 0, rs = 0, ssiz = current.getLength(); j < ssiz; j++)
{
- if (!jalview.util.Comparison.isGap(current.getCharAt(j)))
+ if (!Comparison.isGap(current.getCharAt(j)))
{
if (!hitres)
{
* (non-Javadoc)
*
* @see
- * jalview.datamodel.AlignmentI#addCodonFrame(jalview.datamodel.AlignedCodonFrame
+ * AlignmentI#addCodonFrame(jalview.datamodel.AlignedCodonFrame
* )
*/
@Override
* (non-Javadoc)
*
* @see
- * jalview.datamodel.AlignmentI#getCodonFrame(jalview.datamodel.SequenceI)
+ * AlignmentI#getCodonFrame(jalview.datamodel.SequenceI)
*/
@Override
public List<AlignedCodonFrame> getCodonFrame(SequenceI seq)
/**
* Sets the codon frame mappings (replacing any existing mappings).
*
- * @see jalview.datamodel.AlignmentI#setCodonFrames()
+ * @see AlignmentI#setCodonFrames()
*/
@Override
public void setCodonFrames(Set<AlignedCodonFrame> acfs)
* Returns the set of codon frame mappings. Any changes to the returned set
* will affect the alignment.
*
- * @see jalview.datamodel.AlignmentI#getCodonFrames()
+ * @see AlignmentI#getCodonFrames()
*/
@Override
public Set<AlignedCodonFrame> getCodonFrames()
/*
* (non-Javadoc)
*
- * @seejalview.datamodel.AlignmentI#removeCodonFrame(jalview.datamodel.
+ * @seeAlignmentI#removeCodonFrame(jalview.datamodel.
* AlignedCodonFrame)
*/
@Override
*/
package jalview.datamodel;
+import jalview.analysis.Rna;
+import jalview.analysis.SecStrConsensus.SimpleBP;
+import jalview.analysis.WUSSParseException;
+import jalview.schemes.ResidueProperties;
+
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;
import java.util.Map.Entry;
-import jalview.analysis.Rna;
-import jalview.analysis.SecStrConsensus.SimpleBP;
-import jalview.analysis.WUSSParseException;
-
/**
* DOCUMENT ME!
*
&& firstChar != 'Y'
&& firstChar != 'Z'
&& firstChar != '-'
- && firstChar < jalview.schemes.ResidueProperties.aaIndex.length)
+ && firstChar < ResidueProperties.aaIndex.length)
{
- if (jalview.schemes.ResidueProperties.aaIndex[firstChar] < 23) // TODO:
+ if (ResidueProperties.aaIndex[firstChar] < 23) // TODO:
// parameterise
// to
// gap
boolean recordGroups)
{
// refactored from AlignViewport.getAlignmentView(selectedOnly);
- this(new jalview.datamodel.CigarArray(alignment,
+ this(new CigarArray(alignment,
(hasHiddenColumns ? columnSelection : null),
(selectedRegionOnly ? selection : null)),
(selectedRegionOnly && selection != null) ? selection
*/
package jalview.datamodel;
+import jalview.util.MapList;
+
import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.Vector;
-import jalview.util.MapList;
-
public class Mapping
{
/**
*/
package jalview.datamodel;
-import java.util.Enumeration;
-import java.util.Hashtable;
-
import jalview.analysis.AlignSeq;
import jalview.analysis.SeqsetUtils;
+import jalview.util.Comparison;
import jalview.util.MessageManager;
import jalview.util.ShiftList;
+import java.util.Enumeration;
+import java.util.Hashtable;
+
public class SeqCigar extends CigarSimple
{
/**
{
// make a new dataset sequence
String ungapped = AlignSeq.extractGaps(
- jalview.util.Comparison.GapChars, new String(seq_string));
+ Comparison.GapChars, new String(seq_string));
l_ungapped = ungapped.length();
// check that we haven't just duplicated an ungapped sequence.
if (l_ungapped == seq.getLength())
while (p <= endpos)
{
- boolean isGap = (p < res) ? jalview.util.Comparison.isGap(seq
+ boolean isGap = (p < res) ? Comparison.isGap(seq
.getCharAt(p)) : true;
if ((startpos <= p) && (p <= endpos))
{
package jalview.datamodel;
import jalview.analysis.AlignSeq;
+import jalview.schemes.ResidueProperties;
+import jalview.util.Comparison;
import jalview.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;
+import com.stevesoft.pat.Regex;
+
import fr.orsay.lri.varna.models.rna.RNA;
/**
checkValidRange();
}
- com.stevesoft.pat.Regex limitrx = new com.stevesoft.pat.Regex(
- "[/][0-9]{1,}[-][0-9]{1,}$");
+ Regex limitrx = new Regex("[/][0-9]{1,}[-][0-9]{1,}$");
- com.stevesoft.pat.Regex endrx = new com.stevesoft.pat.Regex("[0-9]{1,}$");
+ Regex endrx = new Regex("[0-9]{1,}$");
void parseId()
{
int endRes = 0;
for (int j = 0; j < sequence.length; j++)
{
- if (!jalview.util.Comparison.isGap(sequence[j]))
+ if (!Comparison.isGap(sequence[j]))
{
endRes++;
}
// Rely on end being at least as long as the length of the sequence.
while ((i < sequence.length) && (j <= end) && (j <= pos))
{
- if (!jalview.util.Comparison.isGap(sequence[i]))
+ if (!Comparison.isGap(sequence[i]))
{
j++;
}
int seqlen = sequence.length;
while ((j < i) && (j < seqlen))
{
- if (!jalview.util.Comparison.isGap(sequence[j]))
+ if (!Comparison.isGap(sequence[j]))
{
pos++;
}
*/
public int[] gapMap()
{
- String seq = jalview.analysis.AlignSeq.extractGaps(
- jalview.util.Comparison.GapChars, new String(sequence));
+ String seq = AlignSeq.extractGaps(
+ Comparison.GapChars, new String(sequence));
int[] map = new int[seq.length()];
int j = 0;
int p = 0;
while (j < sequence.length)
{
- if (!jalview.util.Comparison.isGap(sequence[j]))
+ if (!Comparison.isGap(sequence[j]))
{
map[p++] = j;
}
while ((j < seqlen))
{
map[j] = pos;
- if (!jalview.util.Comparison.isGap(sequence[j]))
+ if (!Comparison.isGap(sequence[j]))
{
pos++;
}
int seqlen = sequence.length;
while ((j < seqlen))
{
- if (jalview.util.Comparison.isGap(sequence[j]))
+ if (Comparison.isGap(sequence[j]))
{
if (lastj == -1)
{
boolean ecalc = false, scalc = false;
for (int s = i; s < j; s++)
{
- if (jalview.schemes.ResidueProperties.aaIndex[sequence[s]] != 23)
+ if (ResidueProperties.aaIndex[sequence[s]] != 23)
{
if (createNewDs)
{
}
for (int i = 0; i < sequence.length; i++)
{
- if (jalview.util.Comparison.isGap(sequence[i]))
+ if (Comparison.isGap(sequence[i]))
{
return false;
}
// Create a new, valid dataset sequence
SequenceI ds = seq;
ds.setSequence(AlignSeq.extractGaps(
- jalview.util.Comparison.GapChars, new String(sequence)));
+ Comparison.GapChars, new String(sequence)));
setDatasetSequence(ds);
ds.setSequenceFeatures(getSequenceFeatures());
seq = this; // and return this sequence as the derived sequence.
if (datasetSequence == null)
{
datasetSequence = new Sequence(getName(), AlignSeq.extractGaps(
- jalview.util.Comparison.GapChars, getSequenceAsString()),
+ Comparison.GapChars, getSequenceAsString()),
getStart(), getEnd());
datasetSequence.setSequenceFeatures(getSequenceFeatures());
datasetSequence.setDescription(getDescription());
*/
package jalview.datamodel;
+import jalview.analysis.AAFrequency;
+import jalview.analysis.Conservation;
+import jalview.schemes.ColourSchemeI;
+import jalview.schemes.ResidueProperties;
+import jalview.util.Comparison;
+
import java.awt.Color;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.Map;
import java.util.Vector;
-import jalview.analysis.AAFrequency;
-import jalview.analysis.Conservation;
-import jalview.schemes.ColourSchemeI;
-import jalview.schemes.ResidueProperties;
-
/**
* Collects a set contiguous ranges on a set of sequences
*
for (int j = 0; j < endRes + 1 && j < seq.getLength(); j++)
{
ch = seq.getCharAt(j);
- if (!jalview.util.Comparison.isGap((ch)))
+ if (!Comparison.isGap((ch)))
{
eres++;
}
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
+import jalview.util.DBRefUtils;
+import jalview.util.MapList;
import java.util.Hashtable;
import java.util.Map.Entry;
* don't return any translated protein sequences marked in features
* @return dataset sequences with DBRefs and features - DNA always comes first
*/
- public jalview.datamodel.SequenceI[] getSequences(boolean noNa,
+ public SequenceI[] getSequences(boolean noNa,
boolean noPeptide, String sourceDb)
{ // TODO: ensure emblEntry.getSequences behaves correctly for returning all
// cases of noNa and noPeptide
{
boolean isEmblCdna = sourceDb.equals(DBRefSource.EMBLCDS);
// extract coding region(s)
- jalview.datamodel.Mapping map = null;
+ Mapping map = null;
int[] exon = null;
if (feature.locations != null)
{
// marked.
exon = new int[]
{ dna.getStart() + (prstart - 1), dna.getEnd() };
- map = new jalview.datamodel.Mapping(product, exon, new int[]
+ map = new Mapping(product, exon, new int[]
{ 1, prseq.length() }, 3, 1);
}
if ((prseq.length() + 1) * 3 == (1 - prstart + dna.getSequence().length))
.println("Allowing for additional stop codon at end of cDNA fragment... will probably cause an error in VAMSAs!");
exon = new int[]
{ dna.getStart() + (prstart - 1), dna.getEnd() - 3 };
- map = new jalview.datamodel.Mapping(product, exon, new int[]
+ map = new Mapping(product, exon, new int[]
{ 1, prseq.length() }, 3, 1);
}
}
{
// final product length trunctation check
- map = new jalview.datamodel.Mapping(product,
+ map = new Mapping(product,
adjustForProteinLength(prseq.length(), exon), new int[]
{ 1, prseq.length() }, 3, 1);
// reconstruct the EMBLCDS entry
pcdnaref.setAccessionId(prid);
pcdnaref.setSource(DBRefSource.EMBLCDS);
pcdnaref.setVersion(getVersion()); // same as parent EMBL version.
- jalview.util.MapList mp = new jalview.util.MapList(new int[]
+ MapList mp = new MapList(new int[]
{ 1, prseq.length() }, new int[]
{ 1 + (prstart - 1), (prstart - 1) + 3 * prseq.length() }, 1, 3);
// { 1 + (prstart - 1) * 3,
{
for (DBRefEntry ref : feature.dbRefs)
{
- ref.setSource(jalview.util.DBRefUtils.getCanonicalName(ref
+ ref.setSource(DBRefUtils.getCanonicalName(ref
.getSource()));
// Hard code the kind of protein product accessions that EMBL cite
- if (ref.getSource().equals(jalview.datamodel.DBRefSource.UNIPROT))
+ if (ref.getSource().equals(DBRefSource.UNIPROT))
{
ref.setMap(map);
if (map != null && map.getTo() != null)
if (map.getTo().getName().indexOf(prid) == 0)
{
map.getTo().setName(
- jalview.datamodel.DBRefSource.UNIPROT + "|"
+ DBRefSource.UNIPROT + "|"
+ ref.getAccessionId());
}
}
*/
package jalview.datamodel.xdb.embl;
+import jalview.bin.Cache;
+
import java.util.Vector;
/**
}
else if (locationType != null)
{
- if (jalview.bin.Cache.log != null)
+ if (Cache.log != null)
{
- jalview.bin.Cache.log
+ Cache.log
.error("EmbleFeatureLocations.getElementRanges cannot deal with locationType=='"
+ locationType + "'");
}
*/
package jalview.datamodel.xdb.embl;
+import jalview.bin.Cache;
+
import java.io.File;
import java.io.FileReader;
import java.io.PrintWriter;
try
{
// uncomment to DEBUG EMBLFile reading
- if (jalview.bin.Cache.getDefault(
- jalview.bin.Cache.CASTORLOGLEVEL, "debug")
+ if (Cache.getDefault(
+ Cache.CASTORLOGLEVEL, "debug")
.equalsIgnoreCase("DEBUG"))
{
- unmar.setDebug(jalview.bin.Cache.log.isDebugEnabled());
+ unmar.setDebug(Cache.log.isDebugEnabled());
}
} catch (Exception e)
{