import static jalview.io.gff.GffConstants.CLINICAL_SIGNIFICANCE;
+import jalview.commands.RemoveGapColCommand;
import jalview.datamodel.AlignedCodon;
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.AlignedCodonFrame.SequenceToSequenceMapping;
}
/**
- * Computes non-synonymous peptide variants from codon variants and adds them
- * as sequence_variant features on the protein sequence (one feature per
- * allele variant). Selected attributes (variant id, clinical significance)
- * are copied over to the new features.
+ * Computes non-synonymous peptide variants from codon variants and adds them as
+ * sequence_variant features on the protein sequence (one feature per allele
+ * variant). Selected attributes (variant id, clinical significance) are copied
+ * over to the new features.
*
* @param peptide
- * the protein sequence
+ * the protein dataset (ungapped) sequence
* @param peptidePos
- * the position to compute peptide variants for
+ * the position to compute peptide variants for
* @param codonVariants
- * a list of dna variants per codon position
+ * a list of dna variants per codon position
* @return the number of features added
*/
static int computePeptideVariants(SequenceI peptide, int peptidePos,
*/
public static int alignAs(AlignmentI unaligned, AlignmentI aligned)
{
+ /*
+ * easy case - aligning a copy of aligned sequences
+ */
+ if (alignAsSameSequences(unaligned, aligned))
+ {
+ return unaligned.getHeight();
+ }
+
+ /*
+ * fancy case - aligning via mappings between sequences
+ */
List<SequenceI> unmapped = new ArrayList<>();
Map<Integer, Map<SequenceI, Character>> columnMap = buildMappedColumnsMap(
unaligned, aligned, unmapped);
* - 'guide' alignment containing sequences derived from same
* dataset as unaligned
* @return
- * @deprecated probably obsolete and incomplete
*/
- @Deprecated
static boolean alignAsSameSequences(AlignmentI unaligned,
AlignmentI aligned)
{
}
}
+ /*
+ * finally remove gapped columns (e.g. introns)
+ */
+ new RemoveGapColCommand("", unaligned.getSequencesArray(), 0,
+ unaligned.getWidth() - 1, unaligned);
+
return true;
}