import jalview.io.DataSourceType;
import jalview.io.StructureFile;
import jalview.structure.StructureImportSettings.TFType;
+import jalview.util.Constants;
import jalview.util.MappingUtils;
import jalview.util.MessageManager;
import jalview.util.Platform;
}
List<StructureMapping> seqToStrucMapping = new ArrayList<>();
+ String provider = null;
if (isMapUsingSIFTs && seq.isProtein())
{
if (progress != null)
maxChain.makeExactMapping(maxAlignseq, seq);
maxChain.transferRESNUMFeatures(seq, "IEA:Jalview",
pdb.getId().toLowerCase(Locale.ROOT)); // FIXME: is
- // this
// "IEA:Jalview" ?
maxChain.transferResidueAnnotation(nwMapping, sqmpping);
ds.addPDBId(maxChain.sequence.getAllPDBEntries().get(0));
StructureMapping nwMapping = getNWMappings(seq, pdbFile, maxChainId,
maxChain, pdb, maxAlignseq);
seqToStrucMapping.add(nwMapping);
- ds.addPDBId(maxChain.sequence.getAllPDBEntries().get(0));
+ ds.addPDBId(maxChain.sequence.getAllPDBEntries().get(0));
}
+
+ //JAL-4392 TODO: Unable to match PDBProvider with Annotation without matching struct file path
+ String ssAnnotDescriptionInPDB = null;
+ String ssStructFilePathNameInPDB = pdb.getInFile(); //Structure file name in PDB data model
+ //Secondary structure annotations in pdb data model
+ AlignmentAnnotation[] ssAnnotationsInPDB = pdb.getSeqs().get(0).getAnnotation(Constants.SS_ANNOTATION_LABEL);
+ if(ssAnnotationsInPDB != null && ssAnnotationsInPDB.length>0) {
+ ssAnnotDescriptionInPDB = ssAnnotationsInPDB[0].description;
+ }
+
+ //Match the PDB entry using file path in the pdb data model and get the provider
+ Vector<PDBEntry> pdbEntries = seq.getDatasetSequence().getAllPDBEntries();
+ for(PDBEntry pdbEntry : pdbEntries) {
+ if(ssStructFilePathNameInPDB.startsWith(pdbEntry.getFile())) {
+ provider = pdbEntry.getProvider();
+ break;
+ }
+ }
+
+ //Add provider value as property to the ss annotation
+ if(provider != null) {
+ AlignmentAnnotation[] ssAnnotList = ds.getAnnotation(Constants.SS_ANNOTATION_LABEL);
+ if(ssAnnotList != null) {
+ for(AlignmentAnnotation ssAnnot : ssAnnotList) {
+ //Match the annotation description with the annotation in pdb data object
+ if(ssAnnot.getProperty(Constants.SS_PROVIDER_PROPERTY) == null
+ && ssAnnot.description.equals(ssAnnotDescriptionInPDB)) {
+ ssAnnot.setProperty(Constants.SS_PROVIDER_PROPERTY, provider);
+ }
+ }
+ }
+ }
+
+
if (forStructureView)
{
for (StructureMapping sm : seqToStrucMapping)