* @param forStructureView
* when true, record the mapping for use in mouseOvers
*
- * @param sequence
+ * @param sequenceArray
* - one or more sequences to be mapped to pdbFile
* @param targetChains
* - optional chain specification for mapping each sequence to pdb
* @return null or the structure data parsed as a pdb file
*/
synchronized public PDBfile setMapping(boolean forStructureView,
- SequenceI[] sequence, String[] targetChains, String pdbFile,
+ SequenceI[] sequenceArray, String[] targetChains, String pdbFile,
String protocol)
{
/*
boolean parseSecStr = processSecondaryStructure;
if (isPDBFileRegistered(pdbFile))
{
- for (SequenceI sq : sequence)
+ for (SequenceI sq : sequenceArray)
{
SequenceI ds = sq;
while (ds.getDatasetSequence() != null)
}
}
PDBfile pdb = null;
+ boolean isMapUsingSIFTs = Boolean.valueOf(jalview.bin.Cache.getDefault(
+ "MAP_WITH_SIFTS", "false"));
+ SiftsClient siftsClient = null;
try
{
pdb = new PDBfile(addTempFacAnnot, parseSecStr, secStructServices,
pdbFile, protocol);
+ if (isMapUsingSIFTs)
+ {
+ siftsClient = new SiftsClient(pdb);
+ }
if (pdb.id != null && pdb.id.trim().length() > 0
&& AppletFormatAdapter.FILE.equals(protocol))
{
registerPDBFile(pdb.id.trim(), pdbFile);
}
+ } catch (SiftsException e)
+ {
+ e.printStackTrace();
} catch (Exception ex)
{
ex.printStackTrace();
}
String targetChain;
- for (int s = 0; s < sequence.length; s++)
+ for (int s = 0; s < sequenceArray.length; s++)
{
boolean infChain = true;
- final SequenceI seq = sequence[s];
+ final SequenceI seq = sequenceArray[s];
if (targetChains != null && targetChains[s] != null)
{
infChain = false;
pdbFile = "INLINE" + pdb.id;
}
- StructureMapping seqToStrucMapping = null;
- boolean isMapViaSIFTs = Boolean.valueOf(jalview.bin.Cache.getDefault(
- "MAP_WITH_SIFTS", "false"));
- if (isMapViaSIFTs)
+ ArrayList<StructureMapping> seqToStrucMapping = null;
+ if (isMapUsingSIFTs)
{
- SiftsClient siftsClient = new SiftsClient(pdb);
try
{
- seqToStrucMapping = siftsClient.getSiftsStructureMapping(seq,
- pdbFile, maxChainId);
+ seqToStrucMapping = new ArrayList<StructureMapping>();
+ if (targetChain != null && !targetChain.trim().isEmpty())
+ {
+ maxChainId = targetChain;
+ StructureMapping curChainMapping = siftsClient
+ .getSiftsStructureMapping(seq, pdbFile, targetChain);
+ seqToStrucMapping.add(curChainMapping);
+ }
+ else
+ {
+ for (PDBChain chain : pdb.chains)
+ {
+ maxChainId = chain.id;
+ StructureMapping curChainMapping = siftsClient
+ .getSiftsStructureMapping(seq, pdbFile, chain.id);
+ seqToStrucMapping.add(curChainMapping);
+ }
+ }
} catch (SiftsException e)
{
System.err
if (forStructureView)
{
- mappings.add(seqToStrucMapping);
+ // mappings.add(seqToStrucMapping);
+ mappings.addAll(seqToStrucMapping);
}
}
return pdb;
}
- private StructureMapping getNWMappings(SequenceI seq, String pdbFile,
+ private ArrayList<StructureMapping> getNWMappings(SequenceI seq,
+ String pdbFile,
String maxChainId, PDBChain maxChain, PDBfile pdb,
AlignSeq maxAlignseq)
{
StructureMapping nwMapping = new StructureMapping(seq, pdbFile,
pdb.id, maxChainId, mapping, mappingDetails.toString());
maxChain.transferResidueAnnotation(nwMapping, sqmpping);
- return nwMapping;
+ ArrayList<StructureMapping> mappings = new ArrayList<StructureMapping>();
+ mappings.add(nwMapping);
+ return mappings;
}
public void removeStructureViewerListener(Object svl, String[] pdbfiles)