}
List<StructureMapping> seqToStrucMapping = new ArrayList<>();
+ List<StructureMapping> foundSiftsMappings = new ArrayList<>();
if (isMapUsingSIFTs && seq.isProtein())
{
if (progress != null)
pdb.getId().toLowerCase(Locale.ROOT));
maxChain.transferResidueAnnotation(siftsMapping, null);
ds.addPDBId(maxChain.sequence.getAllPDBEntries().get(0));
+ foundSiftsMappings.add(siftsMapping);
} catch (SiftsException e)
{
- // fall back to NW alignment
Console.error(e.getMessage());
- StructureMapping nwMapping = getNWMappings(seq, pdbFile,
- targetChainId, maxChain, pdb, maxAlignseq);
- seqToStrucMapping.add(nwMapping);
- 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));
}
}
else
{
- List<StructureMapping> foundSiftsMappings = new ArrayList<>();
for (PDBChain chain : pdb.getChains())
{
StructureMapping siftsMapping = null;
jalview.bin.Console.errPrintln(e.getMessage());
}
}
+ // If sifts was successful, add mappings and return
if (!foundSiftsMappings.isEmpty())
{
- seqToStrucMapping.addAll(foundSiftsMappings);
ds.addPDBId(sqmpping.getTo().getAllPDBEntries().get(0));
}
- else
- {
- /*
- * fallback to NeedlemanWunch.
- */
- StructureMapping nwMapping = getNWMappings(seq, pdbFile,
- maxChainId, maxChain, pdb, maxAlignseq);
- seqToStrucMapping.add(nwMapping);
- maxChain.transferRESNUMFeatures(seq, null,
- pdb.getId().toLowerCase(Locale.ROOT)); // FIXME: is this
- // "IEA:Jalview" ?
- maxChain.transferResidueAnnotation(nwMapping, sqmpping);
- ds.addPDBId(maxChain.sequence.getAllPDBEntries().get(0));
- }
+ }
+
+ // If sifts was successful, add mappings and return
+ if (!foundSiftsMappings.isEmpty())
+ {
+ seqToStrucMapping.addAll(foundSiftsMappings);
}
}
- else
+ if (foundSiftsMappings.isEmpty())
{
- // Not doing SIFTS
+ // Not doing SIFTS, or SIFTS failed for some reason.
+
// first check if we should use an identity mapping
if (idLengthChain != null && maxAlignseq.getS2Coverage() < 0.5)
{