Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the R language pack LEA that can be used for structure?

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

In this issue, the editor will bring you about the R language package LEA that can be used to do structure. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

Regarding the grouping software, previously wrote the structure 2.3.4 software use guide, although the software has the windows version, but the operation is too troublesome, also wrote the Admixture use instruction document cookbook, but only the Linux version, it is difficult to use. Can't you use R for structure drawing? Here comes the result: LEA!

1. Paper

LEA: An R package for landscape and ecological association studies

Use instruction document

Use LEA for data in different formats

two。 Software introduction

This short tutorial explains how population structure analyses reproducing the results of the widely-used computer program structure can be performed using commands in the R language. The method works for any operating systems, and it does not require the installation

Of structure or additional computer programs. The R program allows running population structure inference algorithms, choosing the number of clusters, and showing admixture coefficient bar-plots using a few commands. The methods used by R are fast and accurate, and they

Are free of standard population genetic equilibrium hypotheses. In addition, these methods allow their users to play with a large panel of graphical functions for displaying pie-charts and interpolated admixture coefficients on geographic maps.

Highlight:

The function of software Structure can be realized in R language.

You can make a picture similar to admixture.

Simple operation, several commands to achieve related functions

C language development, can deal with big data

3. Software installation install.packages (c ("fields", "RColorBrewer", "mapplots"))

Source ("http://bioconductor.org/biocLite.R")"

BiocLite ("LEA")

If the installation is not successful, you can also download the package locally through CRAN to install:

Install.packages ("LEA_1.4.0_tar.gz", repos = NULL, type = "source")

Load two functions for format conversion and visualization:

Source ("http://membres-timc.imag.fr/Olivier.Francois/Conversion.R")"

Source ("http://membres-timc.imag.fr/Olivier.Francois/POPSutilities.R")4." test data

Ped files in plink format, specific format reference: ped and map files in plink format and the method of conversion to 012

1 SAMPLE0 0 0 2 2 1 2 3 3 1 1 2 1

2 SAMPLE1 0 0 1 2 2 1 1 3 0 4 1 1

3 SAMPLE2 0 0 2 1 2 2 3 3 1 4 1 1

The first six are listed as follows:

Pedigree ID

Individual ID

Male parent

Female parent

Gender

Tabular value

SNP1-1 (the first site of SNP1)

SNP1-2 (the second site of SNP)

The test data takes the sample data of admixture and is converted into a ped file using plink.

Library (LEA)

# the result will generate data from the test.geno file.

Output = ped2lfmm ("test.ped") # use LEA for structure analysis

Library (LEA)

Obj.snmf = snmf ("test.geno", K = 3, alpha = 100, project = "new")

Qmatrix = Q (obj.snmf, K = 3)

Head (qmatrix)

Barplot (t (qmatrix), col = rainbow (3), border = NA, space = 0

Xlab = "Individuals", ylab = "Admixture coefficients")

Compare the results of admixture

# compare admixture results

Qad = read.table ("test.3.Q")

Head (qad)

Barplot (t (qad), col = rainbow (3), border = NA, space = 0

Xlab = "Individuals", ylab = "Admixture coefficients")

5. Use snmf to select the optimal K value # to draw a broken line chart and select the optimal K value.

Plot (project, col = "blue", pch = 19, cex = 1.2)

As you can see, when Knights 3, it is the smallest, so choose Knights 3.

This is what the editor shares with you about the R language package LEA that can be used to do structure. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report