public final static int getNumberOfInvalidChar ( String sequence , Set < Character > cSet , boolean ignoreCase ) { int total = 0 ; char [ ] cArray ; if ( ignoreCase ) cArray = sequence . toUpperCase ( ) . toCharArray ( ) ; else cArray = sequence . toCharArray ( ) ; if ( cSet == null ) cSet = PeptideProperties . standardAASet ; for ( char c : cArray ) { if ( ! cSet . contains ( c ) ) total ++ ; } return total ; }
Return the number of invalid characters in sequence .