*
* @param sequenceArray
* - one or more sequences to be mapped to pdbFile
- * @param targetChains
+ * @param targetChainIds
* - optional chain specification for mapping each sequence to pdb
* (may be nill, individual elements may be nill)
* @param pdbFile
* @return null or the structure data parsed as a pdb file
*/
synchronized public PDBfile setMapping(boolean forStructureView,
- SequenceI[] sequenceArray, String[] targetChains, String pdbFile,
+ SequenceI[] sequenceArray, String[] targetChainIds,
+ String pdbFile,
String protocol)
{
/*
{
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();
return null;
}
- String targetChain;
+ try
+ {
+ if (isMapUsingSIFTs)
+ {
+ siftsClient = new SiftsClient(pdb);
+ }
+ } catch (SiftsException e)
+ {
+ isMapUsingSIFTs = false;
+ e.printStackTrace();
+ }
+
+ String targetChainId;
for (int s = 0; s < sequenceArray.length; s++)
{
boolean infChain = true;
final SequenceI seq = sequenceArray[s];
- if (targetChains != null && targetChains[s] != null)
+ if (targetChainIds != null && targetChainIds[s] != null)
{
infChain = false;
- targetChain = targetChains[s];
+ targetChainId = targetChainIds[s];
}
else if (seq.getName().indexOf("|") > -1)
{
- targetChain = seq.getName().substring(
+ targetChainId = seq.getName().substring(
seq.getName().lastIndexOf("|") + 1);
- if (targetChain.length() > 1)
+ if (targetChainId.length() > 1)
{
- if (targetChain.trim().length() == 0)
+ if (targetChainId.trim().length() == 0)
{
- targetChain = " ";
+ targetChainId = " ";
}
else
{
// not a valid chain identifier
- targetChain = "";
+ targetChainId = "";
}
}
}
else
{
- targetChain = "";
+ targetChainId = "";
}
/*
boolean first = true;
for (PDBChain chain : pdb.chains)
{
- if (targetChain.length() > 0 && !targetChain.equals(chain.id)
+ if (targetChainId.length() > 0 && !targetChainId.equals(chain.id)
&& !infChain)
{
continue; // don't try to map chains don't match.
// as.traceAlignment();
if (first || as.maxscore > max
- || (as.maxscore == max && chain.id.equals(targetChain)))
+ || (as.maxscore == max && chain.id.equals(targetChainId)))
{
first = false;
maxChain = chain;
{
try
{
+ jalview.datamodel.Mapping sqmpping = maxAlignseq
+ .getMappingFromS1(false);
seqToStrucMapping = new ArrayList<StructureMapping>();
- if (targetChain != null && !targetChain.trim().isEmpty())
+ if (targetChainId != null && !targetChainId.trim().isEmpty())
{
- maxChainId = targetChain;
StructureMapping curChainMapping = siftsClient
- .getSiftsStructureMapping(seq, pdbFile, targetChain);
+ .getSiftsStructureMapping(seq, pdbFile, targetChainId);
seqToStrucMapping.add(curChainMapping);
+ maxChainId = targetChainId;
+ PDBChain chain = pdb.findChain(targetChainId);
+ if (chain != null)
+ {
+ chain.transferResidueAnnotation(curChainMapping, sqmpping);
+ }
}
else
{
for (PDBChain chain : pdb.chains)
{
- maxChainId = chain.id;
StructureMapping curChainMapping = siftsClient
.getSiftsStructureMapping(seq, pdbFile, chain.id);
seqToStrucMapping.add(curChainMapping);
+ maxChainId = chain.id;
+ chain.transferResidueAnnotation(curChainMapping, sqmpping);
}
}
} catch (SiftsException e)
{
+ e.printStackTrace();
System.err
.println(">>>>>>> SIFTs mapping could not be obtained... Now mapping with NW alignment");
seqToStrucMapping = getNWMappings(seq, pdbFile, maxChainId,