def outputAnnotations( result, options ):

    mali = Mali.Mali()

    mali.readFromFile( result.getData(), format="stockholm" )
    annotation = mali.getAnnotation( "STATE" )
    
    l,c,f = 0, None, []
    for x in annotation:
        if x != c:
            if c: f.append( "%s:%i" % (c,l) )
            c = x
            l = 0
        l += 1
        
    f.append( "%s:%i" % (c,l) )

    options.stdout.write( "\t%s" % ",".join(f))

##-----------------------------------------------------------------------------------
##-----------------------------------------------------------------------------------
##-----------------------------------------------------------------------------------
output the annotations in the model.
dataset/ETHPy150Open CGATOxford/cgat/obsolete/xrate_blocks.py/outputAnnotations