stuart-lab / signac

R toolkit for the analysis of single-cell chromatin data
https://stuartlab.org/signac/
Other
323 stars 87 forks source link

GetGRangesFromEnsDb: "The 2 combined objects have no sequence levels in common" #429

Closed f6v closed 3 years ago

f6v commented 3 years ago

I'm analysing the paired RNA-seq and ATAC-seq data according to the [tutorial].(https://satijalab.org/seurat/articles/weighted_nearest_neighbor_analysis.html) I get the "The 2 combined objects have no sequence levels in common" warning when running GetGRangesFromEnsDb(EnsDb.Hsapiens.v75).

Full log > Fetching data...OK > Parsing exons...OK > Defining introns...OK > Defining UTRs...OK > Defining CDS...OK > aggregating... > Done > Fetching data...OK > Parsing exons...OK > Defining introns...OK > Defining UTRs...OK > Defining CDS...OK > aggregating... > Done > Fetching data...OK > Parsing exons...OK > Defining introns...OK > Defining UTRs...OK > Defining CDS...OK > aggregating... > Done > Fetching data...OK > Parsing exons...OK > Defining introns...OK > Defining UTRs...OK > Defining CDS...OK > aggregating... > Done > Fetching data...OK > Parsing exons...OK > Defining introns...OK > Defining UTRs...OK > Defining CDS...OK > aggregating... > Done > Fetching data...OK > Parsing exons...OK > Defining introns...OK > Defining UTRs...OK > Defining CDS...OK > aggregating... > Done > Fetching data...OK > Parsing exons...OK > Defining introns...OK > Defining UTRs...OK > Defining CDS...OK > aggregating... > Done > Fetching data...OK > Parsing exons...OK > Defining introns...OK > Defining UTRs...OK > Defining CDS...OK > aggregating... > Done > Fetching data...OK > Parsing exons...OK > Defining introns...OK > Defining UTRs...OK > Defining CDS...OK > aggregating... > Done > Fetching data...OK > Parsing exons...OK > Defining introns...OK > Defining UTRs...OK > Defining CDS...OK > aggregating... > Done > Fetching data...OK > Parsing exons...OK > Defining introns...OK > Defining UTRs...OK > Defining CDS...OK > aggregating... > Done > Fetching data...OK > Parsing exons...OK > Defining introns...OK > Defining UTRs...OK > Defining CDS...OK > aggregating... > Done > Fetching data...OK > Parsing exons...OK > Defining introns...OK > Defining UTRs...OK > Defining CDS...OK > aggregating... > Done > Fetching data...OK > Parsing exons...OK > Defining introns...OK > Defining UTRs...OK > Defining CDS...OK > aggregating... > Done > Fetching data...OK > Parsing exons...OK > Defining introns...OK > Defining UTRs...OK > Defining CDS...OK > aggregating... > Done > Fetching data...OK > Parsing exons...OK > Defining introns...OK > Defining UTRs...OK > Defining CDS...OK > aggregating... > Done > Fetching data...OK > Parsing exons...OK > Defining introns...OK > Defining UTRs...OK > Defining CDS...OK > aggregating... > Done > Fetching data...OK > Parsing exons...OK > Defining introns...OK > Defining UTRs...OK > Defining CDS...OK > aggregating... > Done > Fetching data...OK > Parsing exons...OK > Defining introns...OK > Defining UTRs...OK > Defining CDS...OK > aggregating... > Done > Fetching data...OK > Parsing exons...OK > Defining introns...OK > Defining UTRs...OK > Defining CDS...OK > aggregating... > Done > Fetching data...OK > Parsing exons...OK > Defining introns...OK > Defining UTRs...OK > Defining CDS...OK > aggregating... > Done > Fetching data...OK > Parsing exons...OK > Defining introns...OK > Defining UTRs...OK > Defining CDS...OK > aggregating... > Done > Fetching data...OK > Parsing exons...OK > Defining introns...OK > Defining UTRs...OK > Defining CDS...OK > aggregating... > Done > Fetching data...OK > Parsing exons...OK > Defining introns...OK > Defining UTRs...OK > Defining CDS...OK > aggregating... > Done > Fetching data...OK > Parsing exons...OK > Defining introns...OK > Defining UTRs...OK > Defining CDS...OK > aggregating... > Done > The 2 combined objects have no sequence levels in common. (Use > suppressWarnings() to suppress this warning.)The 2 combined objects have no sequence levels in common. (Use > suppressWarnings() to suppress this warning.)The 2 combined objects have no sequence levels in common. (Use > suppressWarnings() to suppress this warning.)The 2 combined objects have no sequence levels in common. (Use > suppressWarnings() to suppress this warning.)The 2 combined objects have no sequence levels in common. (Use > suppressWarnings() to suppress this warning.)The 2 combined objects have no sequence levels in common. (Use > suppressWarnings() to suppress this warning.)The 2 combined objects have no sequence levels in common. (Use > suppressWarnings() to suppress this warning.)The 2 combined objects have no sequence levels in common. (Use > suppressWarnings() to suppress this warning.)The 2 combined objects have no sequence levels in common. (Use > suppressWarnings() to suppress this warning.)The 2 combined objects have no sequence levels in common. (Use > suppressWarnings() to suppress this warning.)The 2 combined objects have no sequence levels in common. (Use > suppressWarnings() to suppress this warning.)The 2 combined objects have no sequence levels in common. (Use > suppressWarnings() to suppress this warning.)The 2 combined objects have no sequence levels in common. (Use > suppressWarnings() to suppress this warning.)The 2 combined objects have no sequence levels in common. (Use > suppressWarnings() to suppress this warning.)The 2 combined objects have no sequence levels in common. (Use > suppressWarnings() to suppress this warning.)The 2 combined objects have no sequence levels in common. (Use > suppressWarnings() to suppress this warning.)The 2 combined objects have no sequence levels in common. (Use > suppressWarnings() to suppress this warning.)The 2 combined objects have no sequence levels in common. (Use > suppressWarnings() to suppress this warning.)The 2 combined objects have no sequence levels in common. (Use > suppressWarnings() to suppress this warning.)The 2 combined objects have no sequence levels in common. (Use > suppressWarnings() to suppress this warning.)The 2 combined objects have no sequence levels in common. (Use > suppressWarnings() to suppress this warning.)The 2 combined objects have no sequence levels in common. (Use > suppressWarnings() to suppress this warning.)The 2 combined objects have no sequence levels in common. (Use > suppressWarnings() to suppress this warning.)The 2 combined objects have no sequence levels in common. (Use > suppressWarnings() to suppress this warning.) >

