andrewrech / antigen.garnish

Other
46 stars 13 forks source link

Config of netMHC may lead to error in `garnish_affinity()` #114

Closed SilenWang closed 4 years ago

SilenWang commented 4 years ago

Hi, Lee After modifying the resource limit of the container, the demo still can not work properly... The main error was:

/antigen.garnish/netMHC/netMHC-4.0/netMHC: line 39:   923 Segmentation fault      (core dumped) $NETMHC/bin/netMHC $*
/antigen.garnish/netMHC/netMHC-4.0/netMHC: line 39:   931 Segmentation fault      (core dumped) $NETMHC/bin/netMHC $*
/antigen.garnish/netMHC/netMHC-4.0/netMHC: line 39:   939 Segmentation fault      (core dumped) $NETMHC/bin/netMHC $*
/antigen.garnish/netMHC/netMHC-4.0/netMHC: line 39:   947 Segmentation fault      (core dumped) $NETMHC/bin/netMHC $*
/antigen.garnish/netMHC/netMHC-4.0/netMHC: line 39:   955 Segmentation fault      (core dumped) $NETMHC/bin/netMHC $*
/antigen.garnish/netMHC/netMHC-4.0/netMHC: line 39:   963 Segmentation fault      (core dumped) $NETMHC/bin/netMHC $*
/antigen.garnish/netMHC/netMHC-4.0/netMHC: line 39:   971 Segmentation fault      (core dumped) $NETMHC/bin/netMHC $*

But since I ran the container in a virtual machine with very limited resources, I suppose that netMHC failed due to insufficient resources, so I tried to install antigen.garnish to our computing node(without using docker since I'm not administrator) and ran the demo.

Unfortunately... I still got some error:

Merging output
Error in l[[dti]]$command : $ operator is invalid for atomic vectors
In addition: Warning message:
In parallel::mclapply(esl, function(es) { :
  all scheduled cores encountered errors in user code
Removing temporary files

And by viewing the log file, I noticed that netMHC may not work properly, the NMHOME was set to ~/antigen.garnish/netMHC/netMHC_program for all cli program in netMHC, this may work inside the docker image since it launched with the root account. But when running as normal user, this may lead to error since the files may not be extracted to home of the current user.

So, in order to make the netMHC work properly, I think you can either modify NMHOME of every netMHC program in your package to $(cd`dirname $0`; pwd) so that the program will get the right path automatically or add a step in your install guidance to ask the user to modify the path config of netMHC themselves.

Silen

leeprichman commented 4 years ago

Hi Silen,

It does look like your docker container issue continues to be running out of resources as you said. Are you still trying to run all human alleles or just the 3 listed in the updated example code?

If you replace "all_human" with fewer alleles of interest, the resources required to complete the example will be far fewer. Since #112 I have changed the example in the documentation to only use a few MHC alleles of interest to be less resource intensive. If you intend to only run a smaller subset of alleles for analysis of your own data, your docker container and its current resources should be adequate for a well-filtered and intersected vcf or a few proteins of interest.

The example now looks like:

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

 dt <- data.table::data.table(
           sample_id = "test",
           pep_mut = "MTEYKLVVVGAGDVGKSALTIQLIQNHFVDEYDP",
           mutant_index = "12",
           MHC = "HLA-A*02:01 HLA-A*68:01 HLA-B*07:02") %>%
  garnish_affinity %T>%
  str

Installing antigen.garnish directly to a linux OS requires sudo permissions to set paths correctly, and we don't have a workaround for it right now. If you are able to manually install and set the PATH for all the netMHC tools, mhcflurry, mhcnuggets, and BLAST without requiring sudo permissions, it might function, but I have not tried this myself and cannot vouch for its accuracy. The wiki has instructions on how to bootstrap a fresh AWS ubuntu instance which will have root permissions for antigen.garnish, if that is an option for you.

-Lee

SilenWang commented 4 years ago

Oh, I got that. Now antigen.garnish on the computing node seems to work fine, but maybe I should find some way to get the docker container work so that I could check if the copy on the computing node is producing the right result?

leeprichman commented 4 years ago

You can check that the installed copy of antigen.garnish is working properly by running the unit tests in the package: testthat::test_package("antigen.garnish")

SilenWang commented 4 years ago

OK, Thanks!