X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FAlignmentI.java;h=f1db4c0eba8c3ba31ef4a25d3092056956185555;hb=8c7a9e1133d84d0d80db855f85b052a737c245f3;hp=de794880c09116107c838861ae269d082b49be84;hpb=4d7f98a6dd54d9863ba449ec79dcd95d25ed863d;p=jalview.git diff --git a/src/jalview/datamodel/AlignmentI.java b/src/jalview/datamodel/AlignmentI.java index de79488..f1db4c0 100755 --- a/src/jalview/datamodel/AlignmentI.java +++ b/src/jalview/datamodel/AlignmentI.java @@ -41,7 +41,8 @@ public interface AlignmentI extends AnnotatedCollectionI * * Calculates the maximum width of the alignment, including gaps. * - * @return Greatest sequence length within alignment. + * @return Greatest sequence length within alignment, or -1 if no sequences + * present */ @Override int getWidth(); @@ -305,7 +306,7 @@ public interface AlignmentI extends AnnotatedCollectionI * @return Alignment containing dataset sequences or null of this is a * dataset. */ - Alignment getDataset(); + AlignmentI getDataset(); /** * Set the associated dataset for the alignment, or create one. @@ -313,7 +314,7 @@ public interface AlignmentI extends AnnotatedCollectionI * @param dataset * The dataset alignment or null to construct one. */ - void setDataset(Alignment dataset); + void setDataset(AlignmentI dataset); /** * pads sequences with gaps (to ensure the set looks like an alignment) @@ -375,12 +376,12 @@ public interface AlignmentI extends AnnotatedCollectionI * * @return */ - Set getCodonFrames(); + List getCodonFrames(); /** - * Set the codon frame mappings (replacing any existing set). + * Set the codon frame mappings (replacing any existing list). */ - void setCodonFrames(Set acfs); + void setCodonFrames(List acfs); /** * get codon frames involving sequenceI @@ -524,4 +525,32 @@ public interface AlignmentI extends AnnotatedCollectionI * @return */ public boolean hasValidSequence(); + + /** + * Update any mappings to 'virtual' sequences to compatible real ones, if + * present in the added sequences. Returns a count of mappings updated. + * + * @param seqs + * @return + */ + int realiseMappings(List seqs); + + /** + * Returns the first AlignedCodonFrame that has a mapping between the given + * dataset sequences + * + * @param mapFrom + * @param mapTo + * @return + */ + AlignedCodonFrame getMapping(SequenceI mapFrom, SequenceI mapTo); + + /** + * Calculate the visible start and end index of an alignment. The result is + * returned an int array where: int[0] = startIndex, and int[1] = endIndex. + * + * @param hiddenCols + * @return + */ + public int[] getVisibleStartAndEndIndex(List hiddenCols); }