From: gmungoc Date: Wed, 20 Jul 2016 09:00:24 +0000 (+0100) Subject: JAL-2023 avoid writing / loading empty mappings X-Git-Tag: Release_2_10_0~125^2~11 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e713e4d4d002a8d5a468d3c30da6d714994b45c5;p=jalview.git JAL-2023 avoid writing / loading empty mappings --- diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index ac85aad..1633a5d 100644 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -898,10 +898,10 @@ public class Jalview2XML for (AlignedCodonFrame acf : jac) { AlcodonFrame alc = new AlcodonFrame(); - vamsasSet.addAlcodonFrame(alc); if (acf.getProtMappings() != null && acf.getProtMappings().length > 0) { + boolean hasMap = false; SequenceI[] dnas = acf.getdnaSeqs(); jalview.datamodel.Mapping[] pmaps = acf.getProtMappings(); for (int m = 0; m < pmaps.length; m++) @@ -911,6 +911,11 @@ public class Jalview2XML alcmap.setMapping(createVamsasMapping(pmaps[m], dnas[m], null, false)); alc.addAlcodMap(alcmap); + hasMap = true; + } + if (hasMap) + { + vamsasSet.addAlcodonFrame(alc); } } // TODO: delete this ? dead code from 2.8.3->2.9 ? @@ -2855,8 +2860,8 @@ public class Jalview2XML mapping }); } } + al.addCodonFrame(cf); } - al.addCodonFrame(cf); } }