Create manhattan plot from .qassoc
1
0
Entering edit mode
4.2 years ago
malteze • 0

Hello! Please tell me how can I create a manhattan plot and qq plot from association plink output file .assoc?

When I upload a file to the R workspace, an error appears:

Error in load("C:/Users/lenovo/Desktop/testGMstado2dbdbbd1.qassoc") :
Incorrect file magic number (file may be corrupted) - data not loaded
file ‘testGM.qassoc’ has magic number ' CHR '
  Use of save versions prior to 2 is deprecated

! When I upload a file to the workspace via Import dataset it opens, column names are shown ! but manhattan does not work

Is there a way to fix this problem? Is there any other program for building QQ or Mplot? The ManhattanPlotter-master program is not suitable, since I work with the sheep genome. Sorry for my bad english. Thanks!

R plink assoc • 2.2k views
ADD COMMENT
1
Entering edit mode

Use read.table() in place of load().

Kevin

ADD REPLY
0
Entering edit mode
4.2 years ago
bernatgel ★ 3.4k

Hi @malteze,

Seeing the error you post in the second image, the problem seems to be that you are not telling read.table to treat the first line as the column names. To do that, you should use header=TRUE.

TEST <- read.table(file = "C:/Users/lenovo/Desktop/TEST.qassoc", quote = "\"", comment.char = "", header=TRUE)

and the manhattan function should the work.

Another option would be to use karyoploteR to create the manhattan plots (it will NOT create the QQ plots, though). For that, you'll need to have a file with the lengths of the sheep chromosomes (a text file with a chromosome per line, and two columns: the name and the number of bases). If you have any problem getting it, ask me and I can help you get the data.

You can load the data and plot the manhattan plot with this code. The plot will be a bit different since karyoploteR plots the dot at the exact position of each SNP instead of plotting all of them with the same separation.

library(karyoploteR)
snps.data <- toGRanges("C:/Users/lenovo/Desktop/TEST.qassoc")

kp <- plotKaryotype(genome="sheep.chromosome.lengths.txt")
kpPlotManhattan(kp, data=snps.data)

You can get more information on how to create manhattan plots even in custom genomes in the karyoploteR tutorial

ADD COMMENT

Login before adding your answer.

Traffic: 1855 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6