Generate a custom annotation for ChIPQC
0
0
Entering edit mode
@8ccdad87
Last seen 2.7 years ago
United States

Hi, I am trying to create a custom Chicken (galGal6) annotation for ChIPQC, but the only post that I could find didn't solve my problem How to generate custom annotation for rat genome rn6 in ChIPQC

I want to generate the Relative Enrichment of Genomic Intervals (REGI) graphs, and it always outputs this error

> plotRegi(chipObj)
Error: Faceting variables must have at least one value
Run `rlang::last_error()` to see where the error occurred.
In addition: Warning message:
In plotRegi(chipObj) : No genomic annotation computed

I just have no idea how to move forward from here...

What I used to generate my custom annotation is:

myNewGetAnnotation <- function(GeneAnnotation = "gga", AllChr){
  txdb <- TxDb.Ggallus.UCSC.galGal6.refGene
  All5utrs <- reduce(unique(unlist(fiveUTRsByTranscript(txdb))))
  All3utrs <- reduce(unique(unlist(threeUTRsByTranscript(txdb))))
  Allcds <- reduce(unique(unlist(cdsBy(txdb,"tx"))))
  Allintrons <- reduce(unique(unlist(intronsByTranscript(txdb))))
  Alltranscripts <- reduce(unique(transcripts(txdb)))

  posAllTranscripts <- Alltranscripts[strand(Alltranscripts) == "+"]
  posAllTranscripts <- posAllTranscripts[!(start(posAllTranscripts)-20000 < 0)]
  negAllTranscripts <- Alltranscripts[strand(Alltranscripts) == "-"]
  chrLimits <- seqlengths(negAllTranscripts)[as.character(seqnames(negAllTranscripts))]
  negAllTranscripts <- negAllTranscripts[!(end(negAllTranscripts)+20000 > chrLimits)]
  Alltranscripts <- c(posAllTranscripts,negAllTranscripts)
  Promoters500 <-  reduce(flank(Alltranscripts,500))
  Promoters2000to500 <-  reduce(flank(Promoters500,1500))
  LongPromoter20000to2000  <- reduce(flank(Promoters2000to500,18000))
  if(!missing(AllChr) & !is.null(AllChr)){
    All5utrs <- ChIPQC:::GetGRanges(All5utrs,AllChr=AllChr)
    All3utrs <- ChIPQC:::GetGRanges(All3utrs,AllChr=AllChr)
    Allcds <- ChIPQC:::GetGRanges(Allcds,AllChr=AllChr)
    Allintrons <- ChIPQC:::GetGRanges(Allintrons,AllChr=AllChr)
    Alltranscripts <- ChIPQC:::GetGRanges(Alltranscripts,AllChr=AllChr)
    Promoters500 <- ChIPQC:::GetGRanges(Promoters500,AllChr=AllChr)
    Promoters2000to500 <-  ChIPQC:::GetGRanges(Promoters2000to500,AllChr=AllChr)
    LongPromoter20000to2000  <- ChIPQC:::GetGRanges(LongPromoter20000to2000,AllChr=AllChr)
  }
  return(list(version=GeneAnnotation,LongPromoter20000to2000=LongPromoter20000to2000,
              Promoters2000to500=Promoters2000to500,Promoters500=Promoters500,
              All5utrs=All5utrs,Alltranscripts=Alltranscripts,Allcds=Allcds,
              Allintrons=Allintrons,All3utrs=All3utrs))
}

galGal6 <- myNewGetAnnotation(AllChr = "chr1") ##here, I also can't figure out how to include all chromosomes##

Please help..!

Thank you

ChIPQC • 952 views
ADD COMMENT

Login before adding your answer.

Traffic: 568 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6