18 months ago
You can use karyoploteR to create a plot similar to a manhattan plot and using any genome.
To create such plot you should first create an empty plot following these instructions and giving it a GRanges or a BED file with the chromosome sizes of C. Albicans (you can get them from this table.
After that, you just need to plot the points representing your snps using the
kpPoints function. You can follow the examples at the tutorial or at the rainfall plot example, although the second one is a bit more complex.
Don't forget to use
plot.type=4 as in the rainfall plot example to give it a more traditional manhattan plot look and feel.
Following the comments, I'm here is some code to create a basic plot.
karyoploteR needs chromosome information to work, so I'll assume the data is in a file with the following format:
Chr Pos Frequency
chr1A 15305 4
chr1A 168836 7
chr1A 515835 1
chr1A 515850 3
chr1A 837522 4
chr1A 842901 7
with the columns separated by tabs.
#Read the data from a file in the same directory called "SNPS.txt"
snps <- read.table(file = "SNPs.txt", sep = "\t", header=TRUE, stringsAsFactors = FALSE)
#Create a GRanges object with the chromosomes and length found at http://www.candidagenome.org/cache/C_albicans_SC5314_genomeSnapshot.html
calbicans.genome <- toGRanges(data.frame(chr=c("chr1A", "chr1B", "chr2A", "chr2B", "chr3A", "chr3B", "chr4A", "chr4B", "chr5A", "chr5B", "chr6A", "chr6B", "chr7A", "chr7B", "chrRA", "chrRB"),
end=c(3188341, 3188396, 2231883, 2231750, 1799298, 1799271, 1603259, 1603311, 1190869, 1190991, 1033292, 1033212, 949580, 949611, 2286237, 2285697)))
#Create the plot
kp <- plotKaryotype(genome=calbicans.genome, plot.type=4, ideogram.plotter = NULL, labels.plotter = NULL)
max.freq <- max(snps$Frequency)
kpAddLabels(kp, "SNP Frequency", srt=90, pos=3)
kpAxis(kp, ymin = 0, ymax=max.freq)
kpPoints(kp, chr=snps$Chr, x=snps$Pos, y=snps$Frequency, ymin=0, ymax=max.freq)
You can ajdust multiple additional parameters then the size of the points and their colors. the margins... You can find more information on how to do it in the documentation.
With more data points (in this case, random data) it would look like this