Univariate fixed effects linear mixed model test for all SNPs

    Args:
        snps:   [N x S] SP.array of S SNPs for N individuals
        pheno:  [N x 1] SP.array of 1 phenotype for N individuals
        K:      [N x N] SP.array of LMM-covariance/kinship koefficients (optional)
                        If not provided, then linear regression analysis is performed
        covs:   [N x D] SP.array of D covariates for N individuals
        test:   'lrt' for likelihood ratio test (default) or 'f' for F-test
        NumIntervalsDelta0:  number of steps for delta optimization on the null model (100)
        NumIntervalsDeltaAlt:number of steps for delta optimization on the alt. model (0 - no optimization)
        searchDelta:     Carry out delta optimization on the alternative model? if yes We use NumIntervalsDeltaAlt steps

    Returns:
        limix LMM object

def simple_lmm(snps,pheno,K=None,covs=None, test='lrt',NumIntervalsDelta0=100,NumIntervalsDeltaAlt=0,searchDelta=False):
    """
    Univariate fixed effects linear mixed model test for all SNPs

    Args:
        snps:   [N x S] SP.array of S SNPs for N individuals
        pheno:  [N x 1] SP.array of 1 phenotype for N individuals
        K:      [N x N] SP.array of LMM-covariance/kinship koefficients (optional)
                        If not provided, then linear regression analysis is performed
        covs:   [N x D] SP.array of D covariates for N individuals
        test:   'lrt' for likelihood ratio test (default) or 'f' for F-test
        NumIntervalsDelta0:  number of steps for delta optimization on the null model (100)
        NumIntervalsDeltaAlt:number of steps for delta optimization on the alt. model (0 - no optimization)
        searchDelta:     Carry out delta optimization on the alternative model? if yes We use NumIntervalsDeltaAlt steps

    Returns:
        limix LMM object
    """
    t0=time.time()
    if K is None:
        K=SP.eye(snps.shape[0])
    lm = limix.CLMM()
    lm.setK(K)
    lm.setSNPs(snps)
    lm.setPheno(pheno)
    if covs is None:
        covs = SP.ones((snps.shape[0],1))
    lm.setCovs(covs)
    if test=='lrt':
        lm.setTestStatistics(0)
    elif test=='f':
        lm.setTestStatistics(1)
    else:
        print(test)
        raise NotImplementedError("only f or lrt are implemented")
    #set number of delta grid optimizations?
    lm.setNumIntervals0(NumIntervalsDelta0)
    if searchDelta:
        lm.setNumIntervalsAlt(NumIntervalsDeltaAlt)
    else:
        lm.setNumIntervalsAlt(0)
    lm.process()
    t1=time.time()
    print(("finished GWAS testing in %.2f seconds" %(t1-t0)))
    return lm