Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: Error in if: missing value where TRUE/FALSE needed #6

Open
Sandra-ctrl opened this issue Feb 28, 2021 · 5 comments
Open

Warning: Error in if: missing value where TRUE/FALSE needed #6

Sandra-ctrl opened this issue Feb 28, 2021 · 5 comments

Comments

@Sandra-ctrl
Copy link

Hi
I can't seem to upload my otu_table.biom file on the Microbiome Explorer
it sent the Error

Warning: Error in if: missing value where TRUE/FALSE needed
  45: <observer>
   2: shiny::runApp
   1: runMicrobiomeExplorer

Please is there something i can do about it, the otu table was generated from a Bioinformatics pipeline (PIPITS)
Kindly Note: previously i used a set of otu tables which worked on the Microbiome Explorer, this is another set of otu data that is refusing to upload.

Thanks

Sandra

@zoecastillo
Copy link
Owner

Is the file called "otu_table.biom"?

I looked at the code and would expect this error to occur if someone attempts to upload a file without a file extension (so something like "otu_table" instead of "otu_table.biom".

If that is not the case, I will have to take a closer look to figure out what is causing the error.

@Sandra-ctrl
Copy link
Author

Hi
Yes the file is called

otu_table.biom

it is a biom file and was generated the same way as for the previous dataset which worked with the Microbiome Explorer .
I also tried to run the scripts directly on Rstudio and i got the following errors;

meData <- filterByPheno(meData, filtList)
Error in `[.data.frame`(pData(MRobj), , r) : undefined columns selected



#scatter plot and color code the points by treatment
makeQCPlot(meData, col_by = "Trt")

Error: Tibble columns must have compatible sizes.
* Size 74: Existing data.
* Size 0: Column `color`.
i Only values of size one are recycled.
Run `rlang::last_error()` to see where the error occurred.
> 

rlang::last_error()
<error/tibble_error_incompatible_size>
Tibble columns must have compatible sizes.
* Size 74: Existing data.
* Size 0: Column `color`.
i Only values of size one are recycled.
Backtrace:
 1. microbiomeExplorer::makeQCPlot(meData, col_by = "Treatment")
 2. tibble::tibble(...)
 3. tibble:::tibble_quos(xs[!is.null], .rows, .name_repair)
 4. tibble:::vectbl_recycle_rows(res, first_size, j, given_col_names[[j]])
Run `rlang::last_trace()` to see the full context.
> 

rlang::last_trace()
<error/tibble_error_incompatible_size>
Tibble columns must have compatible sizes.
* Size 74: Existing data.
* Size 0: Column `color`.
i Only values of size one are recycled.
Backtrace:
    x
 1. \-microbiomeExplorer::makeQCPlot(meData, col_by = "Treatment")
 2.   \-tibble::tibble(...)
 3.     \-tibble:::tibble_quos(xs[!is.null], .rows, .name_repair)
 4.       \-tibble:::vectbl_recycle_rows(res, first_size, j, given_col_names[[j]])

Thanks for your assistance

@zoecastillo
Copy link
Owner

Thank you for sharing those error messages.

They look like some sort of discrepancy with the phenotype data.

After loading the data using readData, are you able to call pData(meData)? Does this look like a proper data frame?
I assume you cannot share the .biom file?

I will spend some time later today to go through the code to see if I can figure out what causes the error.

@zoecastillo
Copy link
Owner

Hi again,

So this first error:

meData <- filterByPheno(meData, filtList)
Error in [.data.frame(pData(MRobj), , r) : undefined columns selected

indicates that one of the values in names(filtList) is not found in the column names of pData(meData).

Similarily for the other issues: If no col_by value is given, the "color" is set to black. If a col_by value is given, it expects a column name of the phenotype data stored in pData. If this column does not exists, an empty factor is created which causes the error when the tibble for the plot is created (because it attempts to combine the empty color factor with the existing phenotype information which has 74 entries).

Within the app, only the names of the pData columns will be given as options to choose for coloring, so this problem should not occur. But I should probably add some error checks to give more useful feedback to users outside of the app.

I don't know if this is also related to the issue you are seeing when uploading the biom file.

Are you able to make this call from Rstudio?

meData <- filterMEData(readData("filepath.biom",
type = "BIOM"),
minpresence = 1, minfeats = 2, minreads = 2)

If so, what happens if you look at the pData(meData)? Do the column names look as expected?

Thanks,
Janina

@Sandra-ctrl
Copy link
Author

Hi
Thanks for your assistance
you are right about the reason for the tibble error
when i called for a scatter plot i wrote

makeQCPlot(meData, col_by = "Trt")

The column was named TREATMENT in capital letters but we called it as small lettered abbreviation
I noticed this when i ran the code

pData(meData)

I have been able to make the scatter plot directly on Rstudio
I followed the instructions in the supplementary data

Supplementary information
Supplementary data are available at Bioinformatics online.

Once i am done making the plots on Rstudio, i will try uploading my biom file directly on the shiny app and see if it works that way
Thanks for your help, i appreciate it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants