Question: Create manhattan plot from .qassoc
0
gravatar for malteze
11 months ago by
malteze0
malteze0 wrote:

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!

assoc plink R • 415 views
ADD COMMENTlink modified 11 months ago by bernatgel2.8k • written 11 months ago by malteze0
1

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

Kevin

ADD REPLYlink written 11 months ago by Kevin Blighe69k
0
gravatar for bernatgel
11 months ago by
bernatgel2.8k
Barcelona, Spain
bernatgel2.8k wrote:

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 COMMENTlink written 11 months ago by bernatgel2.8k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1641 users visited in the last hour
_