X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fstructure%2FStructureSelectionManager.java;h=0f82650c2226e3a7acf0e9313fc5a59fbdcf7c8c;hb=9bfda76754fb426a471e1c12c9f0ca0c4c1784bc;hp=6761cc3337c5121e8d64977bd14c77046458488a;hpb=2dc7f485be2afd841461e5eafc71dee47b44f14a;p=jalview.git diff --git a/src/jalview/structure/StructureSelectionManager.java b/src/jalview/structure/StructureSelectionManager.java index 6761cc3..0f82650 100644 --- a/src/jalview/structure/StructureSelectionManager.java +++ b/src/jalview/structure/StructureSelectionManager.java @@ -26,10 +26,12 @@ import java.util.Arrays; import java.util.Collections; import java.util.Enumeration; import java.util.HashMap; +import java.util.HashSet; import java.util.IdentityHashMap; import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.Set; import java.util.Vector; import jalview.analysis.AlignSeq; @@ -522,32 +524,15 @@ public class StructureSelectionManager { ds = ds.getDatasetSequence(); } - + List putativePDBe = PDBEntryUtils.selectPutativePDBe(seq,ds, pdb); + if (targetChainIds != null && targetChainIds[s] != null) { infChain = false; targetChainId = targetChainIds[s]; } - else if (seq.getName().indexOf("|") > -1) - { - targetChainId = seq.getName() - .substring(seq.getName().lastIndexOf("|") + 1); - if (targetChainId.length() > 1) - { - if (targetChainId.trim().length() == 0) - { - targetChainId = " "; - } - else - { - // not a valid chain identifier - targetChainId = ""; - } - } - } - else - { - targetChainId = ""; + else { + targetChainId = PDBEntryUtils.inferChainId(seq); } /* @@ -567,6 +552,12 @@ public class StructureSelectionManager { continue; // don't try to map chains don't match. } + PDBEntry putativeChain = null; + if (!putativePDBe.isEmpty() && (putativeChain = PDBEntryUtils + .selectPutativePDBEntry(putativePDBe, chain)) == null) + { + continue; + } // TODO: correctly determine sequence type for mixed na/peptide // structures final String type = chain.isNa ? AlignSeq.DNA : AlignSeq.PEP; @@ -673,7 +664,7 @@ public class StructureSelectionManager // Not doing SIFTS, or SIFTS failed for some reason. // first check if we should use an identity mapping - if (idLengthChain != null && maxAlignseq.getS2Coverage() < 0.5) + if (idLengthChain != null && maxAlignseq.getS2Coverage() < 0.75) { Console.info( "Assuming 3Dsi identity mapping between structure and sequence"); @@ -685,6 +676,11 @@ public class StructureSelectionManager } else { + if (maxAlignseq.getS1Coverage()<0.15 && maxAlignseq.getS2Coverage()<0.15) + { + // skip this - the NW alignment is spurious + continue; + } // Construct a needleman wunsch mapping instead. if (progress != null) {