Bioconductor / GenomicRanges

Representation and manipulation of genomic intervals
https://bioconductor.org/packages/GenomicRanges
41 stars 17 forks source link

Error in mapToTranscripts #27

Closed weir12 closed 5 years ago

weir12 commented 5 years ago

Hi: When I use function mapToTranscripts I get an error:

> mapToTranscripts(x, GR)
Error in .normargSeqlevels(seqnames) :
  supplied 'seqlevels' cannot contain NAs or empty strings ("")

However,table(is.na(seqlevels(GR))) table(seqlevels(GR)=="") Hint that it doesn't exist NA or empty strings traceback:

12: stop(errmsg)
11: .normargSeqlevels(seqnames)
10: Seqinfo(names(seqlengths), seqlengths)
9: new_GRanges("GRanges", seqnames = seqnames, ranges = ranges,
       strand = strand, mcols = mcols, seqlengths = seqlengths,
       seqinfo = seqinfo)
8: GRanges(names(transcripts)[transcriptsHits], xrange, strand(flat)[txHits],
       df, seqlengths = seqlengths)
7: .mapToTranscripts(x, transcripts, hits, ignore.strand, intronJunctions)
6: .local(x, transcripts, ...)
5: mapToTranscripts(x, grl, ignore.strand)
4: mapToTranscripts(x, grl, ignore.strand)
3: .local(x, transcripts, ...)
2: mapToTranscripts(x, GR)
1: mapToTranscripts(x, GR)

Supplementary information

> str(GR)
Formal class 'GRanges' [package "GenomicRanges"] with 7 slots
  ..@ seqnames       :Formal class 'Rle' [package "S4Vectors"] with 4 slots
  .. .. ..@ values         : Factor w/ 440 levels "NC_000001.11",..: 1 2 3 4 5 6 7 8 9 10 ...
  .. .. ..@ lengths        : int [1:435] 16474 12488 10350 7126 7287 8488 7809 6504 7222 7837 ...
  .. .. ..@ elementMetadata: NULL
  .. .. ..@ metadata       : list()
  ..@ ranges         :Formal class 'IRanges' [package "IRanges"] with 6 slots
  .. .. ..@ start          : int [1:178581] 11874 29926 30366 30438 69091 131068 182388 200442 487055 722046 ...
  .. .. ..@ width          : int [1:178581] 2536 1370 138 21 918 3769 2491 3542 3765 3777 ...
  .. .. ..@ NAMES          : chr [1:178581] "NR_046018.2" "XR_001737835.1" "NR_036051.1" "rna-MIR1302-2" ...
  .. .. ..@ elementType    : chr "ANY"
  .. .. ..@ elementMetadata: NULL
  .. .. ..@ metadata       : list()
  ..@ strand         :Formal class 'Rle' [package "S4Vectors"] with 4 slots
  .. .. ..@ values         : Factor w/ 3 levels "+","-","*": 1 2 1 2 1 2 1 2 1 2 ...
  .. .. ..@ lengths        : int [1:715] 8550 7924 6458 6030 5145 5205 3683 3443 3703 3584 ...
  .. .. ..@ elementMetadata: NULL
  .. .. ..@ metadata       : list()
  ..@ seqinfo        :Formal class 'Seqinfo' [package "GenomeInfoDb"] with 4 slots
  .. .. ..@ seqnames   : chr [1:440] "NC_000001.11" "NC_000002.12" "NC_000003.12" "NC_000004.12" ...
  .. .. ..@ seqlengths : int [1:440] NA NA NA NA NA NA NA NA NA NA ...
  .. .. ..@ is_circular: logi [1:440] NA NA NA NA NA NA ...
  .. .. ..@ genome     : chr [1:440] NA NA NA NA ...
  ..@ elementMetadata:Formal class 'DataFrame' [package "S4Vectors"] with 6 slots
  .. .. ..@ rownames       : NULL
  .. .. ..@ nrows          : int 178581
  .. .. ..@ listData       :List of 2
  .. .. .. ..$ tx_id  : int [1:178581] 1 2 3 4 5 6 7 8 9 10 ...
  .. .. .. ..$ tx_name: chr [1:178581] "NR_046018.2" "XR_001737835.1" "NR_036051.1" "rna-MIR1302-2" ...
  .. .. ..@ elementType    : chr "ANY"
  .. .. ..@ elementMetadata: NULL
  .. .. ..@ metadata       : list()
  ..@ elementType    : chr "ANY"
  ..@ metadata       :List of 1
  .. ..$ genomeInfo:List of 15
  .. .. ..$ Db type                                 : chr "TxDb"
  .. .. ..$ Supporting package                      : chr "GenomicFeatures"
  .. .. ..$ Data source                             : chr "/home/weir/RNAedit/human_test/reference/GCF_000001405.38_GRCh38.p12_genomic.gff"
  .. .. ..$ Organism                                : chr NA
  .. .. ..$ Taxonomy ID                             : chr NA
  .. .. ..$ miRBase build ID                        : chr NA
  .. .. ..$ Genome                                  : chr NA
  .. .. ..$ transcript_nrow                         : chr "178581"
  .. .. ..$ exon_nrow                               : chr "1945509"
  .. .. ..$ cds_nrow                                : chr "1460272"
  .. .. ..$ Db created by                           : chr "GenomicFeatures package from Bioconductor"
  .. .. ..$ Creation time                           : chr "2019-06-17 22:46:48 +0800 (Mon, 17 Jun 2019)"
  .. .. ..$ GenomicFeatures version at creation time: chr "1.34.8"
  .. .. ..$ RSQLite version at creation time        : chr "2.1.1"
  .. .. ..$ DBSCHEMAVERSION                         : chr "1.2"
hpages commented 5 years ago

Hi,

Note that you're not telling us anything about x. Please provide the code that allows us to reproduce the problem. Also show us the output of your sessionInfo().

Thanks!

hpages commented 5 years ago

Also mapToTranscripts() does not belong to the GenomicRanges package so I'm closing this issue.

Please create a new issue under the appropriate package (GenomicFeatures) with reproducible example and sessionInfo() if you're still having problems with this.