git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'patch/JAL-2976_vaqua4_fallback' into releases/Release_2_10_4_Branch
[jalview.git]
/
src
/
jalview
/
structure
/
StructureSelectionManager.java
diff --git
a/src/jalview/structure/StructureSelectionManager.java
b/src/jalview/structure/StructureSelectionManager.java
index
8380b19
..
cd986c0
100644
(file)
--- a/
src/jalview/structure/StructureSelectionManager.java
+++ b/
src/jalview/structure/StructureSelectionManager.java
@@
-74,8
+74,6
@@
public class StructureSelectionManager
private boolean addTempFacAnnot = false;
private boolean addTempFacAnnot = false;
- private SiftsClient siftsClient = null;
-
/*
* Set of any registered mappings between (dataset) sequences.
*/
/*
* Set of any registered mappings between (dataset) sequences.
*/
@@
-287,7
+285,8
@@
public class StructureSelectionManager
}
/**
}
/**
- * Returns the file name for a mapped PDB id (or null if not mapped).
+ * Returns the filename the PDB id is already mapped to if known, or null if
+ * it is not mapped
*
* @param pdbid
* @return
*
* @param pdbid
* @return
@@
-296,7
+295,7
@@
public class StructureSelectionManager
{
for (StructureMapping sm : mappings)
{
{
for (StructureMapping sm : mappings)
{
- if (sm.getPdbId().equals(pdbid))
+ if (sm.getPdbId().equalsIgnoreCase(pdbid))
{
return sm.pdbfile;
}
{
return sm.pdbfile;
}
@@
-397,9
+396,13
@@
public class StructureSelectionManager
boolean isMapUsingSIFTs = SiftsSettings.isMapWithSifts();
try
{
boolean isMapUsingSIFTs = SiftsSettings.isMapWithSifts();
try
{
+ // FIXME if sourceType is not null, we've lost data here
sourceType = AppletFormatAdapter.checkProtocol(pdbFile);
sourceType = AppletFormatAdapter.checkProtocol(pdbFile);
- pdb = new JmolParser(pdbFile, sourceType);
-
+ pdb = new JmolParser(false, pdbFile, sourceType);
+ pdb.addSettings(parseSecStr && processSecondaryStructure,
+ parseSecStr && addTempFacAnnot,
+ parseSecStr && secStructServices);
+ pdb.doParse();
if (pdb.getId() != null && pdb.getId().trim().length() > 0
&& DataSourceType.FILE == sourceType)
{
if (pdb.getId() != null && pdb.getId().trim().length() > 0
&& DataSourceType.FILE == sourceType)
{
@@
-413,7
+416,10
@@
public class StructureSelectionManager
ex.printStackTrace();
return null;
}
ex.printStackTrace();
return null;
}
-
+ /*
+ * sifts client - non null if SIFTS mappings are to be used
+ */
+ SiftsClient siftsClient = null;
try
{
if (isMapUsingSIFTs)
try
{
if (isMapUsingSIFTs)
@@
-424,6
+430,7
@@
public class StructureSelectionManager
{
isMapUsingSIFTs = false;
e.printStackTrace();
{
isMapUsingSIFTs = false;
e.printStackTrace();
+ siftsClient = null;
}
String targetChainId;
}
String targetChainId;
@@
-526,7
+533,7
@@
public class StructureSelectionManager
try
{
siftsMapping = getStructureMapping(seq, pdbFile, targetChainId,
try
{
siftsMapping = getStructureMapping(seq, pdbFile, targetChainId,
- pdb, maxChain, sqmpping, maxAlignseq);
+ pdb, maxChain, sqmpping, maxAlignseq, siftsClient);
seqToStrucMapping.add(siftsMapping);
maxChain.makeExactMapping(siftsMapping, seq);
maxChain.transferRESNUMFeatures(seq, "IEA: SIFTS");// FIXME: is this
seqToStrucMapping.add(siftsMapping);
maxChain.makeExactMapping(siftsMapping, seq);
maxChain.transferRESNUMFeatures(seq, "IEA: SIFTS");// FIXME: is this
@@
-558,7
+565,8
@@
public class StructureSelectionManager
try
{
siftsMapping = getStructureMapping(seq,
try
{
siftsMapping = getStructureMapping(seq,
- pdbFile, chain.id, pdb, chain, sqmpping, maxAlignseq);
+ pdbFile, chain.id, pdb, chain, sqmpping, maxAlignseq,
+ siftsClient);
foundSiftsMappings.add(siftsMapping);
chain.makeExactMapping(siftsMapping, seq);
chain.transferRESNUMFeatures(seq, "IEA: SIFTS");// FIXME: is this
foundSiftsMappings.add(siftsMapping);
chain.makeExactMapping(siftsMapping, seq);
chain.transferRESNUMFeatures(seq, "IEA: SIFTS");// FIXME: is this
@@
-568,6
+576,13
@@
public class StructureSelectionManager
{
System.err.println(e.getMessage());
}
{
System.err.println(e.getMessage());
}
+ catch (Exception e)
+ {
+ System.err
+ .println(
+ "Unexpected exception during SIFTS mapping - falling back to NW for this sequence/structure pair");
+ System.err.println(e.getMessage());
+ }
}
if (!foundSiftsMappings.isEmpty())
{
}
if (!foundSiftsMappings.isEmpty())
{
@@
-601,7
+616,10
@@
public class StructureSelectionManager
}
if (forStructureView)
{
}
if (forStructureView)
{
- mappings.addAll(seqToStrucMapping);
+ for (StructureMapping sm : seqToStrucMapping)
+ {
+ addStructureMapping(sm); // not addAll!
+ }
}
if (progress != null)
{
}
if (progress != null)
{
@@
-653,7
+671,10
@@
public class StructureSelectionManager
public void addStructureMapping(StructureMapping sm)
{
public void addStructureMapping(StructureMapping sm)
{
- mappings.add(sm);
+ if (!mappings.contains(sm))
+ {
+ mappings.add(sm);
+ }
}
/**
}
/**
@@
-667,13
+688,15
@@
public class StructureSelectionManager
* @param maxChain
* @param sqmpping
* @param maxAlignseq
* @param maxChain
* @param sqmpping
* @param maxAlignseq
+ * @param siftsClient
+ * client for retrieval of SIFTS mappings for this structure
* @return
* @throws SiftsException
*/
private StructureMapping getStructureMapping(SequenceI seq,
String pdbFile, String targetChainId, StructureFile pdb,
PDBChain maxChain, jalview.datamodel.Mapping sqmpping,
* @return
* @throws SiftsException
*/
private StructureMapping getStructureMapping(SequenceI seq,
String pdbFile, String targetChainId, StructureFile pdb,
PDBChain maxChain, jalview.datamodel.Mapping sqmpping,
- AlignSeq maxAlignseq) throws SiftsException
+ AlignSeq maxAlignseq, SiftsClient siftsClient) throws SiftsException
{
StructureMapping curChainMapping = siftsClient
.getSiftsStructureMapping(seq, pdbFile, targetChainId);
{
StructureMapping curChainMapping = siftsClient
.getSiftsStructureMapping(seq, pdbFile, targetChainId);