Skip to content

Request convinence function to provide flat table of non-sequential tables. #32

@jfy133

Description

@jfy133

Use case (from Ben): user wants a flat table of just columns from Site and Library tables.

Proposed implementation:

  • get_df to get tables requested
  • make_complete (
    #' Make sequence-complete Pandora table list
    #'
    #' Pandoras layout is a hierarchical sequence of tables: All tables have a clear
    #' predecessor and successor. \code{join_pandora_tables()} uses this fact to
    #' merge tables accordingly. \code{make_complete_table_list} is
    #' a helper function to fill the gaps in a sequence of Pandora tables.
    #'
    #' @param tabs character vector. List of Pandora table names
    #' @param join_order_vector character vector. Reference vector with the Pandora
    #' structure
    #'
    #' @export
    make_complete_table_list <- function(
    tabs,
    join_order_vector = sidora.core::pandora_tables
    ) {
    positions <- sapply(tabs, function(x) { which(x == join_order_vector) })
    res <- join_order_vector[seq(min(positions), max(positions), 1)]
    return(res)
    }
    )
    • allow make_complete to fill in the gaps
    • New functionality: if not sequential tables requested, remove the columns from 'intemrediate' tables filled in by make_complete before returning (in case above, e.g. psuedocode: `select_if(-starts_with("sample", "individual", "extract")

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions