Making GenomicDataCommons less daunting to use for the average user
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 文档
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- r
调研方向
Review the existing vignette and the query/result entry points mentioned here, including files(), select(), and results_all(), alongside the nested result structure in the issue. Add clear examples showing how suitable query results can be represented as data frames and explain when multiple queries and joins are needed.
由索引模型根据 Issue 内容生成。
描述
GenomicDataCommons is a very powerful library and can query pretty much anything at the GDC, though many users prefer other libraries like e.g.,TCGAbiolinks because the GenomicDataCommons query results data structure, a deeply nested list of recursive lists of data frames of lists (an R representation of JSON), can be quite daunting for the average user to work with.
Users generally want to get and look at data frames. While all query results cannot easily be transformed into a single data frame, many can. It would help users a lot to show how to do this.
I use rrapply to recursively alter anything I need inside the query results data structure (which is a nice library made for dealing with things like GenomicDataCommons recursive data structures), then make a data frame like e.g.:
stopifnot(GenomicDataCommons::status()$status == "OK")
gdc_query <-
files() %>%
GenomicDataCommons::filter(
cases.project.project_id %in% project_ids
& cases.samples.sample_type %in% sample_types
& analysis.workflow_type == workflow_type
) %>%
GenomicDataCommons::select(c(
"file_name",
"analysis.workflow_type",
"cases.project.project_id",
"cases.case_id",
"cases.submitter_id",
"cases.samples.sample_id",
"cases.samples.submitter_id",
"cases.samples.sample_type",
"cases.samples.is_ffpe",
"cases.samples.portions.is_ffpe",
"cases.samples.portions.analytes.aliquots.aliquot_id",
"cases.samples.portions.analytes.aliquots.submitter_id"
))
gdc_results <- results_all(gdc_query)
gdc_results <- rrapply(
gdc_results, f=function(x) NA, condition=is.null, how="replace"
)
gdc_df <- data.frame(
file_uuid=gdc_results$file_id,
file_name=gdc_results$file_name,
workflow_type=gdc_results$analysis$workflow_type,
project_id=vapply(
sapply(gdc_results$cases, `[[`, "project"), `[`, "project_id"
),
case_uuid=sapply(gdc_results$cases, `[[`, "case_id"),
case_submitter_id=sapply(gdc_results$cases, `[[`, "submitter_id"),
sample_uuid=sapply(
sapply(gdc_results$cases, `[[`, "samples"), `[[`, "sample_id"
),
sample_submitter_id=sapply(
sapply(gdc_results$cases, `[[`, "samples"), `[[`, "submitter_id"
),
sample_type=sapply(
sapply(gdc_results$cases, `[[`, "samples"), `[[`, "sample_type"
),
sample_is_ffpe=sapply(
sapply(gdc_results$cases, `[[`, "samples"), `[[`, "is_ffpe"
),
portion_is_ffpe=sapply(
sapply(
sapply(
gdc_results$cases, `[[`, "samples"
), `[[`, "portions"
), `[[`, "is_ffpe"
),
aliquot_uuid=sapply(
sapply(
sapply(
sapply(
sapply(
gdc_results$cases, `[[`, "samples"
), `[[`, "portions"
), `[[`, "analytes"
), `[[`, "aliquots"
), `[[`, "aliquot_id"
),
aliquot_submitter_id=sapply(
sapply(
sapply(
sapply(
sapply(
gdc_results$cases, `[[`, "samples"
), `[[`, "portions"
), `[[`, "analytes"
), `[[`, "aliquots"
), `[[`, "submitter_id"
),
row.names=gdc_results$file_id,
stringsAsFactors=FALSE
)
For single query results that cannot be easily transformed back to a data frame using the above method (due to GDC DB key relationship structure), I make multiple queries, transform them to individual data frames like above, and then do joining of the data frames to get a single one the way I need it.
Anyway, this is probably a bit challenging for the average user? Maybe there is an easier way to work with GenomicDataCommons that I've totally missed. But if not, and what I'm doing is generally a good way, maybe it's worth adding to the vignette some examples of how to make data frames from query results.
- 主要语言
- R
- 星标
- 90
- 派生
- 25
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Bioconductor/GenomicDataCommons 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 25/100
-
add blurb regarding potential conflicts when loading dplyr可能重新可做 @bd4everyone 于 608 天前认领,目前没有进行中的 PR。 未关闭enhancement
Bioconductor/GenomicDataCommons#118 · 1 条评论 · 已指派 1 人 ·
-
难度 3/5 1-2 天 新手友好度 35/100
Bioconductor/GenomicDataCommons#97 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 25/100
-
Add TSV return format support可能重新可做 @seandavi 于 2451 天前认领,目前没有进行中的 PR。 未关闭enhancement
Bioconductor/GenomicDataCommons#75 · 已指派 1 人 ·
查看 Bioconductor/GenomicDataCommons 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 65/100
-
enhancement
难度 2/5 1-3 小时 新手友好度 70/100
insightsengineering/teal.modules.general#1022 · 1 个 reaction ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 65/100