comparison classifier/eqtl_genes_positions_plot.txt @ 0:ef9c2044d86a draft

Uploaded
author nanettec
date Fri, 18 Mar 2016 05:15:29 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:ef9c2044d86a
1
2 #setwd("/Users/nanettecoetzer/Documents/Bioinformatics/MAIZE_project/eQTL_pipeline/April_2012_pipeline_scripts/July_2012/output_July")
3 eqtl <- read.table("all_classification.txt",sep="\t",header=TRUE)
4 lookup <- read.table("lookup.txt",sep="\t",header=TRUE)
5
6 trans_eqtl_bins <- eqtl[eqtl[,14]=="trans",15]
7 trans_gene_bins <- eqtl[eqtl[,14]=="trans",16]
8 cis_eqtl_bins <- eqtl[eqtl[,14]=="cis",15]
9 cis_gene_bins <- eqtl[eqtl[,14]=="cis",16]
10
11 # cis and trans in colour
12
13 pdf("Rplot_eQTL_genes_positions.pdf")
14 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')
15 points(cis_eqtl_bins, cis_gene_bins, type="p", pch=".", cex=2, col="blue")
16
17 chr.nr = max(lookup[,2])
18 chr.mid = c()
19 chr.sides = c(0)
20 chr_labels = c()
21 for (c in 1:chr.nr) {
22 chr_labels <- c(chr_labels,paste("chr",c,sep=""))
23 pos <- length(lookup[lookup[,2]==c,1])/2
24 end <- max(lookup[lookup[,2]==c,1])
25 chr.mid = c(chr.mid,pos+min(lookup[lookup[,2]==c,1])-1)
26 chr.sides = c(chr.sides, end)
27 }
28 abline(v=chr.sides, lty=3, lwd=2)
29
30 axis(side=1, at=chr.mid, labels= chr_labels)
31 dev.off()
32