File tree Expand file tree Collapse file tree
biojava-core/src/main/java/org/biojava/nbio/core/util Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,4 +115,23 @@ public Sequence<?> getSequenceFromString(String sequence) throws CompoundNotFoun
115115
116116 }
117117
118+ /** A method to check whether an array of sequences contains at least two sequences having an equal length.
119+ *
120+ * @param sequences the array of {@link org.biojava.nbio.core.sequence.ProteinSequence} sequences
121+ * @return true if any two sequences are of an equal length
122+ */
123+ public static boolean equalLengthSequences (ProteinSequence [] sequences ) {
124+
125+ for (int i =0 ; i <sequences .length -1 ; i ++) {
126+ if (sequences [i ]==null )
127+ continue ;
128+ for (int j =i +1 ; j <sequences .length ; j ++) {
129+ if (sequences [j ]==null )
130+ continue ;
131+ if (sequences [i ].getLength () == sequences [j ].getLength ())
132+ return true ;
133+ }
134+ }
135+ return false ;
136+ }
118137}
You can’t perform that action at this time.
0 commit comments