import jalview.datamodel.SearchResults;
import jalview.datamodel.SequenceI;
import jalview.io.AppletFormatAdapter;
-import jalview.io.SiftsClient;
import jalview.util.MappingUtils;
import jalview.util.MessageManager;
+import jalview.ws.sifts.SiftsClient;
+import jalview.ws.sifts.SiftsException;
import java.io.PrintStream;
import java.util.ArrayList;
if (isMapViaSIFTs)
{
SiftsClient siftsClient = new SiftsClient(pdb.id);
- seqToStrucMapping = siftsClient.getSiftsStructureMapping(seq,
- pdbFile, maxChainId);
- // TODO if SIFTs mapping fails.. then fallback to NW alignment
+ try
+ {
+ seqToStrucMapping = siftsClient.getSiftsStructureMapping(seq,
+ pdbFile, maxChainId);
+ } catch (SiftsException e)
+ {
+ System.err
+ .println(">>>>>>> SIFTs mapping could not be obtained... Now mapping with NW alignment");
+ seqToStrucMapping = getNWMappings(seq, pdbFile, maxChainId,
+ maxChain, pdb, maxAlignseq);
+ }
}
else
{
AlignSeq maxAlignseq)
{
final StringBuilder mappingDetails = new StringBuilder(128);
+ mappingDetails.append(NEWLINE).append("PDB Sequence is :")
+ .append(NEWLINE).append("Sequence = ")
+ .append(maxChain.sequence.getSequenceAsString());
+ mappingDetails.append(NEWLINE).append("No of residues = ")
+ .append(maxChain.residues.size()).append(NEWLINE)
+ .append(NEWLINE);
PrintStream ps = new PrintStream(System.out)
{
@Override
};
maxAlignseq.printAlignment(ps);
+
+ mappingDetails.append(NEWLINE).append("PDB start/end ");
+ mappingDetails.append(String.valueOf(maxAlignseq.seq2start))
+ .append(" ");
+ mappingDetails.append(String.valueOf(maxAlignseq.seq2end));
+ mappingDetails.append(NEWLINE).append("SEQ start/end ");
+ mappingDetails.append(
+ String.valueOf(maxAlignseq.seq1start + (seq.getStart() - 1)))
+ .append(" ");
+ mappingDetails.append(String.valueOf(maxAlignseq.seq1end
+ + (seq.getStart() - 1)));
+ mappingDetails.append(NEWLINE);
+ mappingDetails
+ .append("Mapping inferred with Needleman & Wunsch alignment");
+ mappingDetails.append(NEWLINE);
maxChain.makeExactMapping(maxAlignseq, seq);
jalview.datamodel.Mapping sqmpping = maxAlignseq
.getMappingFromS1(false);