@transform(orthologGroupsWithFeature, suffix(".load"), ".export") 
def exportConservedGeneListPerSpecies( infile, outfile):
    
    species_list = P.asList(PARAMS["species"])
    ensembl_version = PARAMS["orthology_ensembl_version"]
    
    # Get gene list from database
    dbhandle = sqlite3.connect( PARAMS["database"] )
    for species in species_list:
        cc = dbhandle.cursor()
        statement = '''SELECT distinct g.gene_id
                       FROM ortholog_groups g, ortholog_groups_with_feature f
                       WHERE f.set_id=g.set_id
                       AND f.species_count=6
                       AND g.schema LIKE "cgat_%(species)s%%"''' % locals()
        cc.execute( statement )
        
        # Write to file
        outfilename = species + ".conserved.export"
        outs = open( outfilename, "w")
        for result in cc:
            pre = ""
            for r in result:
              outs.write("%s%s" % (pre, str(r)) )
              pre = "\t"
            outs.write("\n")
        cc.close()
        outs.close()
        
    statement = "touch %s" % outfile
    P.run()

############################################################
Returns (codename, name) for all permissions in the given opts.
dataset/ETHPy150Open CGATOxford/cgat/obsolete/pipeline_species_conservation.py/exportConservedGeneListPerSpecies--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/contrib/auth/management/__init__.py/_get_all_permissions