Rosemeis / pcangsd

Framework for analyzing low depth NGS data in heterogeneous populations using PCA.
GNU General Public License v3.0
47 stars 11 forks source link

Large log likelihood when running Admixture #42

Open bpbentley opened 3 years ago

bpbentley commented 3 years ago

Hi, I'm trying to run Admixture models on 93 samples from 12 populations with low coverage WGS data (~2.5X). I keep obtaining large log likelihoods with my models (see error output below), regardless of the number of clusters I specify. I'm wondering if this issue is related to the alpha parameter and whether you have any recommendations for overcoming the issue. I was also wondering whether PCAngsd chooses the best cluster (in this case 2), or whether I should manually change the -e parameter to find the best model. Thanks in advance!

CMD: pcangsd.py -beagle WGR_genolike.beagle.gz -o PCAngsd/PCAngsd_Admix_1 -admix -threads 12

OUTPUT:

PCAngsd 0.99
Using 12 thread(s)

Parsing Beagle file
Read 93 samples and 14799509 sites

Estimating population allele frequencies
EM (MAF) converged at iteration: 37

Number of sites after MAF filtering (0.05): 6716030

Estimating covariance matrix
Using 1 principal components (MAP test)
Individual allele frequencies estimated (1)
Individual allele frequencies estimated (2). RMSE=0.012125042712336699
Individual allele frequencies estimated (3). RMSE=0.006803430493124094
Individual allele frequencies estimated (4). RMSE=0.004412202439217441
Individual allele frequencies estimated (5). RMSE=0.0030777796331094777
Individual allele frequencies estimated (6). RMSE=0.0022284785501715796
Individual allele frequencies estimated (7). RMSE=0.0016532794225259115
Individual allele frequencies estimated (8). RMSE=0.0012516176107408487
Individual allele frequencies estimated (9). RMSE=0.0009655342259376956
Individual allele frequencies estimated (10). RMSE=0.0007572869552963836
Individual allele frequencies estimated (11). RMSE=0.0006025717936643836
Individual allele frequencies estimated (12). RMSE=0.0004854275458370586
Individual allele frequencies estimated (13). RMSE=0.0003948092350849922
Individual allele frequencies estimated (14). RMSE=0.00032341887796296975
Individual allele frequencies estimated (15). RMSE=0.0002665579824802005
Individual allele frequencies estimated (16). RMSE=0.00022081684410707382
Individual allele frequencies estimated (17). RMSE=0.00018362555288607658
Individual allele frequencies estimated (18). RMSE=0.00015319964916455978
Individual allele frequencies estimated (19). RMSE=0.00012824481266825643
Individual allele frequencies estimated (20). RMSE=0.00010786493498441993
Individual allele frequencies estimated (21). RMSE=9.104626561131682e-05
Individual allele frequencies estimated (22). RMSE=7.703825975166189e-05
Individual allele frequencies estimated (23). RMSE=6.551042967032681e-05
Individual allele frequencies estimated (24). RMSE=5.5945857529100416e-05
Individual allele frequencies estimated (25). RMSE=4.796783082055197e-05
Individual allele frequencies estimated (26). RMSE=4.134697805885276e-05
Individual allele frequencies estimated (27). RMSE=3.578257199705713e-05
Individual allele frequencies estimated (28). RMSE=3.114389032493644e-05
Individual allele frequencies estimated (29). RMSE=2.7280378942655907e-05
Individual allele frequencies estimated (30). RMSE=2.4057805916296904e-05
Individual allele frequencies estimated (31). RMSE=2.1381010208934295e-05
Individual allele frequencies estimated (32). RMSE=1.9141890817977677e-05
Individual allele frequencies estimated (33). RMSE=1.7305483135619078e-05
Individual allele frequencies estimated (34). RMSE=1.577383021424109e-05
Individual allele frequencies estimated (35). RMSE=1.450747334619664e-05
Individual allele frequencies estimated (36). RMSE=1.3455284435800226e-05
Individual allele frequencies estimated (37). RMSE=1.2564445482570965e-05
Individual allele frequencies estimated (38). RMSE=1.1829905551918776e-05
Individual allele frequencies estimated (39). RMSE=1.1230357040797214e-05
Individual allele frequencies estimated (40). RMSE=1.075095932478825e-05
Individual allele frequencies estimated (41). RMSE=1.0348805491107087e-05
Individual allele frequencies estimated (42). RMSE=1.0005293735513446e-05
Individual allele frequencies estimated (43). RMSE=9.707048626376353e-06
Estimation of individual allele frequencies has converged.
Saved covariance matrix as PCAngsd/PCAngsd_Admix_1.cov (Text)

Estimating admixture with K=2, alpha=0, batch=10, seed=0
CSG-MU (1). Q-RMSD=0.23003634606194107
CSG-MU (2). Q-RMSD=0.3657899191186353
CSG-MU (3). Q-RMSD=0.012140579549417146
CSG-MU (4). Q-RMSD=0.0037096703859644527
CSG-MU (5). Q-RMSD=0.0016998998578658827
CSG-MU (6). Q-RMSD=0.0008089785511783004
CSG-MU (7). Q-RMSD=0.0003895714532236838
CSG-MU (8). Q-RMSD=0.00017399693325733872
CSG-MU (9). Q-RMSD=8.839517026721135e-05
CSG-MU (10). Q-RMSD=4.9776962626971535e-05
CSG-MU (11). Q-RMSD=3.0899671385856e-05
CSG-MU (12). Q-RMSD=1.822368150699407e-05
CSG-MU (13). Q-RMSD=1.0683020971030214e-05
CSG-MU (14). Q-RMSD=6.42539956215387e-06
CSG-MU has converged.
Frobenius error: 98.3790898133338
Log-likelihood: -489208450.0
Saved admixture proportions as PCAngsd/PCAngsd_Admix_1.admix.Q.npy (Binary)

Best, Blair

Rosemeis commented 3 years ago

Hi Blair,

Yeah, if you have 12 populations then I would try and tweak the -e parameter manually. If possible then you can set it to the e=K-1, where K is the number of expected distinct populations. Alpha shouldn't due too much expect smoothing admixture proportions.

Let me know if you have any further questions. :-)

Best, Jonas

bpbentley commented 3 years ago

Hi Jonas,

Thanks very much for the swift response! That makes sense, I'll run through the clusters manually. I appreciate the help!

Best, Blair