QuantitationTypeParameterGuesser { protected static StandardQuantitationType guessType( String name, String description ) { for ( StandardQuantitationType type : QuantitationTypeParameterGuesser.typeDescPatterns.keySet() ) { boolean isQuant = type == StandardQuantitationType.AMOUNT || type == StandardQuantitationType.COUNT; if ( isQuant && !QuantitationTypeParameterGuesser.maybeDerivedSignal( name ) ) { continue; } else if ( isQuant && !QuantitationTypeParameterGuesser.maybeMeasuredSignal( name ) ) { continue; } for ( String patt : QuantitationTypeParameterGuesser.typeNamePatterns.get( type ) ) { QuantitationTypeParameterGuesser.log.debug( "name=" + name + " test " + patt ); if ( name.matches( patt ) ) { QuantitationTypeParameterGuesser.log.debug( "!!!!!name=" + name + " matched " + patt ); return type; } } for ( String patt : QuantitationTypeParameterGuesser.typeDescPatterns.get( type ) ) { QuantitationTypeParameterGuesser.log.debug( "description=" + description + " test " + patt ); if ( description.matches( patt ) ) { QuantitationTypeParameterGuesser.log .debug( "!!!!!description=" + description + " matched " + patt ); return type; } } } return StandardQuantitationType.AMOUNT; }  static void guessQuantitationTypeParameters( QuantitationType qt, String name, String description ); static void guessQuantitationTypeParameters( QuantitationType qt, String name, String description,
            Object exampleValue );  }
@Test public void testAbsCall() { String a = "ABS CALL"; String b = "the call in an absolute analysis that indicates if the transcript was present (P), absent (A), marginal (M), or reverse present (RP)"; StandardQuantitationType s = QuantitationTypeParameterGuesser.guessType( a.toLowerCase(), b.toLowerCase() ); assertEquals( StandardQuantitationType.PRESENTABSENT, s ); }
@Test public void testareaCall() { String a = "AREA"; String b = "Number of pixels used to calculate a feature's intensity"; StandardQuantitationType s = QuantitationTypeParameterGuesser.guessType( a.toLowerCase(), b.toLowerCase() ); assertEquals( "got " + s, StandardQuantitationType.OTHER, s ); }
@Test public void testbkdst() { String a = "CH2_BKD_ SD"; String b = "NChannel 2 background standard deviation"; StandardQuantitationType s = QuantitationTypeParameterGuesser.guessType( a.toLowerCase(), b.toLowerCase() ); assertEquals( "got " + s, StandardQuantitationType.CONFIDENCEINDICATOR, s ); }
@Test public void testRatio() { String a = "RAT1_MEAN"; String b = "ratio of CH1D_MEAN to CH2D_MEAN"; StandardQuantitationType s = QuantitationTypeParameterGuesser.guessType( a.toLowerCase(), b.toLowerCase() ); assertEquals( "got " + s, StandardQuantitationType.AMOUNT, s ); }