Hi all!
Today I was trying the package called 'Gviz' for plotting chip-seq peaks as histogram across the whole genome of Mycobacterium tuberculosis. But I was unsuccessful as it keep giving this error:
Error in .normargGenome(value, seqnames(x)) :
supplied 'genome' must be a vector or factor
These were the steps I was running:
library(Gviz)
library(GenomicRanges)
library(GenomicFeatures)
txdb <- makeTxDbFromGFF("/home/m.tub1.gff3",circ_seqs=character(), organism="Mycobacterium tuberculosis")
annoData <- genes(txdb)
annoData1 <- as.data.frame(annoData)
a <- annoData1[which(annoData1$end == max(annoData1$end)),]
a$label= "+"
a$label1= "-"
bed_file1 = read.csv("/home/peak_annotations_forward_strand.txt", header = T, sep = "\t")
bed_file2 = read.csv("/home/peak_annotations_reverse_strand.txt", header = T, sep = "\t")
b <- bed_file1$pileup
c <- -(bed_file2$pileup)
gtrack <- GenomeAxisTrack(range = makeGRangesFromDataFrame(data.frame(seqnames=as.character(a$seqname), start=1, end=a$end)))
lim <- c(0, a$end)
dtrack <- DataTrack(data = c, start = bed_file1$start, end = bed_file1$end, name = "Peaks (+)")
dtrack1 <- DataTrack(data = d, start = bed_file2$start, end = bed_file2$end, name = "Peak (-)")
pdf(file="/home/trial_15sep.pdf",width=10,height=10)
plotTracks(list(dtrack, dtrack1), from = lim[1], to = lim[2], type = "histogram")
dev.off()
Can Gviz handle any non-model organism by taking FASTA or any other method ? Please help me out .
Thank you in advance.