import jalview.util.DBRefUtils;
import jalview.util.MapList;
import jalview.util.StringUtils;
-import jalview.ws.params.InvalidArgumentException;
import java.util.ArrayList;
import java.util.Arrays;
* @param <T>
*/
@SuppressWarnings("serial")
- protected class DBModList<T> extends ArrayList<DBRefEntry> {
+ public class DBModList<T> extends ArrayList<DBRefEntry> {
protected int getModCount() {
return modCount;
SequenceI datasetSequence;
- String name;
+ private String name;
private char[] sequence;
- String description;
+ private String description;
- int start;
+ private int start;
- int end;
+ private int end;
- Vector<PDBEntry> pdbIds;
+ private Vector<PDBEntry> pdbIds;
- String vamsasId;
+ private String vamsasId;
private DBModList<DBRefEntry> dbrefs; // controlled access
*/
private int refModCount = 0;
- RNA rna;
+ private RNA rna;
/**
* This annotation is displayed below the alignment but the positions are tied
*
* TODO: change to List<>
*/
- Vector<AlignmentAnnotation> annotation;
+ private Vector<AlignmentAnnotation> annotation;
private SequenceFeaturesI sequenceFeatureStore;
@Override
public String getAssemblyId()
{
+ // DEV NOTE: DBRefEntry is reused here to hold chromosomal locus of a gene sequence.
+ // source=species, version=assemblyId, accession=chromosome, map = positions.
+
return ref.getVersion();
}
vamsasId = id;
}
- @SuppressWarnings("deprecation")
-@Override
- public void setDBRefs(List<DBRefEntry> newDBrefs) throws InvalidArgumentException
+ @Deprecated
+ @Override
+ public void setDBRefs(DBModList<DBRefEntry> newDBrefs)
{
if (dbrefs == null && datasetSequence != null
&& this != datasetSequence)
{
- datasetSequence.setDBRefs((DBModList<DBRefEntry>)newDBrefs);
+ datasetSequence.setDBRefs(newDBrefs);
return;
}
- if (newDBrefs != null && !(newDBrefs instanceof DBModList<?>))
- throw new InvalidArgumentException("DBrefs must have DBModList class");
-
- dbrefs = (DBModList<DBRefEntry>)newDBrefs;
+ dbrefs = newDBrefs;
refModCount = 0;
}
@Override
- public void getDBRefsFrom(SequenceI seq) {
- try {
- setDBRefs(seq.getDBRefs());
- } catch (InvalidArgumentException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- @Override
- public List<DBRefEntry> getDBRefs()
+ public DBModList<DBRefEntry> getDBRefs()
{
if (dbrefs == null && datasetSequence != null
&& this != datasetSequence)
primaries.add(ref);
}
+ // version must be not null, as otherwise it will not be a candidate, above
DBRefUtils.ensurePrimaries(this, primaries);
return primaries;
}