X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FAlignment.java;h=5d1fc605e5339a83d29f620491c994125e974cf9;hb=7fef0501bb64f11080bdb93ee0824416d84784cc;hp=482df7fd0dd6f77f4b92c232132ecc8ef88f24fb;hpb=be32c14cd8e48fe0a207cd7030cb9cd46f894678;p=jalview.git diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index 482df7f..5d1fc60 100755 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@ -1664,8 +1664,8 @@ public class Alignment implements AlignmentI * identically. If this is nucleotide and the other is protein, make 3 gaps * for each gap in the protein sequences. If this is protein and the other is * nucleotide, insert a gap for each 3 gaps (or part thereof) between - * nucleotide bases. Does nothing if alignment of protein from cDNA is - * requested (not yet implemented). + * nucleotide bases. If this is protein and the other is nucleotide, gaps + * protein to match the relative ordering of codons in the nucleotide. * * Parameters control whether gaps in exon (mapped) and intron (unmapped) * regions are preserved. Gaps that connect introns to exons are treated @@ -1697,6 +1697,9 @@ public class Alignment implements AlignmentI { thisGapChar, thisGapChar, thisGapChar }) : String .valueOf(thisGapChar); + // TODO handle intron regions? Needs a 'holistic' alignment of dna, + // not just sequence by sequence. But how to 'gap' intron regions? + /* * Get mappings from 'that' alignment's sequences to this. */ @@ -1731,4 +1734,19 @@ public class Alignment implements AlignmentI } return names; } + + @Override + public boolean hasValidSequence() + { + boolean hasValidSeq = false; + for (SequenceI seq : getSequences()) + { + if ((seq.getEnd() - seq.getStart()) > 0) + { + hasValidSeq = true; + break; + } + } + return hasValidSeq; + } }