X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FCommands.java;h=67c0c64f9be7272f91e3d4fb358a5ac62c01a088;hb=a0ac724dba7d556966b546d4a0093449c397be84;hp=24a3c2232273e3cfc844275f0a5890bae14bb279;hpb=06379070d6c2267efe3a30926d84c51a48d1cdce;p=jalview.git diff --git a/src/jalview/bin/Commands.java b/src/jalview/bin/Commands.java index 24a3c22..67c0c64 100644 --- a/src/jalview/bin/Commands.java +++ b/src/jalview/bin/Commands.java @@ -16,6 +16,7 @@ import jalview.api.AlignmentViewPanel; import jalview.bin.argparser.Arg; import jalview.bin.argparser.ArgParser; import jalview.bin.argparser.ArgValue; +import jalview.bin.argparser.ArgValues; import jalview.bin.argparser.ArgValuesMap; import jalview.bin.argparser.SubVals; import jalview.datamodel.AlignmentAnnotation; @@ -489,6 +490,7 @@ public class Commands { String val = av.getValue(); SubVals subVals = ArgParser.getSubVals(val); + String paeLabel = subVals.get("label"); File paeFile = new File(subVals.getContent()); String paePath = null; try @@ -500,33 +502,57 @@ public class Commands Console.warn( "Problem with the PAE file path: '" + paePath + "'"); } - String structId = subVals.get("structid"); + String structid = null; + String structfile = null; + String seqid = null; if (subVals.notSet()) { - // take structid from pdbfilename + ArgValue likelyStructure = avm + .getClosestPreviousArgValueOfArg(av, Arg.STRUCTURE); + if (likelyStructure != null) + { + SubVals sv = likelyStructure.getSubVals(); + if (sv != null && sv.has(ArgValues.ID)) + { + structid = sv.get(ArgValues.ID); + } + else + { + structfile = likelyStructure.getValue(); + } + } } - if (subVals.has("structfile")) + else if (subVals.has("structfile")) + { + structfile = subVals.get("structfile"); + } + else if (subVals.has("structid")) + { + structid = subVals.get("structid"); + } + if (structfile != null) { Console.info("***** Attaching paeFile '" + paePath + "' to " + "structfile=" + subVals.get("structfile")); EBIAlfaFold.addAlphaFoldPAE(af.getCurrentView().getAlignment(), paeFile, subVals.getIndex(), subVals.get("structfile"), - true, false); + true, false, paeLabel); } - else if (subVals.has("structid")) + else if (structid != null) { Console.info("***** Attaching paeFile '" + paePath + "' to " + "structid=" + subVals.get("structid")); EBIAlfaFold.addAlphaFoldPAE(af.getCurrentView().getAlignment(), paeFile, subVals.getIndex(), subVals.get("structid"), - true, true); + true, true, paeLabel); } else { Console.debug("***** Attaching paeFile '" + paePath + "' to sequence index " + subVals.getIndex()); EBIAlfaFold.addAlphaFoldPAE(af.getCurrentView().getAlignment(), - paeFile, subVals.getIndex(), null, false, false); + paeFile, subVals.getIndex(), null, false, false, + paeLabel); // required to readjust the height and position of the pAE // annotation }