<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def count_missense_per_gene(lines):
 """ count the number of missense variants in each gene. """

    
    counts = {}
    for x in lines:
        x = x.split("\t")
        gene = x[0]
        consequence = x[3]
        
        if gene not in counts:
            counts[gene] = 0
        
        if consequence != "missense_variant":
            continue
        
        counts[gene] += 1
    
    return counts