@merge(summarizeAllelesPerGene, "effects.genematrix" )
def buildGeneMatrixEffects( infiles, outfile ):

    analysis = ( ("benign", "benign" ),
                 ( "probablydamaging", "probablydamaging" ),
                 ( "possiblydamaging", "possiblydamaging" ),
                 ( "unknown", "unknown") )
    
    tracks = [ x[:-len("_alleles_genes.load")] for x in infiles ]

    statement = '''
            SELECT DISTINCT i.gene_id 
            FROM
            transcript_info AS i,
            polyphen_map AS map,
            polyphen_HumVar as polyphen
            WHERE 
            polyphen.snp_id = map.snp_id AND
            map.track = '%(track)s' AND
            map.transcript_id = i.transcript_id AND
            prediction = '%(field_where)s' '''

    buildGeneMatrix( tracks, analysis, statement, outfile )

####################################################################
Executes the given construct and returns a :class:`.ResultProxy`.
dataset/ETHPy150Open CGATOxford/cgat/obsolete/pipeline_snps.py/buildGeneMatrixEffects--crossover with--dataset/ETHPy150Open RoseOu/flasky/venv/lib/python2.7/site-packages/sqlalchemy/engine/interfaces.py/Connectable.execute