SequenceI seq = getSpecifiedSequence(af, subId);
if (seq == null)
{
+ // Could not find sequence from subId, let's assume the first
+ // sequence in the alignframe
+ AlignmentI al = af.getCurrentView().getAlignment();
+ seq = al.getSequenceAt(0);
+ }
+
+ if (seq == null)
+ {
Console.warn("Could not find sequence for argument "
+ Arg.STRUCTURE.argString() + "=" + val);
// you probably want to continue here, not break
Console.debug("Using structure file (from argument) '"
+ structureFile.getAbsolutePath() + "'");
}
-
// TRY THIS
/*
* PDBEntry fileEntry = new AssociatePdbFileWithSeq()
* SequenceI[] { selectedSequence });
*
*/
-
/* THIS DOESN'T WORK */
else if (seq.getAllPDBEntries() != null
&& seq.getAllPDBEntries().size() > 0)
}
}
- // load a pAE file if given
+ // load a PAE file if given
if (avm.containsArg(Arg.PAEMATRIX))
{
AlignFrame af = afMap.get(id);
}
String structid = null;
String structfile = null;
- String seqid = null;
+ int seqindex = SubVals.NOTSET;
if (subVals.notSet())
{
ArgValue likelyStructure = avm
else
{
structfile = likelyStructure.getValue();
+ Console.debug(
+ "##### Using closest previous structure argument '"
+ + structfile + "'");
}
}
}
if (structfile != null)
{
Console.info("##### Attaching paeFile '" + paePath + "' to "
- + "structfile=" + subVals.get("structfile"));
+ + "structfile=" + structfile);
EBIAlfaFold.addAlphaFoldPAE(af.getCurrentView().getAlignment(),
- paeFile, subVals.getIndex(), subVals.get("structfile"),
- true, false, paeLabel);
+ paeFile, seqindex, structfile, true, false, paeLabel);
}
else if (structid != null)
{
Console.info("##### Attaching paeFile '" + paePath + "' to "
- + "structid=" + subVals.get("structid"));
+ + "structid=" + structid);
EBIAlfaFold.addAlphaFoldPAE(af.getCurrentView().getAlignment(),
- paeFile, subVals.getIndex(), subVals.get("structid"),
- true, true, paeLabel);
+ paeFile, seqindex, subVals.get("structid"), true, true,
+ paeLabel);
}
else
{
+ seqindex = subVals.getIndex();
Console.debug("##### Attaching paeFile '" + paePath
- + "' to sequence index " + subVals.getIndex());
+ + "' to sequence index " + seqindex);
EBIAlfaFold.addAlphaFoldPAE(af.getCurrentView().getAlignment(),
- paeFile, subVals.getIndex(), null, false, false,
- paeLabel);
- // required to readjust the height and position of the pAE
+ paeFile, seqindex, null, false, false, paeLabel);
+ // required to readjust the height and position of the PAE
// annotation
}
for (AlignmentViewPanel ap : af.getAlignPanels())
private SequenceI getSpecifiedSequence(AlignFrame af, SubVals subId)
{
+ if (subId == null)
+ return null;
AlignmentI al = af.getCurrentView().getAlignment();
- if (-1 < subId.getIndex()
- && subId.getIndex() < al.getSequences().size())
+ if (subId.has("seqid"))
{
- return al.getSequenceAt(subId.getIndex());
+ return al.findName(subId.get("seqid"));
}
- else if (subId.has("seqid"))
+ else if (-1 < subId.getIndex()
+ && subId.getIndex() < al.getSequences().size())
{
- return al.findName(subId.get("seqid"));
+ return al.getSequenceAt(subId.getIndex());
}
return null;
}