view classifier/eqtl_genes_positions_plot.txt @ 1:d8547ff82697 draft default tip

Deleted selected files
author nanettec
date Fri, 18 Mar 2016 05:16:02 -0400
parents ef9c2044d86a
children
line wrap: on
line source


#setwd("/Users/nanettecoetzer/Documents/Bioinformatics/MAIZE_project/eQTL_pipeline/April_2012_pipeline_scripts/July_2012/output_July")
eqtl <- read.table("all_classification.txt",sep="\t",header=TRUE)
lookup <- read.table("lookup.txt",sep="\t",header=TRUE)
 
trans_eqtl_bins <- eqtl[eqtl[,14]=="trans",15]
trans_gene_bins <- eqtl[eqtl[,14]=="trans",16]
cis_eqtl_bins <- eqtl[eqtl[,14]=="cis",15]
cis_gene_bins <- eqtl[eqtl[,14]=="cis",16]

# cis and trans in colour

pdf("Rplot_eQTL_genes_positions.pdf")
plot(trans_eqtl_bins, trans_gene_bins, type="p", pch=".", cex=2, main="", xlab="eQTL position", ylab="Gene position",col="green", xaxt='n', yaxt='n')
points(cis_eqtl_bins, cis_gene_bins, type="p", pch=".", cex=2, col="blue")

chr.nr = max(lookup[,2])
chr.mid = c()
chr.sides = c(0)
chr_labels = c()
for (c in 1:chr.nr) {
	chr_labels <- c(chr_labels,paste("chr",c,sep=""))
	pos <- length(lookup[lookup[,2]==c,1])/2
	end <- max(lookup[lookup[,2]==c,1])
	chr.mid = c(chr.mid,pos+min(lookup[lookup[,2]==c,1])-1)
	chr.sides = c(chr.sides, end)
}
abline(v=chr.sides, lty=3, lwd=2)

axis(side=1, at=chr.mid, labels= chr_labels)
dev.off()