QuantitationTypeParameterGuesser { protected static ScaleType guessScaleType( String name, String description ) { for ( ScaleType type : QuantitationTypeParameterGuesser.scaleDescPatterns.keySet() ) { for ( String patt : QuantitationTypeParameterGuesser.scaleNamePatterns.get( type ) ) { if ( name.matches( patt ) ) { QuantitationTypeParameterGuesser.log.debug( "!!!!!name=" + name + " matched " + patt ); return type; } } for ( String patt : QuantitationTypeParameterGuesser.scaleDescPatterns.get( type ) ) { if ( description.toLowerCase().matches( patt ) ) { QuantitationTypeParameterGuesser.log .debug( "!!!!!description=" + description + " matched " + patt ); return type; } } } return ScaleType.LINEAR; }  static void guessQuantitationTypeParameters( QuantitationType qt, String name, String description ); static void guessQuantitationTypeParameters( QuantitationType qt, String name, String description,
            Object exampleValue );  }
@Test public void testgcrma() { ScaleType s = QuantitationTypeParameterGuesser.guessScaleType( "VALUE", "gcRMA-calculated Signal intensity" ); assertEquals( "got " + s, ScaleType.LOG2, s ); }
@Test public void testrma() { ScaleType s = QuantitationTypeParameterGuesser.guessScaleType( "VALUE", "Signals calculated by RMA" ); assertEquals( "got " + s, ScaleType.LOG2, s ); }
@Test public void testPercent() { String a = "%_>_B532+1SD"; String b = "percentage of feature pixels with intensities more than one standard deviation above the background pixel intensity, at wavelength #2 (532 nm, Cy3)"; ScaleType s = QuantitationTypeParameterGuesser.guessScaleType( a.toLowerCase(), b.toLowerCase() ); assertEquals( "got " + s, ScaleType.PERCENT, s ); }
@Test public void testMas5() { String a = "MAS5.0 signal intensity"; ScaleType guessScaleType = QuantitationTypeParameterGuesser.guessScaleType( "VALUE", a.toLowerCase() ); assertEquals( ScaleType.LOG2, guessScaleType ); a = "MAS 5.0 signal intensity"; guessScaleType = QuantitationTypeParameterGuesser.guessScaleType( "VALUE", a.toLowerCase() ); assertEquals( ScaleType.LOG2, guessScaleType ); }
@Test public void testMas6() { String a = "MAS 6.1 signal intensity"; ScaleType guessScaleType = QuantitationTypeParameterGuesser.guessScaleType( "VALUE", a.toLowerCase() ); assertEquals( ScaleType.LOG2, guessScaleType ); }