+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ 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.
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
package jalview.io.gff;
+import java.util.Locale;
+
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.MappingType;
SequenceI mapFromSequence = seq;
SequenceI mapToSequence = mappedSequence;
if ((type == MappingType.NucleotideToPeptide && featureIsOnTarget)
- || (type == MappingType.PeptideToNucleotide && !featureIsOnTarget))
+ || (type == MappingType.PeptideToNucleotide
+ && !featureIsOnTarget))
{
mapFromSequence = mappedSequence;
mapToSequence = seq;
{
fromStart = alignToStart;
toStart = alignFromStart;
- toEnd = forwardStrand ? toStart + alignCount - 1 : toStart
- - (alignCount - 1);
+ toEnd = forwardStrand ? toStart + alignCount - 1
+ : toStart - (alignCount - 1);
int toLength = Math.abs(toEnd - toStart) + 1;
int fromLength = toLength * type.getFromRatio() / type.getToRatio();
fromEnd = fromStart + fromLength - 1;
// e.g. exonerate:protein2genome:local
if (model != null)
{
- String mdl = model.toLowerCase();
+ String mdl = model.toLowerCase(Locale.ROOT);
if (mdl.contains(PROTEIN2DNA) || mdl.contains(PROTEIN2GENOME)
|| mdl.contains(CODING2CODING) || mdl.contains(CODING2GENOME)
|| mdl.contains(CDNA2GENOME) || mdl.contains(GENOME2GENOME))
return false;
}
+ /**
+ * An override to set feature group to "exonerate" instead of the default GFF
+ * source value (column 2)
+ */
@Override
protected SequenceFeature buildSequenceFeature(String[] gff,
Map<String, List<String>> set)
{
- SequenceFeature sf = super.buildSequenceFeature(gff, set);
- sf.setFeatureGroup("exonerate");
+ SequenceFeature sf = super.buildSequenceFeature(gff, TYPE_COL,
+ "exonerate", set);
return sf;
}