{
boolean failedtoadd = true;
// expect
- // STRUCTMODEL <TemplateSeqId> <TemplateFileName> <Confidence> <%.I.D>
+ // STRUCTMODEL <TemplateSeqId> <ModelFile> <FastaMappingFile>
+ // <Confidence> <%.I.D>
// <MatchStart> <MatchEnd> <Coverage> [<Other Information>]
if (st.hasMoreTokens()) {
refSeq = al.findName(refSeqId = st.nextToken());
else
{
String tempId = st.nextToken();
+ String fastaMapping = st.nextToken();
String confidence = 100 * Double.valueOf(st.nextToken()) + "";
String pid = st.nextToken();
String alignRange = st.nextToken() + "-" + st.nextToken();
String otherInfo = st.hasMoreTokens() ? st.nextToken() : "";
String coverage = "";
- if (add_structmodel(al, refSeq, tempId, alignRange, coverage,
+ if (add_structmodel(al, refSeq, tempId, fastaMapping,
+ alignRange, coverage,
confidence, pid, otherInfo))
{
failedtoadd = false;
if (failedtoadd)
{
System.err
- .println("Need <TemplateSeqId> <TemplateFileName> <Confidence> <%.I.D> <MatchStart> <MatchEnd> <Coverage> [<Other Information>] as tab separated fields after"
+ .println("Need <TemplateSeqId> <ModelFile> <FastaMappingFile> <Confidence> <%.I.D> <MatchStart> <MatchEnd> <Coverage> [<Other Information>] as tab separated fields after"
+ STRUCTMODEL
+ ".\nNote: other information could be provided in html format ");
} else {
* @return true if model and sequence was added
*/
private boolean add_structmodel(AlignmentI al, SequenceI refSeq,
- String tempId, String aRange, String coverage, String confidence,
+ String modelFile, String fastaFile, String aRange,
+ String coverage, String confidence,
String pid, String otherInfo)
{
String warningMessage = null;
boolean added = false;
try {
- String pdbFile = baseUri + tempId;
- PDBEntry phyre2PDBEntry = new PDBEntry(tempId, null, Type.FILE,
- pdbFile);
- refSeq.getDatasetSequence().addPDBId(phyre2PDBEntry);
+ String structureModelFile = resolveAbsolute(modelFile);
+ String fastaMappingFile = resolveAbsolute(fastaFile);
+ // System.out.println("Model File >> " + fastaMappingFile);
+ // System.out.println("Fasta File >> " + structureModelFile);
+ PDBEntry phyre2PDBEntry = new PDBEntry(modelFile, null, Type.FILE,
+ structureModelFile);
String phyre2ModelDesc = generatePhyre2InfoHTMLTable(aRange,
coverage, confidence, pid, otherInfo);
- refSeq.setDescription(phyre2ModelDesc);
+ phyre2PDBEntry.setProperty("PHYRE2_MODEL_INFO", phyre2ModelDesc);
+ refSeq.getDatasetSequence().addPDBId(phyre2PDBEntry);
StructureSelectionManager ssm = StructureSelectionManager
.getStructureSelectionManager(Desktop.instance);
- ssm.registerPhyre2Template(pdbFile);
+ ssm.registerPhyre2Template(structureModelFile, fastaMappingFile);
added = true;
} catch (Exception x)