Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Making GenomicDataCommons less daunting to use for the average user

オープン
#94 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
r
領域
documentation

調査の方向性

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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Bioconductor/GenomicDataCommons のほかの issue

Bioconductor/GenomicDataCommons の issue をすべて見る

似ている issue

R の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。