MalteThodberg / CAGEfightR

Analysis of Cap Analysis of Gene Expression (CAGE) data using Bioconductor
GNU General Public License v3.0
8 stars 2 forks source link

'is.character(hits) is not TRUE' error while running assignTxID #8

Closed NexentaEL closed 4 years ago

NexentaEL commented 4 years ago

Hi Malte,

I'm getting an error while trying to annotate clusters (and the same warnings in .Seqinfo.mergexy as I described in the previous issue):

> TSSs <- assignTxID(TSSs, txModels = txdb, swap = "thick")
Extracting transcripts...
Finding hierachical overlaps...
Error in .local(object, txModels, ...) : is.character(hits) is not TRUE
In addition: Warning messages:
1: In .Seqinfo.mergexy(x, y) :
  The 2 combined objects have no sequence levels in common. (Use
  suppressWarnings() to suppress this warning.)
2: In .Seqinfo.mergexy(x, y) :
  The 2 combined objects have no sequence levels in common. (Use
  suppressWarnings() to suppress this warning.)
3: In .Seqinfo.mergexy(x, y) :
  The 2 combined objects have no sequence levels in common. (Use
  suppressWarnings() to suppress this warning.)
> TSSs <- assignTxType(TSSs, txModels = txdb, swap = "thick")
Finding hierachical overlaps with swapped ranges...
### Overlap summary: ###
      txType count percentage
1   promoter     0          0
2   proximal     0          0
3    fiveUTR     0          0
4   threeUTR     0          0
5        CDS     0          0
6       exon     0          0
7     intron     0          0
8  antisense     0          0
9 intergenic 12350        100
Warning messages:
1: In .Seqinfo.mergexy(x, y) :
  The 2 combined objects have no sequence levels in common. (Use
  suppressWarnings() to suppress this warning.)
2: In .Seqinfo.mergexy(x, y) :
  The 2 combined objects have no sequence levels in common. (Use
  suppressWarnings() to suppress this warning.)
3: In .Seqinfo.mergexy(x, y) :
  The 2 combined objects have no sequence levels in common. (Use
  suppressWarnings() to suppress this warning.)

TxDb object was made from GFF3 file using makeTxDbFromGFF function:

txdb <- makeTxDbFromGFF(file="resources/GCF_000022165.1_ASM2216v1_genomic.gff", 
                        dataSource="NCBI", 
                        organism="Salmonella enterica")

I tried to specify chrominfo, it didn't help:

chrominfo <- data.frame(chrom = c("NC_016856.1", 'NC_016855.1'),
                        length=c(4870265, 93832),
                        is_circular=c(TRUE, TRUE))
txdb <- makeTxDbFromGFF(file="resources/GCF_000022165.1_ASM2216v1_genomic.gff", 
                        chrominfo=chrominfo,
                        dataSource="NCBI", 
                        organism="Salmonella enterica")

TSSs content:

> TSSs
class: RangedSummarizedExperiment 
dim: 12350 6 
metadata(0):
assays(2): counts TPM
rownames(12350): NC_016856.1_chromosome:1-21;+ NC_016856.1_chromosome:59-205;+ ...
  NC_016855.1_plasmid:88356-88359;- NC_016855.1_plasmid:90071-90101;-
rowData names(4): score thick support txType
colnames(6): S21 S22 ... S25 S26
colData names(5): Name BigWigPlus BigWigMinus Class totalTags

How can this be fixed?

Thank you, Liuaza

MalteThodberg commented 4 years ago

It looks like the genome information attached to the TSSs and the transcripts models are different: This means that GRanges doesn't detect any overlaps.

Can you show the output of seqinfo(txdb) and seqinfo(TSSs)?

NexentaEL commented 4 years ago
> seqinfo(txdb)
Seqinfo object with 2 sequences (2 circular) from an unspecified genome:
  seqnames    seqlengths isCircular genome
  NC_016856.1    4870265       TRUE   <NA>
  NC_016855.1      93832       TRUE   <NA>
> seqinfo(TSSs)
Seqinfo object with 2 sequences from ASM2216v1 genome:
  seqnames               seqlengths isCircular    genome
  NC_016856.1_chromosome    4870265      FALSE ASM2216v1
  NC_016855.1_plasmid         93832      FALSE ASM2216v1

It looks like solving the problem with the warning "The 2 combined objects have no sequence levels in common" can solve this issue

NexentaEL commented 4 years ago

Oh, I had not only different isCircular information but different seqnames, I fixed it and reinstalled my custom BSgenome and now it works without this error. Thank you!

MalteThodberg commented 4 years ago

Glad it worked!