Shiny - read file with BCG_ATTR

Open
#91 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
r
Domain
data

Research direction

Start with Server.R and trace the file import flow for the Shiny feature that reads BCG_ATTR. Check how the input column name is detected and passed to the import; the issue’s example uses a header read followed by colClasses. Done when files with BCG_ATTR values that could be parsed as complex numbers import that column as character across the supported permutations.

Written by the indexing model from the issue text.

Description

Describe the bug
BCG_ATTR can cause issue with complex number.

To Reproduce
Rework import feature as not all permutations.
Server.R

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image

Additional context
From BCGcalc Server.R

Read the file first:

    df_header <- read.delim(fn_inFile
                            , header = TRUE
                            , sep = ","
                            , stringsAsFactors = FALSE
                            , na.strings = c("", "NA")
                            , nrows = 0)
    col_num_bcgattr <- grep("BCG_ATTR", toupper(names(df_header)))
    classes_df <- sapply(df_header, class)
    col_name_bcgattr <- names(df_header)[col_num_bcgattr]

Then use column name present in file during import.

df_input <- read.table(fn_inFile
                             , header = TRUE
                             , sep = ","
                             , stringsAsFactors = FALSE
                             , na.strings = c("", "NA")
                             , colClasses = c(col_name_bcgattr = "character"))
Dominant language
R
Stars
15
Forks
6
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from leppott/BioMonTools

All issues in leppott/BioMonTools

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.