From 2ec1365eda085f8e21a8faa384c67c136774b599 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Mon, 27 Feb 2023 09:47:23 +0000 Subject: [PATCH] JAL-629 removed debug prints. added .cif. added some comments/code-markers --- src/jalview/bin/Commands.java | 14 ++++++++++++++ src/jalview/gui/StructureChooser.java | 20 +++++++++++++++++++- src/jalview/ws/dbsources/EBIAlfaFold.java | 24 ------------------------ 3 files changed, 33 insertions(+), 25 deletions(-) diff --git a/src/jalview/bin/Commands.java b/src/jalview/bin/Commands.java index 7a6e3ac..f8481f5 100644 --- a/src/jalview/bin/Commands.java +++ b/src/jalview/bin/Commands.java @@ -384,6 +384,20 @@ public class Commands Console.debug("Using structure file (from argument) '" + structureFile.getAbsolutePath() + "'"); } + + // TRY THIS + /* + PDBEntry fileEntry = new AssociatePdbFileWithSeq() + .associatePdbWithSeq(selectedPdbFileName, + DataSourceType.FILE, selectedSequence, true, + Desktop.instance); + + sViewer = launchStructureViewer(ssm, new PDBEntry[] { fileEntry }, + ap, new SequenceI[] + { selectedSequence }); + + */ + /* THIS DOESN'T WORK */ else if (seq.getAllPDBEntries() != null && seq.getAllPDBEntries().size() > 0) diff --git a/src/jalview/gui/StructureChooser.java b/src/jalview/gui/StructureChooser.java index 47bec31..11e50db 100644 --- a/src/jalview/gui/StructureChooser.java +++ b/src/jalview/gui/StructureChooser.java @@ -725,7 +725,9 @@ public class StructureChooser extends GStructureChooser private String guessPAEFilename() { - if (selectedPdbFileName.toLowerCase(Locale.ROOT).endsWith(".pdb")) + if (selectedPdbFileName.toLowerCase(Locale.ROOT).endsWith(".pdb") + || selectedPdbFileName.toLowerCase(Locale.ROOT) + .endsWith(".cif")) { String jsonExt = selectedPdbFileName.substring(0, selectedPdbFileName.length() - 4) + ".json"; @@ -1260,6 +1262,22 @@ public class StructureChooser extends GStructureChooser .associatePdbWithSeq(selectedPdbFileName, DataSourceType.FILE, selectedSequence, true, Desktop.instance); + /* LOOK AT + public PDBEntry associatePdbWithSeq(String choice, DataSourceType file, + SequenceI sequence, boolean prompt, + StructureSelectionManagerProvider ssmp) + IN AssociatePdbFileWithSeq */ + + // DO SOMETHING WITH + if (StructureChooser.this.localPdbPaeMatrixFileName != null) + { + + } + if (StructureChooser.this.combo_tempFacAs + .getSelectedItem() != null) + { + + } sViewer = launchStructureViewer(ssm, new PDBEntry[] { fileEntry }, ap, new SequenceI[] diff --git a/src/jalview/ws/dbsources/EBIAlfaFold.java b/src/jalview/ws/dbsources/EBIAlfaFold.java index b3bcfd9..4ed28fc 100644 --- a/src/jalview/ws/dbsources/EBIAlfaFold.java +++ b/src/jalview/ws/dbsources/EBIAlfaFold.java @@ -292,14 +292,8 @@ public class EBIAlfaFold extends EbiFileRetrievedProxy if (ssm != null) { String structFile = isStructId ? ssm.findFileForPDBId(id) : id; - Console.debug("##### AHA! structFile = " + structFile); - Console.debug("##### structFile " - + (ssm.isPDBFileRegistered(structFile) ? "IS " : "is NOT ") - + "registered."); StructureMapping[] smArray = ssm.getMapping(structFile); - Console.debug("##### AHA! smArray obtained with " + smArray.length - + " elements"); try { @@ -368,24 +362,10 @@ public class EBIAlfaFold extends EbiFileRetrievedProxy String seqId) throws IOException, ParseException { SequenceI sequence = null; - /* debugging */ - SequenceI[] seqs = pdbAlignment.getSequencesArray(); - if (seqs == null) - Console.debug("******* sequences is null"); - else - { - for (int i = 0; i < seqs.length; i++) - { - SequenceI s = seqs[i]; - } - } - /* end debug */ if (seqId == null) { int seqToGet = index > 0 ? index : 0; sequence = pdbAlignment.getSequenceAt(seqToGet); - Console.debug("***** Got sequence at index " + seqToGet + ": " - + (sequence == null ? null : sequence.getName())); } if (sequence == null) { @@ -406,7 +386,6 @@ public class EBIAlfaFold extends EbiFileRetrievedProxy JSONObject paeDict = null; if (paeJson instanceof JSONObject) { - Console.debug("***** paeJson is a JSONObject"); paeDict = (JSONObject) paeJson; } else if (paeJson instanceof JSONArray) @@ -435,13 +414,10 @@ public class EBIAlfaFold extends EbiFileRetrievedProxy throws IOException, ParseException { boolean someDone = false; - Console.debug("##### smArray.length=" + smArray.length); for (StructureMapping sm : smArray) { - Console.debug("##### sm[n]=" + sm.getPdbId()); boolean thisDone = importPaeJSONAsContactMatrixToStructure(sm, paeInput); - Console.debug("##### thisDone = " + thisDone); someDone |= thisDone; } return someDone; -- 1.7.10.2