#read in the genome file #Genome Coordinants are from ensembl dog_genome <-read.table('dog_genome.txt', header=T, sep="\t") #check to see everything is correct dog_genome #plot dog genome genome_plot <-barplot(dog_genome$Length, col="grey80", border=NA, ylab="Position (bp)", xlab="Chromosome", las=1) #add colored regions over the base plot #read in file that specifies where to color in #I use A & B to designate differen colors markings <-read.table('chromosome_colors.txt', header = T, sep="\t") #check markings #add over original plot with(markings, rect( genome_plot[Chromosome,]-0.5, Position1, genome_plot[Chromosome,]+0.5, Position2, col=Ancestry, lwd=0.5, border = NA ) ) #if you want to have lines instead of large chunks colored in with(markings, segments( genome_plot[Chromosome,]-0.5, Position1, genome_plot[Chromosome,]+0.5, Position1, col=Ancestry, lwd=1, lend=1 ) )