The code:

grange_counts <- StringToGRanges(rownames(atac_counts), sep = c("_", "_"))
grange_use <- seqnames(grange_counts) %in% standardChromosomes(grange_counts)
atac_counts <- atac_counts[as.vector(grange_use), ]
annotations <- GetGRangesFromEnsDb(EnsDb.Hsapiens.v75)
#seqlevelsStyle(annotations) <- 'UCSC'
genome(annotations) <- "hg19"

chrom_assay <- CreateChromatinAssay(
   counts = atac_counts,
   sep = c("_", "_"),
   genome = 'hg19',
   annotation = annotations
 )

This is how the atac_counts looks like:

                   scCAT_HCT116_Batch1_1 scCAT_HCT116_Batch1_2 scCAT_HCT116_Batch1_3
chr1_10292_10791                       0                     0                     1
chr1_713838_714337                     1                     3                     2
chr1_762665_763164                     0                     5                     0

I don't quite understand what the consequences of this issue are. Any tips?

f6v commented 3 years ago

This probably isn't a bug, but I don't know how to change the label now.

timoast commented 3 years ago

Is there a reason you commented out the seqlevelsStyle step? It looks like your peaks are UCSC style, not Ensembl

f6v commented 3 years ago

@timoast the message pops up before seqlevelsStyle is invoked anyway. You're right that the peaks have different style, but it seems like Signac(or underlying library) can handle that? I've seen the same message as I was going through the vignette https://satijalab.org/signac/articles/mouse_brain_vignette.html I assume this warning isn't critical?

