andrewrech / antigen.garnish

Other
45 stars 13 forks source link

Error when running example in document #110

Closed SilenWang closed 4 years ago

SilenWang commented 4 years ago

Hello, I'm trying to run antigen.garnish inside the docker image using example code provided in the document:

     library(magrittr)
     library(data.table)
     library(antigen.garnish)

      dt <- data.table::data.table(
               sample_id = "test",
               pep_mut = "MTEYKLVVVGAGDVGKSALTIQLIQNHFVDEYDP",
               mutant_index = "12",
               MHC = "all") %>%
      garnish_affinity %T>%
      str

And an error occurred:

Error in if (length(blastdt) == 0 || all(file.info(blastdt)$size == 0)) { : 
  missing value where TRUE/FALSE needed

How can I fix this?

Silen

leeprichman commented 4 years ago

Hi Silen,

Looks like it is erroring because BLAST isn’t producing an output file. What does system(“which blastp”) return?

leeprichman commented 4 years ago

Looks like this is an unanticipated logic error. Species for blast is determined by MHC patterns, but "all" has not been replaced by actual allele names yet. I will add a check to prevent this. In the meantime please try rerunning with explicit hla alleles in the table such as "HLA-A02:01 HLA-A68:01 HLA-B*07:02"

leeprichman commented 4 years ago

Addressed in #111 and 317ed0a

New docker image built and pushed. Please reopen if there are any other issues. There is a new example in the documentation, please use "all_human" or "all_mouse" instead of "all" for MHC.

Thanks @SilenWang for catching this!

SilenWang commented 4 years ago

Hi, Lee Thanks a lot for your rapidly reply! But now I came across a new error:

Error in system("which mhcflurry-predict 2> /dev/null", intern = TRUE) : 
  cannot popen 'which mhcflurry-predict 2> /dev/null', probable reason 'Cannot allocate memory'
Removing temporary files

And below is the code I ran:

library(magrittr)
library(data.table)
library(antigen.garnish)

dt <- data.table::data.table(
        sample_id = "test",
        pep_mut = "MTEYKLVVVGAGDVGKSALTIQLIQNHFVDEYDP",
        mutant_index = "12",
        MHC = "all_human") %>%
garnish_affinity %T>%
str

I tried to run which mhcflurry-predict 2> /dev/null directly in the container, and it could return the location of mhcflurry-predict correctly.

And I also tried to reopen an R process and run system("which mhcflurry-predict 2> /dev/null", intern = TRUE) before running the above code block, and it could also work correctly.

So the problem seems to be that the system() can't work correctly after running the above code block.

Silen