I am just learning R and familiarizing myself with the bioconductor packages. I am running through the KEGG profile application example to play around with annotation. Early on I ran into this error:
Here is the code for a smaller version of my dataframe:
> sam <- Rnacounts[1:4, 1:4] >sam X USC_1 USC_2 USC_3 1 0610009B22Rik 26.993871 37.116868 19.684120 2 0610009O20Rik 3.470513 2.319068 4.517183 3 0610010F05Rik 8.087210 7.767922 6.730636 4 0610010K14Rik 21.892374 21.090751 28.342038 > convertId(sam, dataset = "mmusculus_gene_ensembl")
Error in args[[i]] : attempt to select less than one element in integerOneIndex > traceback() 7: is.factor(x) 6: as.factor(args[[i]]) 5: interaction(f, drop = drop, sep = sep, lex.order = lex.order) 4: split.default(testStat, convertIdTable) 3: split(testStat, convertIdTable) 2: newIdMatrix(x, genesKept = genesKept, convertIdTable = newIdTable) 1: convertId(sam, dataset = "mmusculus_gene_ensembl")
I am not used to debugging R code so I am not entirely sure where this error is coming from. I am assuming it is an indexing error where i is now outside of range, but I am not sure how to track down the specific issue (where is i coming from/iterating from?) my other guess would be that some of the genes I have may not be named, a lot of the form '#######'Rik, but i am not sure why that would throw this error.
output of session info:
R version 3.5.0 (2018-04-23) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows >= 8 x64 (build 9200) Matrix products: default locale:  LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252  LC_MONETARY=English_United States.1252 LC_NUMERIC=C  LC_TIME=English_United States.1252 attached base packages:  grid parallel stats4 stats graphics grDevices utils datasets  methods base other attached packages:  biomaRt_2.36.1 KEGGprofile_1.22.0 RCurl_1.95-4.10  bitops_1.0-6 BiocInstaller_1.30.0 edgeR_3.22.2  limma_3.36.1 knitr_1.20 BiocStyle_2.8.2  EDASeq_2.14.0 ShortRead_1.38.0 GenomicAlignments_1.16.0  SummarizedExperiment_1.10.1 DelayedArray_0.6.0 matrixStats_0.53.1  Rsamtools_1.32.0 Biostrings_2.48.0 XVector_0.20.0  BiocParallel_1.14.1 Biobase_2.40.0 Gviz_1.24.0  GenomicRanges_1.32.3 GenomeInfoDb_1.16.0 IRanges_2.14.10  S4Vectors_0.18.2 BiocGenerics_0.26.0 loaded via a namespace (and not attached): Error in x[["Version"]] : subscript out of bounds In addition: Warning message: In FUN(X[[i]], ...) : DESCRIPTION file of package 'rtracklayer' is missing or broken
I also read that the KEGG.db was deprecated so if you have any recommendations about annotation packages I would love to hear them. Sorry if post is improperly formatted, first time with this forum.
Edit: I have re-formatted,post. Also removed all Riks, still does not work. Made the gene names the index, does not work.