import jalview.analysis.*;
/**
- * DOCUMENT ME!
+ *
+ * Implements the SequenceI interface for a char[] based sequence object.
*
* @author $author$
* @version $Revision$
* positions are tied to the residues of this sequence */
Vector annotation;
- /** DOCUMENT ME!! */
+ /** array of seuqence features - may not be null for a valid sequence object */
public SequenceFeature[] sequenceFeatures;
/**
* Creates a new Sequence object.
*
- * @param name DOCUMENT ME!
- * @param sequence DOCUMENT ME!
- * @param start DOCUMENT ME!
- * @param end DOCUMENT ME!
+ * @param name display name string
+ * @param sequence string to form a possibly gapped sequence out of
+ * @param start first position of non-gap residue in the sequence
+ * @param end last position of ungapped residues (nearly always only used for display purposes)
*/
public Sequence(String name, String sequence, int start, int end)
{
void parseId()
{
+ if (name==null)
+ {
+ System.err.println("POSSIBLE IMPLEMENTATION ERROR: null sequence name passed to constructor.");
+ name = "";
+ }
// Does sequence have the /start-end signiature?
if (limitrx.search(name))
{
for(i=0; i<iSize; i++)
{
- if(dbrefs[i].equals(entry))
+ if(dbrefs[i].equalRef(entry))
{
+ if (entry.getMap()!=null)
+ {
+ if (dbrefs[i].getMap()==null)
+ {
+ // overwrite with 'superior' entry that contains a mapping.
+ dbrefs[i] = entry;
+ }
+ }
return;
}
}
}
return seq;
}
+
+ /* (non-Javadoc)
+ * @see jalview.datamodel.SequenceI#createDatasetSequence()
+ */
+ public SequenceI createDatasetSequence()
+ {
+ if (datasetSequence==null)
+ {
+ datasetSequence = new Sequence(getName(),
+ AlignSeq.extractGaps(
+ jalview.util.Comparison.GapChars,
+ getSequenceAsString()),
+ getStart(),
+ getEnd());
+ datasetSequence.setSequenceFeatures(getSequenceFeatures());
+ datasetSequence.setDescription(getDescription());
+ setSequenceFeatures(null);
+ // move database references onto dataset sequence
+ datasetSequence.setDBRef(getDBRef());
+ setDBRef(null);
+ }
+ return datasetSequence;
+ }
/* (non-Javadoc)
* @see jalview.datamodel.SequenceI#setAlignmentAnnotation(AlignmmentAnnotation[] annotations)
*/