In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "how to draw a Manhattan in big data". The content is simple and clear. I hope it can help you solve your doubts. Next, let the editor lead you to study and learn the article "how to draw a Manhattan in big data".
The Manhattan map is named because of its shape and is very similar to the rows of buildings in Manhattan, New York City. Manhattan has the largest number of skyscrapers, and the landmarks are as follows.
The picture of Manhattan is shown below.
Each chromosome can be thought of as a tall building, and the whole looks like a skyscraper in Manhattan, so it is called a Manhattan map.
Now that you know the name of the Manhattan map, let's take a look at the information it shows. As can be seen from the above picture, the x-axis of the Manhattan diagram is the position of the snp locus on the chromosome, and the y-axis is the p value corresponding to the SNP locus. In essence, it belongs to scatter plot. With the coordinates of the x-axis and y-axis, anyone can draw a scatter plot, so why doesn't the Manhattan map look so simple?
The secret lies in the chromosome position of the SNP locus. For different chromosomes, the marker position is counted from 1. For example, the 12bp of chromosomes 1 and 2 corresponds to two snp loci. Through the combination of chromosome and location information, the location of snp loci can be uniquely characterized.
However, when drawing a scatter plot, the x-axis can only be represented by one numerical value. In the Manhattan diagram, the chromosomes are arranged linearly, the position of chromosome 1 remains unchanged, and the position of chromosome 2 is added to the original total length of chromosome 1, and then in turn, through such a form, the two columns of chromosome and location information in the original input file are converted into x-axis coordinate information used in the drawing.
In the actual analysis, the Manhattan diagram can be drawn through the R package qqman. The usage is as follows.
The output is as follows
As you can see, it takes a few seconds to draw a Manhattan map just by preparing an input file in the same format. The Manhattan diagram shows the p value information of each SNP locus. The two horizontal lines in the diagram correspond to the threshold for screening significant sites, one corresponding p value is 1e-5, and the other corresponding p value is 5e-8.
Of course, the R package also provides many functions, such as highlighting the specified snp site, changing the name of the chromosome display, and so on, which can meet the basic needs, but it is still subject to many limitations, such as not displaying sex chromosomes. The source code of the package automatically filters the data, leaving only the SNP loci on the autosomal chromosome.
This is what it looks like to use someone else's R package. What others give you, what you use, and what you want to personalize, either notify the developers of the R package to add new features, of course, they will not necessarily buy it, or they will do it themselves.
Intercept the core source code in qqman, as follows
Omitting the color assignment here, we can see that most of the work is to calculate the x-axis coordinates corresponding to the snp site, and the drawing code is only a few sentences.
Once you understand the nature of the Manhattan map, you can customize the Manhattan map with R or familiar software.
The above is all the contents of the article "how to draw Manhattan in big data". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, 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.
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.