This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Colour doesn't change in Manhanttan plot.

Below is my R scripts for the manhanttan plot, many similar forums has used the same codes for their manhattan plot, but it seems doesnt work for me. Also, the default colour supposed to be black/grey but it turned green in my plot, may i know what mistakes i have made?

manhattan(out, chr="CHR", bp="BP", p="P", snp="SNP", highlight=out$SNP,
          col=c("blue4","orange"),
          genomewideline = F, suggestiveline=-log10(1e-5))

manhattan

r gwas qqman manhattanplot

Please see How to add images to a Biostars post to embed images properly and please use the format bar to highlight code. This improves the readability and makes your post visually more appealing, motivating people to help you. I've done the changes for you this time.

As for your question, please show a few lines of the data. This is not strictly bioinformatics, but rather a general R question, so I cannot guarantee you that the question is not going to be closed by any of the other moderators.

enter image description here

thank you, as i have just figured out the answer, should i close this question?

As jrj.healey, it would be helpful for others if you provide an explanation what the issue was and how you solved it.

1 answer

I have figured out the answer. Made a mistakes by using out$SNP for highlighting the SNP.

Below means highlight all the SNPs form out dataframe input, not what I needed:

highlight = out$SNP

And should be just a character vector of SNPs that need highlighting, for example.:

highlight = myVectorOfHitSNPs

It's fine to answer your own question, but please make the answer more extensive so future users that find the thread may benefit. For instance, post the code that finally worked, and ideally an explanation of the issue/resolution.

To 'close' the question you can accept your own answer.

Log in to answer this question.