timoast commented 3 years ago

You're right that the peaks have different style, but it seems like Signac(or underlying library) can handle that?

No, the chromosome names need to match.

meltager commented 3 years ago

I was testing following the Motif analysis vignette (https://satijalab.org/signac/articles/mouse_brain_vignette.html), and i have build around it some code and it was working good till yesterday. Today, I start got error when running the following couple lines

annotations <- GetGRangesFromEnsDb(ensdb = EnsDb.Mmusculus.v79)
seqlevelsStyle(annotations) <- 'UCSC'
genome(annotations) <- "mm10"

The error message i got is :

Error in .order_seqlevels(chrom_sizes[, "chrom"]) : 
  !anyNA(m31) is not TRUE 
17.
stop(simpleError(msg, call = if (p <- sys.parent(1L)) sys.call(p))) 
16.
stopifnot(!anyNA(m31)) at mm10.R#24
15.
.order_seqlevels(chrom_sizes[, "chrom"]) at mm10.R#42
14.
GET_CHROM_SIZES(goldenPath.url = goldenPath.url) 
13.
.get_chrom_info_for_registered_UCSC_genome(script_path, assembled.molecules.only = assembled.molecules.only, 
    map.NCBI = map.NCBI, add.ensembl.col = add.ensembl.col, goldenPath.url = goldenPath.url, 
    recache = recache) 
12.
getChromInfoFromUCSC(new_genome, map.NCBI = TRUE) 
11.
(function (seqlevels, genome, new_style) 
{
    ans <- DataFrame(seqlevels = seqlevels, genome = genome)
    if (is.na(genome) || !(new_style %in% c("NCBI", "RefSeq",  ... 
10.
mapply(FUN = FUN, ..., MoreArgs = MoreArgs, SIMPLIFY = SIMPLIFY, 
    USE.NAMES = USE.NAMES) 
9.
eval(mc, env) 
8.
eval(mc, env) 
7.
eval(mc, env) 
6.
standardGeneric("mapply") 
5.
mapply(.set_seqlevelsStyle_from_seqlevels_and_genome, genome2seqlevels, 
    names(genome2seqlevels), MoreArgs = list(value), SIMPLIFY = FALSE, 
    USE.NAMES = FALSE) 
4.
`seqlevelsStyle<-`(`*tmp*`, value = value) 
3.
`seqlevelsStyle<-`(`*tmp*`, value = value) 
2.
`seqlevelsStyle<-`(`*tmp*`, value = "UCSC") 
1.
`seqlevelsStyle<-`(`*tmp*`, value = "UCSC") 

And here is part of my sessionInfo()

[1] EnsDb.Mmusculus.v79_2.99.0 ensembldb_2.14.1           AnnotationFilter_1.14.0    GenomicFeatures_1.42.3     AnnotationDbi_1.52.0      
 [6] Biobase_2.50.0             Signac_1.2.1               GenomicRanges_1.42.0       GenomeInfoDb_1.26.7        IRanges_2.24.1            
[11] S4Vectors_0.28.1           BiocGenerics_0.36.1       
jardplard commented 3 years ago

Was the original issue ever resolved here? I am also getting the same array of warning messages, and the GRanges object I receive is much larger than I would expect it to be.

dy-lin commented 1 year ago

For the error on seqlevelsStyle(), see: https://github.com/Bioconductor/GenomeInfoDb/issues/82#issuecomment-1409252404 https://github.com/Bioconductor/GenomeInfoDb/issues/82#issuecomment-1409482932