import random


def getsimulatedgenereadcounts(numgenes,numreads):
    """
    Computes number of simulated reads for all genes
    input:
        numgenes=total number of genes for which reads are generated
        numreads==total number of reads generated
    output:
        a list of size numgenes containing the number of reads for each gene
    """
    # empirical parameters 
    lognormmu=3.4
    lognormsigma=0.95
    lornormrange=[0.1,5.1]
    
    logreadstemp1=[random.gauss(lognormmu,lognormsigma) for i in range(2*numgenes)]
    logreadstemp2=[x for x in logreadstemp1 if x>lornormrange[0] and x<lornormrange[1]]
    logreads=random.sample(logreadstemp2,numgenes)
    reads=[pow(10,x) for x in logreads]
    genereads=[int(x*numreads/sum(reads)) for x in reads]
    
    return genereads