I want to check if there are gene clusters (consecutive genes with the same function) on each chromosome. So I have the gene genomic orders (coordinates), and function (pfam/gene family etc) for each gene.
Finally in R I can replace the gene orders ($3 and $4) with their coordinates from NrCoord, and get the list of genes in between those coordinates
1
2
3
4
5
6
7
8
9
10
11
#R examplefor (iin1:nrow(rawTable)){# replace gene order with gene coordinatefirst<-rawTable[i,4]rawTable[i,4]<-geneNrCoord[first,2]last<-rawTable[i,5]rawTable[i,5]<-geneNrCoord[last,2]# get genes for the clustersubgenes<-geneNrCoord[which(geneNrCoord$V2>=rawTable[i,4]&geneNrCoord$V2<=rawTable[i,5]),]rawTable[i,6]<-paste(unlist(subgenes$V3),collapse=",")}