X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2Fvamsas%2FSequencemapping.java;h=92306ea6f10fc5211d9a61cd7f3180d50a4108d3;hb=838e4f91d4a53dd315640dbc9ff6ef7a815ee576;hp=6c31e45489b0e497e0a3aea06a3210c581674353;hpb=ad20cd92225f2ee8c251d39b00b90555d382a616;p=jalview.git diff --git a/src/jalview/io/vamsas/Sequencemapping.java b/src/jalview/io/vamsas/Sequencemapping.java index 6c31e45..92306ea 100644 --- a/src/jalview/io/vamsas/Sequencemapping.java +++ b/src/jalview/io/vamsas/Sequencemapping.java @@ -1,30 +1,34 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8) - * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b1) + * Copyright (C) 2015 The Jalview Authors * * This file is part of Jalview. * * Jalview is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. * * Jalview is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along with Jalview. If not, see . + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. */ package jalview.io.vamsas; -import java.util.Vector; - import jalview.datamodel.AlignedCodonFrame; +import jalview.datamodel.AlignmentI; import jalview.datamodel.Mapping; import jalview.datamodel.SequenceI; import jalview.gui.Desktop; import jalview.io.VamsasAppDatastore; -import uk.ac.vamsas.client.Vobject; + +import java.util.Vector; + import uk.ac.vamsas.objects.core.AlignmentSequence; import uk.ac.vamsas.objects.core.DataSet; import uk.ac.vamsas.objects.core.Sequence; @@ -280,12 +284,12 @@ public class Sequencemapping extends Rangetype jalview.bin.Cache.log.info("Ignoring non sequence-sequence mapping"); return; } - mobj = this.getvObj2jv((Vobject) sdloc); + mobj = this.getvObj2jv(sdloc); if (mobj instanceof SequenceI) { from = (SequenceI) mobj; } - mobj = this.getvObj2jv((Vobject) sdmap); + mobj = this.getvObj2jv(sdmap); if (mobj instanceof SequenceI) { to = (SequenceI) mobj; @@ -322,19 +326,17 @@ public class Sequencemapping extends Rangetype } // create mapping storage object and make each dataset alignment reference // it. - jalview.datamodel.AlignmentI dsLoc = (jalview.datamodel.AlignmentI) getvObj2jv(sdloc - .getV_parent()); - jalview.datamodel.AlignmentI dsMap = (jalview.datamodel.AlignmentI) getvObj2jv(sdmap - .getV_parent()); - AlignedCodonFrame afc = new AlignedCodonFrame(0); + AlignmentI dsLoc = (AlignmentI) getvObj2jv(sdloc.getV_parent()); + AlignmentI dsMap = (AlignmentI) getvObj2jv(sdmap.getV_parent()); + AlignedCodonFrame acf = new AlignedCodonFrame(); if (dsLoc != null && dsLoc != dsMap) { - dsLoc.addCodonFrame(afc); + dsLoc.addCodonFrame(acf); } if (dsMap != null) { - dsMap.addCodonFrame(afc); + dsMap.addCodonFrame(acf); } // create and add the new mapping to (each) dataset's codonFrame @@ -347,24 +349,23 @@ public class Sequencemapping extends Rangetype mapping = new jalview.util.MapList(mapping.getToRanges(), mapping.getFromRanges(), mapping.getToRatio(), mapping.getFromRatio()); - afc.addMap(to, from, mapping); + acf.addMap(to, from, mapping); } else { mapping = this.parsemapType(sequenceMapping, 3, 1); // correct sense - afc.addMap(from, to, mapping); + acf.addMap(from, to, mapping); } } else { mapping = this.parsemapType(sequenceMapping, 1, 1); // correct sense - afc.addMap(from, to, mapping); + acf.addMap(from, to, mapping); } bindjvvobj(mapping, sequenceMapping); jalview.structure.StructureSelectionManager - .getStructureSelectionManager(Desktop.instance).addMappings( - new AlignedCodonFrame[] - { afc }); + .getStructureSelectionManager(Desktop.instance) + .registerMapping(acf); // Try to link up any conjugate database references in the two sequences // matchConjugateDBRefs(from, to, mapping); // Try to propagate any dbrefs across this mapping.