Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miami plot highlight SNPs #47

Open
rbutleriii opened this issue Apr 14, 2021 · 0 comments
Open

Miami plot highlight SNPs #47

rbutleriii opened this issue Apr 14, 2021 · 0 comments

Comments

@rbutleriii
Copy link

Hello, I ran into an issue plotting two manhattans and labeling the SNPs. If you feed it a list of SNPs for highlight.text, it will always label the first one it finds. Is there a format of the highlight vector that will highlight the upper or lower SNPs independently?

library(CMplot)
data(cattle50K)
cat2 = cattle50K
cat2[,4:ncol(cattle50K)] <- apply(cattle50K[,4:ncol(cattle50K)], 2, function(x) -x )
combined = rbind(cattle50K, cat2)

SNPs <- list(
	combined$SNP[abs(combined[[4]]) >0.01],
	combined$SNP[abs(combined[[5]]) >0.01],
	combined$SNP[abs(combined[[6]]) >0.01]
)

# plot
CMplot(combined, type="h",plot.type="m", band=0.5, LOG10=FALSE, ylab="SNP effect",ylim=c(-0.02,0.02),
        threshold.lty=2, threshold.lwd=1, threshold.col="red", amplify=FALSE,cex=0.6,
        chr.den.col=NULL, file="jpg",memo="",dpi=300,file.output=TRUE,verbose=TRUE, highlight=SNPs, 
        highlight.text=SNPs, highlight.col=NULL)

combined[combined$SNP %in% SNPs[[2]],]
#            SNP chr     pos Somatic cell score  Milk yield Fat percentage
# 25086 SNP25086  14 1366897        0.002724654  0.01134473     0.01725977
# 25088 SNP25088  14 1464533       -0.002148450 -0.01407219    -0.02303989
# 25089 SNP25089  14 1513351       -0.001374140  0.01087308     0.01652615
# 25090 SNP25090  14 1562168       -0.001105026  0.01048968    -0.01615920
# 25091 SNP25091  14 1610986       -0.001838383 -0.01435086     0.02367300
# 25093 SNP25093  14 1708622        0.000844426  0.01322645     0.01960535
# 25102 SNP25102  14 2147982        0.003561931  0.01003882    -0.01529792
# 67637 SNP25086  14 1366897       -0.002724654 -0.01134473    -0.01725977
# 67639 SNP25088  14 1464533        0.002148450  0.01407219     0.02303989
# 67640 SNP25089  14 1513351        0.001374140 -0.01087308    -0.01652615
# 67641 SNP25090  14 1562168        0.001105026 -0.01048968     0.01615920
# 67642 SNP25091  14 1610986        0.001838383  0.01435086    -0.02367300
# 67644 SNP25093  14 1708622       -0.000844426 -0.01322645    -0.01960535
# 67653 SNP25102  14 2147982       -0.003561931 -0.01003882     0.01529792

Rectangular-Manhattan Milk yield

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant