40 运行GDCprepare(query, save=FALSE)时错误

运行prepare的时候提示column有问题
下面是我运行的代码
有什么解决办法么

> query <- GDCquery(project = "TCGA-BRCA",

+                   data.category = "Transcriptome Profiling",

+                   data.type = "Gene Expression Quantification", 

+                   workflow.type = "STAR - Counts")

> queryFt <- GDCquery(project = "TCGA-BRCA",

+                   data.category = "Transcriptome Profiling",

+                   data.type = "Gene Expression Quantification", 

+                   workflow.type = "STAR - Counts")

> samplesDown <- getResults(queryFt,cols=c("cases"))

> dataSmTP <- TCGAquery_SampleTypes(barcode = samplesDown,

+                                   typesample = "TP")

> dataSmNT <- TCGAquery_SampleTypes(barcode = samplesDown,

+                                   typesample = "NT")

> dataSmTP_short <- dataSmTP[1:100]

> dataSmNT_short <- dataSmNT[1:100]

> queryDownSd <- GDCquery(project = "TCGA-BRCA", 

+                       data.category = "Transcriptome Profiling",

+                       data.type = "Gene Expression Quantification", 

+                       workflow.type = "STAR - Counts", 

+                       barcode = c(dataSmTP_short, dataSmNT_short))

> GDCdownload(query = queryDownSd, files.per.chunk = 10)


在运行下面这一步时提示error,是不是因为最早sampleDown时只取了case?

> dataPrep1 <- GDCprepare(query = queryDownSd, save = FALSE)

Error in `vectbl_as_col_location()`:

! Can't subset columns past the end.

i Locations 2, 3, and 4 don't exist.

i There is only 1 column.

Run `rlang::last_error()` to see where the error occurred.

There were 50 or more warnings (use warnings() to see the first 50)

> rlang::last_error()

<error/vctrs_error_subscript_oob>

Error in `vectbl_as_col_location()`:

! Can't subset columns past the end.

i Locations 2, 3, and 4 don't exist.

i There is only 1 column.

---

Backtrace:

  1. TCGAbiolinks::GDCprepare(query = queryDownSd, save = FALSE)

  6. purrr::map_dfc(., .f = function(y) y[, 2:4])

  7. purrr::map(.x, .f, ...)

  8. TCGAbiolinks .f(.x[[i]], ...)

 12. tibble:::`[.tbl_df`(y, , 2:4)

 13. tibble:::vectbl_as_col_location(...)

Run `rlang::last_trace()` to see the full context.

> rlang::last_trace()

<error/vctrs_error_subscript_oob>

Error in `vectbl_as_col_location()`:

! Can't subset columns past the end.

i Locations 2, 3, and 4 don't exist.

i There is only 1 column.

---

Backtrace:

     x

  1. +-TCGAbiolinks::GDCprepare(query = queryDownSd, save = FALSE)

  2. | \-TCGAbiolinks:::readTranscriptomeProfiling(...)

  3. |   +-base::suppressMessages(...)

  4. |   | \-base::withCallingHandlers(...)

  5. |   \-x %>% map_dfc(.f = function(y) y[, 2:4])

  6. \-purrr::map_dfc(., .f = function(y) y[, 2:4])

  7.   \-purrr::map(.x, .f, ...)

  8.     \-TCGAbiolinks .f(.x[[i]], ...)

  9.       +-y[, 2:4]

 10.       +-readr:::`[.spec_tbl_df`(y, , 2:4)

 11.       +-base::NextMethod(`[`)

 12.       \-tibble:::`[.tbl_df`(y, , 2:4)

 13.         \-tibble:::vectbl_as_col_location(...)

 14.           +-tibble:::subclass_col_index_errors(...)

 15.           | \-base::withCallingHandlers(...)

 16.           \-vctrs::vec_as_location(j, n, names)

 17.             \-vctrs `<fn>`()

 18.               \-vctrs:::stop_subscript_oob(...)

 19.                 \-vctrs:::stop_subscript(...)

 20.                   \-rlang::abort(...)

请先 登录 后评论

1 个回答

omicsgene - 生物信息
擅长:重测序,遗传进化,转录组,GWAS

建议 下载所有的数据过后,再通过sample.info 信息筛选表达表格,避免错误:

看看这个:

https://www.omicsclass.com/article/1664 

请先 登录 后评论