return false;
}
String name = seq2.getName();
- final DBRefEntry[] xrefs = seq1.getDBRef();
+ final DBRefEntry[] xrefs = seq1.getDBRefs();
if (xrefs != null)
{
for (DBRefEntry xref : xrefs)
String cdsAccId = FeatureProperties
.getCodingFeature(DBRefSource.EMBL);
DBRefEntry[] cdsRefs = DBRefUtils.selectRefs(seqMapping.getTo()
- .getDBRef(), DBRefSource.CODINGDBS);
+ .getDBRefs(), DBRefSource.CODINGDBS);
if (cdsRefs != null)
{
for (DBRefEntry cdsRef : cdsRefs)
{
dss = dss.getDatasetSequence();
}
- DBRefEntry[] rfs = findXDbRefs(dna, dss.getDBRef());
+ DBRefEntry[] rfs = findXDbRefs(dna, dss.getDBRefs());
for (int r = 0; rfs != null && r < rfs.length; r++)
{
if (!refs.contains(rfs[r].getSource()))
{
// search for references to this sequence's direct references.
DBRefEntry[] lrfs = CrossRef
- .findXDbRefs(!dna, seqs[s].getDBRef());
+ .findXDbRefs(!dna, seqs[s].getDBRefs());
List<SequenceI> rseqs = new ArrayList<SequenceI>();
CrossRef.searchDatasetXrefs(seqs[s], !dna, lrfs, dataset, rseqs,
null); // don't need to specify codon frame for mapping here
for (SequenceI rs : rseqs)
{
- DBRefEntry[] xrs = findXDbRefs(dna, rs.getDBRef()); // not used??
+ DBRefEntry[] xrs = findXDbRefs(dna, rs.getDBRefs()); // not used??
for (int r = 0; rfs != null && r < rfs.length; r++)
{
if (!refs.contains(rfs[r].getSource()))
Vector cseqs = new Vector();
for (int s = 0; s < seqs.length; s++)
{
- DBRefEntry[] cdna = findXDbRefs(true, seqs[s].getDBRef());
+ DBRefEntry[] cdna = findXDbRefs(true, seqs[s].getDBRefs());
for (int c = 0; c < cdna.length; c++)
{
if (cdna[c].getSource().equals(DBRefSource.EMBLCDS))
dss = dss.getDatasetSequence();
}
boolean found = false;
- DBRefEntry[] xrfs = CrossRef.findXDbRefs(dna, dss.getDBRef());
+ DBRefEntry[] xrfs = CrossRef.findXDbRefs(dna, dss.getDBRefs());
if ((xrfs == null || xrfs.length == 0) && dataset != null)
{
System.out.println("Attempting to find ds Xrefs refs.");
- DBRefEntry[] lrfs = CrossRef.findXDbRefs(!dna, seqs[s].getDBRef());
+ DBRefEntry[] lrfs = CrossRef.findXDbRefs(!dna, seqs[s].getDBRefs());
// less ambiguous would be a 'find primary dbRefEntry' method.
// filter for desired source xref here
found = CrossRef.searchDatasetXrefs(dss, !dna, lrfs, dataset,
{
// TODO: examine each sequence for 'redundancy'
jalview.datamodel.DBRefEntry[] dbr = retrieved[rs]
- .getDBRef();
+ .getDBRefs();
if (dbr != null && dbr.length > 0)
{
for (int di = 0; di < dbr.length; di++)
}
// look for direct or indirect references in common
- DBRefEntry[] poss = nxt.getDBRef(), cands = null;
+ DBRefEntry[] poss = nxt.getDBRefs(), cands = null;
if (direct)
{
cands = jalview.util.DBRefUtils.searchRefs(poss, xrf);
for (int gd = 0; gd < selection.length; gd++)
{
SequenceI dna = selection[gd];
- DBRefEntry[] dnarefs = DBRefUtils.selectRefs(dna.getDBRef(),
+ DBRefEntry[] dnarefs = DBRefUtils.selectRefs(dna.getDBRefs(),
jalview.datamodel.DBRefSource.DNACODINGDBS);
if (dnarefs != null)
{
// intersect with pep
List<DBRefEntry> mappedrefs = new ArrayList<DBRefEntry>();
- DBRefEntry[] refs = dna.getDBRef();
+ DBRefEntry[] refs = dna.getDBRefs();
for (int d = 0; d < refs.length; d++)
{
if (refs[d].getMap() != null && refs[d].getMap().getMap() != null
{
SequenceFeature[] sfs = dna.getSequenceFeatures();
Boolean fgstate;
- DBRefEntry[] dnarefs = DBRefUtils.selectRefs(dna.getDBRef(),
+ DBRefEntry[] dnarefs = DBRefUtils.selectRefs(dna.getDBRefs(),
DBRefSource.DNACODINGDBS);
if (dnarefs != null)
{
dbseq = dbseq.getDatasetSequence();
}
// add in any interesting identifiers
- if (dbseq.getDBRef() != null)
+ if (dbseq.getDBRefs() != null)
{
- DBRefEntry dbr[] = dbseq.getDBRef();
+ DBRefEntry dbr[] = dbseq.getDBRefs();
SeqIdName sid = null;
for (int r = 0; r < dbr.length; r++)
{
public void setSource(String source);
public void setVersion(String version);
+
+ public void setStartRes(int startRes);
+
+ public int getStartRes();
+
+ public void setEndRes(int endRes);
+
+ public int getEndRes();
}
// collect matching db-refs
DBRefEntry[] dbr = jalview.util.DBRefUtils.selectRefs(
- seq.getDBRef(), new String[] { target });
+ seq.getDBRefs(), new String[] { target });
// collect id string too
String id = seq.getName();
String descr = seq.getDescription();
{
String source = "", version = "", accessionId = "";
+ private int startRes, endRes;
/**
* maps from associated sequence to the database sequence's coordinate system
*/
{
return getSrcAccString();
}
+
+ public int getStartRes()
+ {
+ return startRes;
+ }
+
+ public void setStartRes(int startRes)
+ {
+ this.startRes = startRes;
+ }
+
+ public int getEndRes()
+ {
+ return endRes;
+ }
+
+ public void setEndRes(int endRes)
+ {
+ this.endRes = endRes;
+ }
}
}
}
setDatasetSequence(seq.getDatasetSequence());
- if (datasetSequence == null && seq.getDBRef() != null)
+ if (datasetSequence == null && seq.getDBRefs() != null)
{
// only copy DBRefs if we really are a dataset sequence
- DBRefEntry[] dbr = seq.getDBRef();
+ DBRefEntry[] dbr = seq.getDBRefs();
for (int i = 0; i < dbr.length; i++)
{
addDBRef(new DBRefEntry(dbr[i]));
}
@Override
- public DBRefEntry[] getDBRef()
+ public DBRefEntry[] getDBRefs()
{
if (dbrefs == null && datasetSequence != null
&& this != datasetSequence)
{
- return datasetSequence.getDBRef();
+ return datasetSequence.getDBRefs();
}
return dbrefs;
}
datasetSequence.setDescription(getDescription());
setSequenceFeatures(null);
// move database references onto dataset sequence
- datasetSequence.setDBRef(getDBRef());
+ datasetSequence.setDBRef(getDBRefs());
setDBRef(null);
datasetSequence.setPDBId(getAllPDBEntries());
setPDBId(null);
}
}
// transfer database references
- DBRefEntry[] entryRefs = entry.getDBRef();
+ DBRefEntry[] entryRefs = entry.getDBRefs();
if (entryRefs != null)
{
for (int r = 0; r < entryRefs.length; r++)
if (seqs[ipos] != null)
{
seqs[ipos].setDescription(seq.getDescription());
- seqs[ipos].setDBRef(seq.getDBRef());
+ seqs[ipos].setDBRef(seq.getDBRefs());
seqs[ipos].setSequenceFeatures(seq.getSequenceFeatures());
if (seq.getDatasetSequence() != null)
{
public void setDBRef(DBRefEntry[] dbs);
- public DBRefEntry[] getDBRef();
+ public DBRefEntry[] getDBRefs();
/**
* add the given entry to the list of DBRefs for this sequence, or replace a
if (jds.getDatasetSequence() != null)
{
vamsasSeq.setDsseqid(seqHash(jds.getDatasetSequence()));
- if (jds.getDatasetSequence().getDBRef() != null)
+ if (jds.getDatasetSequence().getDBRefs() != null)
{
- dbrefs = jds.getDatasetSequence().getDBRef();
+ dbrefs = jds.getDatasetSequence().getDBRefs();
}
}
else
{
vamsasSeq.setDsseqid(id); // so we can tell which sequences really are
// dataset sequences only
- dbrefs = jds.getDBRef();
+ dbrefs = jds.getDBRefs();
}
if (dbrefs != null)
{
// collect matching db-refs
DBRefEntry[] dbr = jalview.util.DBRefUtils.selectRefs(
- seq.getDBRef(), new String[] { urlLink.getTarget() });
+ seq.getDBRefs(), new String[] { urlLink.getTarget() });
// collect id string too
String id = seq.getName();
String descr = seq.getDescription();
{
sqi = sqi.getDatasetSequence();
}
- DBRefEntry[] dbr = sqi.getDBRef();
+ DBRefEntry[] dbr = sqi.getDBRefs();
if (dbr != null && dbr.length > 0)
{
for (int d = 0; d < dbr.length; d++)
{
if (rs[r] != null
&& (found = DBRefUtils.searchRefs(
- rs[r].getDBRef(), dbr)) != null
+ rs[r].getDBRefs(), dbr)) != null
&& found.length > 0)
{
rfound = true;
}
}
- if (seq.getDBRef() != null && seq.getDBRef().length != 0)
+ if (seq.getDBRefs() != null && seq.getDBRefs().length != 0)
{
int count = 0;
- for (DBRefEntry dbRef : seq.getDBRef())
+ for (DBRefEntry dbRef : seq.getDBRefs())
{
if (isValidSeqName(getDBRefId(dbRef)))
{
{
// search dbrefs, features and annotation
DBRefEntry[] refs = jalview.util.DBRefUtils.selectRefs(
- sq.getDBRef(),
+ sq.getDBRefs(),
new String[] { labelClass.toUpperCase() });
if (refs != null)
{
// sets the local reference field
int t = 0; // sequence
if (seq.getDatasetSequence() != null
- && seq.getDatasetSequence().getDBRef() != null)
+ && seq.getDatasetSequence().getDBRefs() != null)
{
jalview.datamodel.DBRefEntry[] dbr = seq.getDatasetSequence()
- .getDBRef();
+ .getDBRefs();
int i, j;
for (i = 0, j = dbr.length; i < j; i++)
{
{
// collect matching db-refs
- DBRefEntry[] dbr = jalview.util.DBRefUtils.selectRefs(seq.getDBRef(),
+ DBRefEntry[] dbr = jalview.util.DBRefUtils.selectRefs(seq.getDBRefs(),
new String[] { target });
// collect id string too
String id = seq.getName();
{
ds = ds.getDatasetSequence();
}
- DBRefEntry[] dbrefs = ds.getDBRef();
+ DBRefEntry[] dbrefs = ds.getDBRefs();
if (showDbRefs && dbrefs != null)
{
for (int i = 0; i < dbrefs.length; i++)
{
maxid = tmp.length();
}
- if (s[in].getDBRef() != null)
+ if (s[in].getDBRefs() != null)
{
- for (int idb = 0; idb < s[in].getDBRef().length; idb++)
+ for (int idb = 0; idb < s[in].getDBRefs().length; idb++)
{
if (dataRef == null)
{
dataRef = new Hashtable();
}
- String datAs1 = s[in].getDBRef()[idb].getSource().toString()
+ String datAs1 = s[in].getDBRefs()[idb].getSource().toString()
+ " ; "
- + s[in].getDBRef()[idb].getAccessionId().toString();
+ + s[in].getDBRefs()[idb].getAccessionId().toString();
dataRef.put(tmp, datAs1);
}
}
}
}
- DBRefEntry[] entries = oldseq.getDBRef();
+ DBRefEntry[] entries = oldseq.getDBRefs();
if (entries != null)
{
oldseq.addDBRef(new jalview.datamodel.DBRefEntry(
boolean modifiedthedoc = false;
SequenceI sq = (SequenceI) jvobj;
- if (sq.getDatasetSequence() == null && sq.getDBRef() != null)
+ if (sq.getDatasetSequence() == null && sq.getDBRefs() != null)
{
// only sync database references for dataset sequences
- DBRefEntry[] entries = sq.getDBRef();
+ DBRefEntry[] entries = sq.getDBRefs();
// jalview.datamodel.DBRefEntry dbentry;
for (int db = 0; db < entries.length; db++)
{
private void matchConjugateDBRefs(SequenceI from, SequenceI to,
jalview.util.MapList smap)
{
- if (from.getDBRef() == null && to.getDBRef() == null)
+ if (from.getDBRefs() == null && to.getDBRefs() == null)
{
if (jalview.bin.Cache.log.isDebugEnabled())
{
jalview.bin.Cache.log.debug("Matching conjugate refs for "
+ from.getName() + " and " + to.getName());
}
- jalview.datamodel.DBRefEntry[] fdb = from.getDBRef();
+ jalview.datamodel.DBRefEntry[] fdb = from.getDBRefs();
jalview.datamodel.DBRefEntry[] tdb = new jalview.datamodel.DBRefEntry[to
- .getDBRef().length];
- int tdblen = to.getDBRef().length;
- System.arraycopy(to.getDBRef(), 0, tdb, 0, tdblen);
+ .getDBRefs().length];
+ int tdblen = to.getDBRefs().length;
+ System.arraycopy(to.getDBRefs(), 0, tdb, 0, tdblen);
Vector matched = new Vector();
jalview.util.MapList smapI = smap.getInverse();
for (int f = 0; f < fdb.length; f++)
import jalview.datamodel.SearchResults;
import jalview.datamodel.SequenceI;
import jalview.io.AppletFormatAdapter;
+import jalview.io.SiftsClient;
import jalview.util.MappingUtils;
import jalview.util.MessageManager;
}
};
+ // mapWithNWAlignment();
+ // mapWithSIFTS();
maxAlignseq.printAlignment(ps);
mappingDetails.append(NEWLINE).append("PDB start/end ");
{
pdbFile = "INLINE" + pdb.id;
}
- StructureMapping newMapping = new StructureMapping(seq, pdbFile,
- pdb.id, maxChainId, mapping, mappingDetails.toString());
+ // StructureMapping newMapping = new StructureMapping(seq, pdbFile,
+ // pdb.id, maxChainId, mapping, mappingDetails.toString());
+ StructureMapping newMapping = new SiftsClient(pdb.id)
+ .getSiftsMappingsFor(seq, pdbFile, maxChainId);
if (forStructureView)
{
mappings.add(newMapping);
return pdb;
}
+ private StructureMapping mapWithNWAlignment(StringBuilder mappingDetails,
+ PDBChain maxChain, AlignSeq maxAlignseq, SequenceI seq,
+ PrintStream ps)
+ {
+ maxAlignseq.printAlignment(ps);
+
+ mappingDetails.append(NEWLINE).append("PDB start/end ");
+ mappingDetails.append(String.valueOf(maxAlignseq.seq2start))
+ .append(" ");
+ mappingDetails.append(String.valueOf(maxAlignseq.seq2end));
+ mappingDetails.append(NEWLINE).append("SEQ start/end ");
+ // TODO JAL-1887 should be fixed from here
+ mappingDetails.append(
+ String.valueOf(maxAlignseq.seq1start + seq.getStart() - 1))
+ .append(" ");
+ mappingDetails.append(String.valueOf(maxAlignseq.seq1end + seq.getEnd()
+ - 1));
+
+ maxChain.makeExactMapping(maxAlignseq, seq);
+ jalview.datamodel.Mapping sqmpping = maxAlignseq
+ .getMappingFromS1(false);
+ jalview.datamodel.Mapping omap = new jalview.datamodel.Mapping(sqmpping
+ .getMap().getInverse());
+ maxChain.transferRESNUMFeatures(seq, null);
+
+ // allocate enough slots to store the mapping from positions in
+ // sequence[s] to the associated chain
+ int[][] mapping = new int[seq.findPosition(seq.getLength()) + 2][2];
+ int resNum = -10000;
+ int index = 0;
+
+ do
+ {
+ Atom tmp = maxChain.atoms.elementAt(index);
+ if (resNum != tmp.resNumber && tmp.alignmentMapping != -1)
+ {
+ resNum = tmp.resNumber;
+ if (tmp.alignmentMapping >= -1)
+ {
+ // TODO (JAL-1836) address root cause: negative residue no in PDB
+ // file
+ mapping[tmp.alignmentMapping + 1][0] = tmp.resNumber;
+ mapping[tmp.alignmentMapping + 1][1] = tmp.atomIndex;
+ }
+ }
+
+ index++;
+ } while (index < maxChain.atoms.size());
+
+ return null;
+ }
+
public void removeStructureViewerListener(Object svl, String[] pdbfiles)
{
listeners.removeElement(svl);
{
SequenceI sequence = dataset[seqIndex];
DBRefEntry[] uprefs = jalview.util.DBRefUtils.selectRefs(
- sequence.getDBRef(),
+ sequence.getDBRefs(),
new String[] { dbsource.getDbSource() }); // jalview.datamodel.DBRefSource.UNIPROT
// });
// check for existing dbrefs to use
Vector sequenceMatches = new Vector();
// look for corresponding accession ids
DBRefEntry[] entryRefs = jalview.util.DBRefUtils.selectRefs(
- entry.getDBRef(), new String[] { dbSource });
+ entry.getDBRefs(), new String[] { dbSource });
if (entryRefs == null)
{
System.err
// no existing references
// TODO: test for legacy where uniprot or EMBL refs exist but no
// mappings are made (but content matches retrieved set)
- boolean updateRefFrame = sequence.getDBRef() == null
- || sequence.getDBRef().length == 0;
+ boolean updateRefFrame = sequence.getDBRefs() == null
+ || sequence.getDBRefs().length == 0;
// TODO:
// verify sequence against the entry sequence
for (int i = 0; sequencesArray != null && i < sequencesArray.length; i++)
{
nseq.addElement(sequencesArray[i]);
- DBRefEntry dbr[] = sequencesArray[i].getDBRef();
+ DBRefEntry dbr[] = sequencesArray[i].getDBRefs();
jalview.datamodel.Mapping map = null;
for (int r = 0; (dbr != null) && r < dbr.length; r++)
{
int refCount = 0;
for (int i = 0; i < sequences.length; i++)
{
- DBRefEntry[] dbref = sequences[i].getDBRef();
+ DBRefEntry[] dbref = sequences[i].getDBRefs();
if (dbref != null)
{
for (int j = 0; j < dbref.length; j++)
return null;
}
DBRefEntry[] uprefs = jalview.util.DBRefUtils.selectRefs(
- seq.getDBRef(), new String[] {
+ seq.getDBRefs(), new String[] {
// jalview.datamodel.DBRefSource.PDB,
jalview.datamodel.DBRefSource.UNIPROT,
// jalview.datamodel.DBRefSource.EMBL - not tested on any EMBL coord
{
rseqs.addElement(seqs[is]);
DBRefEntry[] frefs = DBRefUtils.searchRefs(seqs[is]
- .getDBRef(), new DBRefEntry(db, null, null));
+ .getDBRefs(), new DBRefEntry(db, null, null));
if (frefs != null)
{
for (DBRefEntry dbr : frefs)
assertEquals("GGGTTT", exon.getSequenceAsString());
assertEquals("dna1|A12345", exon.getName());
- assertEquals(1, exon.getDBRef().length);
- DBRefEntry cdsRef = exon.getDBRef()[0];
+ assertEquals(1, exon.getDBRefs().length);
+ DBRefEntry cdsRef = exon.getDBRefs()[0];
assertEquals("EMBLCDS", cdsRef.getSource());
assertEquals("2", cdsRef.getVersion());
assertEquals("A12345", cdsRef.getAccessionId());
SequenceI exon = exons.get(0);
assertEquals("GGGTTT", exon.getSequenceAsString());
assertEquals("dna1|A12345", exon.getName());
- assertEquals(1, exon.getDBRef().length);
- DBRefEntry cdsRef = exon.getDBRef()[0];
+ assertEquals(1, exon.getDBRefs().length);
+ DBRefEntry cdsRef = exon.getDBRefs()[0];
assertEquals("EMBLCDS", cdsRef.getSource());
assertEquals("2", cdsRef.getVersion());
assertEquals("A12345", cdsRef.getAccessionId());
exon = exons.get(1);
assertEquals("aaaccc", exon.getSequenceAsString());
assertEquals("dna1|A12346", exon.getName());
- assertEquals(1, exon.getDBRef().length);
- cdsRef = exon.getDBRef()[0];
+ assertEquals(1, exon.getDBRefs().length);
+ cdsRef = exon.getDBRefs()[0];
assertEquals("EMBLCDS", cdsRef.getSource());
assertEquals("3", cdsRef.getVersion());
assertEquals("A12346", cdsRef.getAccessionId());
exon = exons.get(2);
assertEquals("aaaTTT", exon.getSequenceAsString());
assertEquals("dna1|A12347", exon.getName());
- assertEquals(1, exon.getDBRef().length);
- cdsRef = exon.getDBRef()[0];
+ assertEquals(1, exon.getDBRefs().length);
+ cdsRef = exon.getDBRefs()[0];
assertEquals("EMBLCDS", cdsRef.getSource());
assertEquals("4", cdsRef.getVersion());
assertEquals("A12347", cdsRef.getAccessionId());
{
SequenceI seq = new Sequence("Seq1", "ABCD");
DBRefEntry ref = DBRefUtils.parseToDbRef(seq, "EMBL", "1.2", "a7890");
- DBRefEntry[] refs = seq.getDBRef();
+ DBRefEntry[] refs = seq.getDBRefs();
assertEquals(1, refs.length);
assertSame(ref, refs[0]);
assertEquals("EMBL", ref.getSource());
SequenceI seq = new Sequence("Seq1", "ABCD");
DBRefEntry ref = DBRefUtils.parseToDbRef(seq, "pdb", "1.2",
"1WRI A; 7-80;");
- DBRefEntry[] refs = seq.getDBRef();
+ DBRefEntry[] refs = seq.getDBRefs();
assertEquals(1, refs.length);
assertSame(ref, refs[0]);
assertEquals("PDB", ref.getSource());
FeatureProperties.isCodingFeature(embl.getDbSource(),
sfs[0].getType()));
assertEquals(embl.getDbSource(), sfs[0].getFeatureGroup());
- DBRefEntry[] dr = DBRefUtils.selectRefs(seq.getDBRef(),
+ DBRefEntry[] dr = DBRefUtils.selectRefs(seq.getDBRefs(),
DBRefSource.PROTEINSEQ);
assertNotNull(dr);
assertEquals("Expected a single Uniprot cross reference", 1, dr.length);