In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail the simple analysis of how to draw Manhattan in R language ggplot2. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
Manhattan chart is often used in GWAS data analysis. There are special packages and functions in R language to generate Manhattan map directly. But if we have the data, we can use ggplot2 to do it ourselves.
The data for making a Manhattan map is usually in the following format
The first column of image.png is a name corresponding to SNP, the second column is the chromosome number, the third column is the position of SNP on the chromosome, and the fourth column is a P value corresponding to the feature. If there are multiple features, it can be arranged in the back row.
The Manhattan diagram can be understood as a scatter chart of x corresponding to multiple y, and the function in ggplot2 to do this is geom_jitter ().
The dataset used today is from the pig60K dataset in the rMVP package.
The first step is to get the dataset library (rMVP)
Data ('pig60K')
Use ggplot2 to draw library (ggplot2)
Ggplot (pig60K,aes (xylene Chromosome)) +
Geom_jitter ()
Image.png fills the color ggplot according to different chromosomes (pig60K,aes (xonal Chromosome journal yearly trait1)) +
Geom_jitter (aes (color=Chromosome))
The legend on the right side of image.png can be left out, and the ggplot (pig60K,aes (XeroChromosomeJournal yearly trait1)) +
Geom_jitter (aes (color=Chromosome)) +
Theme (legend.position = "none")
Image.png can see from the graph that there is only one point corresponding to the Y chromosome. You can remove the Y corresponding data from the original data and use the filter () function library (dplyr) in the dplyr package.
Df
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.