Colour doesn't change in Manhanttan plot.
1
1
Entering edit mode
5.3 years ago
greyman ▴ 190

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 • 2.0k views
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
1
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY
3
Entering edit mode
5.3 years ago
greyman ▴ 190

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
ADD COMMENT
0
Entering edit mode

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.

ADD REPLY

Login before adding your answer.

Traffic: 1768 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