andrewrech / antigen.garnish

Other
45 stars 13 forks source link

Running your software via docker #132

Closed beginner984 closed 3 years ago

beginner984 commented 3 years ago

Hello

Our cluster computing group has installed your software via docker on our server like below which directed me to R environment

module load singularity/3.2.1
singularity pull antigen.sing docker://leeprichman/antigen_garnish

module load singularity/3.2.1
singularity exec antigen.sing R script.r

I have a set of .vcf files

I really could not follow how I start now with your software

I get this error

[fi1d18@cyan51 ~]$ module load singularity/3.2.1
[fi1d18@cyan51 ~]$ VCFO="test.vcf"
[fi1d18@cyan51 ~]$ docker cp $VCFO $cID:/$VCFO
-bash: docker: command not found
[fi1d18@cyan51 ~]$ module load singularity/3.2.1
[fi1d18@cyan51 ~]$ module load singularity/3.2.1
[fi1d18@cyan51 ~]$ cID=$(docker run -it -d leeprichman/antigen_garnish /bin/bash)
-bash: docker: command not found
[fi1d18@cyan51 ~]$ docker pull leeprichman/antigen_garnish
-bash: docker: command not found
[fi1d18@cyan51 ~]$ 

Please can you give me some clue to start?

leeprichman commented 3 years ago

Hi beginner!

It would appear that you are using singularity which I am not familiar with. Those directions are meant to be used exclusively with the docker command line interface. I recommend downloading, installing, and configuring Docker and running antigen.garnish that way or running it natively in R on a Linux machine. Unfortunately I don’t have the expertise to help with singularity.

beginner984 commented 3 years ago

Hello

Thank you for your response

I done this which directed me to the R environment

module load singularity/3.2.1
singularity exec antigen.sing R script.r

I then followed the steps in Linux part

But I get this error

> library(magrittr)
> library(data.table)
> library(antigen.garnish)
> 
> dir=getwd()
> file <- file.path(dir, "TUMOR.vcf")
> dt <-  garnish_variants(file)
Loading VCFs
Scanning file to determine attributes.
File attributes:
  meta lines: 9
  header_line: 10
  variant count: 3
  column count: 11
Meta line 9 read in.
All meta lines processed.
gt matrix initialized.
Character matrix gt created.
  Character matrix gt rows: 3
  Character matrix gt cols: 11
  skip: 0
  nrows: 3
  row_num: 0
Processed variant: 3
All variants processed

Done loading variants.
> dt=dt[, MHC := "all_human"]
> # predict neoantigens
> result <- dt %>% garnish_affinity(.)
Reading local transcript metadata.
Error in Sys.setenv(AG_DATA_DIR = ag_dir) : object 'ag_dir' not found
Removing temporary files
> 

Please can you help me in solving this?

Thank you so much for any help

leeprichman commented 3 years ago

Since you are using the docker image, please ensure that the working directory is "/" with setwd("/"). You will need to provide the full path to your input VCF file if it is not present in this new working directory.

beginner984 commented 3 years ago

Sorry this is what I see in my directly

> getwd()
[1] "/mainfs/home/fi1d18"
> list.files()
[1] "MSIpred"        "TUMOR.vcf"      "__MACOSX"       "antigen.sing"  
[5] "test.maf"       "vcf2maf-1.6.18" "vcf2maf.zip"   
>

What is the AG_DATA_DIR?

> library(magrittr)
> library(data.table)
> library(antigen.garnish)
> 
> dir=getwd()
> file <- file.path(dir, "TUMOR.vcf")
> dt <-  garnish_variants(file)
Loading VCFs
Scanning file to determine attributes.
File attributes:
  meta lines: 9
  header_line: 10
  variant count: 3
  column count: 11
Meta line 9 read in.
All meta lines processed.
gt matrix initialized.
Character matrix gt created.
  Character matrix gt rows: 3
  Character matrix gt cols: 11
  skip: 0
  nrows: 3
  row_num: 0
Processed variant: 3
All variants processed

Done loading variants.
> dt=dt[, MHC := "all_human"]
> # predict neoantigens
> result <- dt %>% garnish_affinity(.)
Reading local transcript metadata.
Error in Sys.setenv(AG_DATA_DIR = ag_dir) : object 'ag_dir' not found
Removing temporary files
> 
leeprichman commented 3 years ago

Are you using the docker image or did you directly install on Linux?

If you are using docker, it is the antigen.garnish directory included in the "/" directory and you need to run the analysis with the working directory set as "/". setwd("/") and list.files() would show you the directory.

If you performed a direct linux installation, you need to download the data directory and configure the netMHC binaries as indicated in the installation section with curl commands. I recommend placing the antigen.garnish data directory in the $HOME directory where the software will detect it automatically, but you can put it anywhere if you set the AG_DATA_DIR environmental variable to the path to this directory.

leeprichman commented 3 years ago

https://github.com/immune-health/antigen.garnish#installation-1

beginner984 commented 3 years ago

Sorry I am using the docker image

In getwd() I can not see the antigen.garnish

You meant I should put antigen.garnish in "/mainfs/home/fi1d18". ?

> getwd()
[1] "/mainfs/home/fi1d18"
> list.files()
[1] "MSIpred"        "TUMOR.vcf"      "__MACOSX"       "antigen.sing"  
[5] "test.maf"       "vcf2maf-1.6.18" "vcf2maf.zip"   
>
leeprichman commented 3 years ago

Your current working directory appears to be set to "/mainfs/home/fi1d18" and you need to set it to "/" prior to running garnish_affinity. This can be done with setwd("/").

The docker image root directory "/" contains the antigen.garnish data folder and R must have the working directory set there for the package to function.

beginner984 commented 3 years ago

Thank you so much my reference genome is hg19

I passed from this error and I got another error

> setwd("/")
> list.files()
 [1] "ag"              "antigen.garnish" "bin"             "boot"           
 [5] "dev"             "environment"     "etc"             "home"           
 [9] "lib"             "lib64"           "mainfs"          "media"          
[13] "mnt"             "opt"             "proc"            "root"           
[17] "run"             "sbin"            "scratch"         "singularity"    
[21] "srv"             "sys"             "tmp"             "usr"            
[25] "var"            
> result <- dt %>% garnish_affinity(.)
Reading local transcript metadata.
Checking netMHC scripts in antigen.garnish data directory.
Done.
Generating variants
Generating nmers
Filtering WT peptide matches.
Checking netMHC scripts in antigen.garnish data directory.
Done.
Error in .Call2("new_output_filexp", filepath, append, compress, compression_level,  : 
  cannot open file 'Hu_ag_nmer_fasta.fa'
In addition: Warning message:
In .Call2("DNAStringSet_translate", x, skip_code, dna_codes[codon_alphabet],  :
  last 2 bases were ignored
Removing temporary fasta files
Error in eval(lhs, parent, parent) : object 'blast_out' not found
Removing temporary files
> 
leeprichman commented 3 years ago

To try to narrow this down. Are you able to get the readme example to work?

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

# load an example VCF
dir <- system.file(package = "antigen.garnish") %>%
       file.path(., "extdata/testdata")

file <- file.path(dir, "TUMOR.vcf")

# extract variants
dt <-  garnish_variants(file)

# add space separated MHC types
# see list_mhc() for nomenclature of supported alleles
# MHC may also be set to "all_human" or "all_mouse" to use all supported alleles

dt[, MHC := c("HLA-A*01:47 HLA-A*02:01 HLA-DRB1*14:67")]

# predict neoantigens
result <- dt %>% garnish_affinity(.)

result %>% str
beginner984 commented 3 years ago

I get this error again

> dt=dt[, MHC := c("HLA-A*01:47 HLA-A*02:01 HLA-DRB1*14:67")]
> result <- dt %>% garnish_affinity(.)
Reading local transcript metadata.
Checking netMHC scripts in antigen.garnish data directory.
Done.
Generating variants
Generating nmers
Filtering WT peptide matches.
Checking netMHC scripts in antigen.garnish data directory.
Done.
Error in .Call2("new_output_filexp", filepath, append, compress, compression_level,  : 
  cannot open file 'Hu_ag_nmer_fasta.fa'
In addition: Warning message:
In .Call2("DNAStringSet_translate", x, skip_code, dna_codes[codon_alphabet],  :
  last 2 bases were ignored
Removing temporary fasta files
Error in eval(lhs, parent, parent) : object 'blast_out' not found
Removing temporary files
> 
leeprichman commented 3 years ago

It's unclear to me if this is the test data provided in the package or your own personal vcf file. If it is the latter, can you try running the test data from the package as above?

beginner984 commented 3 years ago

Sorry this is your example "TUMOR.vcf" I downloaded from your GitHub

This is the files I see in working directory

> list.files()
 [1] "ag"              "antigen.garnish" "bin"             "boot"           
 [5] "dev"             "environment"     "etc"             "home"           
 [9] "lib"             "lib64"           "mainfs"          "media"          
[13] "mnt"             "opt"             "proc"            "root"           
[17] "run"             "sbin"            "scratch"         "singularity"    
[21] "srv"             "sys"             "tmp"             "usr"            
[25] "var"            
> getwd()
[1] "/"
> 
leeprichman commented 3 years ago

Are you running the antigen_garnish or antigen_garnish_2 docker?

beginner984 commented 3 years ago

Thank you so much

I think antigen_garnish because by this I have been. directed to the R environment

module load singularity/3.2.1
singularity pull antigen.sing docker://leeprichman/antigen_garnish
module load singularity/3.2.1
singularity exec antigen.sing R script.r

I then followed the workflow for Linux

leeprichman commented 3 years ago

I was not able to reproduce this error on either the antigen_garnish or antigen_garnish_2 docker myself. I recommend trying a fresh docker container and pulling the latest image and trying to run the README example as written again.

Because of the considerable updates and streamlined package, I recommend using version 2.0 with docker pull leeprichman/antigen_garnish_2 and following the instructions in the README.

Of note, I am not familiar with singularity and it is possible that the package does not function as intended with that method of container management because of how paths and system variables might behave. If you continue to have errors I would work directly through docker, I can't promise that it will work with singularity running docker containers.

beginner984 commented 3 years ago

Thank you so much I am just installing docker pull leeprichman/antigen_garnish_2

To see what would happen

Screenshot 2020-10-20 at 21 09 03
beginner984 commented 3 years ago

Sorry I got an error likely due to the lack of space

I will create a ticket for iSolution group right now

Screenshot 2020-10-20 at 21 24 32
beginner984 commented 3 years ago

Sorry as antigen_garnish_2 gave the same error with singularity

I tried to install docker on my Mac like

brew cask install docker
pip3 install docker-compose
open -a Docker

But

(base) loan-mac-13:~ fi1d18$ docker pull leeprichman/antigen_garnish
Using default tag: latest
Error response from daemon: dial unix docker.raw.sock: connect: no such file or directory
(base) loan-mac-13:~ fi1d18$  

Have you seen such an error already?

Thank you so much for any help

Screenshot 2020-10-22 at 18 40 43
leeprichman commented 3 years ago

I would install the Docker GUI on MacOS and configure your virtual machine that way, then it may be run from the command line.

https://www.docker.com/get-started

If you want to run Docker on Linux on your cluster remotely rather than a local machine, you will need to work with your support team there to get it running properly within their constraints.

beginner984 commented 3 years ago

I installed the wale application like this but I get the same error

Screenshot 2020-10-22 at 18 58 37
leeprichman commented 3 years ago

Hmm, this looks like something wrong with your docker install on your local machine.

https://github.com/docker/for-mac/issues/4155

I would try a system restart and making sure the docker daemon is up and running through the app before you try to docker pull leeprichman/antigen_garnish_2.

beginner984 commented 3 years ago

Sorry by adding Sys.setenv("AG_DATA_DIR"="/") after libraries the error changed to this

> result <- dt %>% garnish_affinity(.)
Reading local transcript metadata.
Error in configure_netMHC_tools(ag_dir) : 
  netMHC parent directory in antigen.garnish data directory not found.
Removing temporary files

Then I though I may should copy netMHC tar.gz files to the container

I download those 4 files

[fi1d18@cyan51 ~]$ ls
MSIpred      antigen.sing                  netMHCII-2.3.Linux.tar
NeoPredPipe  antigen_garnish_2_latest.sif  netMHCIIpan-4.0.Linux.tar
TUMOR.vcf    mhcflurry_latest.sif          netMHCpan-4.1b.Linux.tar
__MACOSX     netMHC-4.0a.Linux.tar         vcf2maf-1.6.18

I done this and I got this

[fi1d18@cyan51 ~]$ singularity docker cp netMHC-4.0a.Linux.tar.gz $cID:/netMHC-4.0a.Linux.tar.gz
-bash: singularity: command not found
[fi1d18@cyan51 ~]$ docker cp netMHC-4.0a.Linux.tar.gz $cID:/netMHC-4.0a.Linux.tar.gz
-bash: docker: command not found
[fi1d18@cyan51 ~]$

Can you please help me with this?

Thank you

Screenshot 2020-10-23 at 02 07 12
leeprichman commented 3 years ago

Hi Beginner,

Because we are not allowed to redistribute the netMHC binaries, the docker image does not contain those tools. After the docker image is downloaded, a container must be launched and those tools must be copied and configured prior to running antigen.garnish. Unfortunately, this means every docker container launched must repeat this process. The README has the directions to complete the process in the installation section. The usage section then shows how to load data on and run the container interactively. Please follow those instructions to use antigen.garnish with Docker.

It appears that either docker is not correctly installed or the command is not in $PATH. It looks like it erred when you attempted to copy the netMHC tarballs over, however it likely erred on the docker pull and docker run steps just above as well. I would look into how to troubleshoot your docker setup on your mac first. This page might help: https://docs.docker.com/get-started/#test-docker-installation

antigen.garnish has not been set up explicitly to work with any other container management system such as singularity, so while it may be possible to run it that way, I would not know where to start.

beginner984 commented 3 years ago

Thank you so much finally I connected to the docker on my own Mac

but I run out of space error when I was pulling your software while I had changed the storage folder to an external memory which likely has enough space

Many times I have cleared the docker catch and re-run

Screenshot 2020-10-23 at 12 36 37
leeprichman commented 3 years ago

You can change the default storage location for Docker images under the Preferences/Resources tab (scroll to the bottom if the window is too small to see it) in Docker Desktop. That may solve this for you. I would restart as well to make sure it takes effect.

beginner984 commented 3 years ago

Sorry finally I pulled your software now I get this

> dt <-  garnish_variants(file)
Loading VCFs
Scanning file to determine attributes.
File attributes:
  meta lines: 9
  header_line: 10
  variant count: 3
  column count: 11
Meta line 9 read in.
All meta lines processed.
gt matrix initialized.
Character matrix gt created.
  Character matrix gt rows: 3
  Character matrix gt cols: 11
  skip: 0
  nrows: 3
  row_num: 0
Processed variant: 3
All variants processed
Error: could not find function "%likef%"
> 
Screenshot 2020-10-23 at 15 43 11
leeprichman commented 3 years ago

library(dt.inflix) should fix that. Let me know how it goes after that.

beginner984 commented 3 years ago

Sorry that error gone and this came for the next line of code

Screenshot 2020-10-23 at 17 27 41
> result <- dt %>% garnish_affinity(.)
Generating metadata.
Reading local transcript metadata.
Environmental variable AG_DATA_DIR for the antigen.garnish data directory is unset. Checking standard directories.
Checking netMHC scripts in antigen.garnish data directory.
Downloading data for netMHC-4.0
Error in setwd(dirname(i)) : cannot change working directory
In addition: Warning message:
In file.rename("dtu.tar.gz", dtar) :
  cannot rename file 'dtu.tar.gz' to 'netMHC-4.0/dtu.tar.gz', reason 'No such file or directory'
leeprichman commented 3 years ago

What does list.files("/antigen.garnish/netMHC/", recursive = TRUE, full.names = TRUE) return?

beginner984 commented 3 years ago

Thank you

> list.files("/antigen.garnish/netMHC/", recursive = TRUE, full.names = TRUE)
[1] "/antigen.garnish/netMHC//dtu.tar.gz"
> 
leeprichman commented 3 years ago

It looks like the config_netMHC.sh was not run. I recommend you stop and delete this container with docker stop $cID; docker rm $cID, and relaunch a fresh one following the readme instructions. I have reproduced them below:

docker pull leeprichman/antigen_garnish_2

cID=$(docker run -it -d leeprichman/antigen_garnish_2 /bin/bash)

docker cp netMHC-4.0a.Linux.tar.gz $cID:/netMHC-4.0a.Linux.tar.gz
docker cp netMHCII-2.3.Linux.tar.gz $cID:/netMHCII-2.3.Linux.tar.gz
docker cp netMHCpan-4.1b.Linux.tar.gz $cID:netMHCpan-4.1b.Linux.tar.gz
docker cp netMHCIIpan-4.0.Linux.tar.gz $cID:netMHCIIpan-4.0.Linux.tar.gz

docker exec $cID config_netMHC.sh

Then launch R interactively with: docker exec -it $cID R

Then you should be able to run the README example.

beginner984 commented 3 years ago

Sorry I exactly followed what you kindly suggested but I got this

> result <- dt %>% garnish_affinity(.)
Generating metadata.
Reading local transcript metadata.
Environmental variable AG_DATA_DIR for the antigen.garnish data directory is unset. Checking standard directories.
Checking netMHC scripts in antigen.garnish data directory.
Downloading data for netMHC-4.0
Error in setwd(dirname(i)) : cannot change working directory
In addition: Warning message:
In file.rename("dtu.tar.gz", dtar) :
  cannot rename file 'dtu.tar.gz' to 'netMHC-4.0/dtu.tar.gz', reason 'No such file or directory'
Removing temporary files.
> 

Do you think this is because I downloaded files in .tar from website but in your tutorial is tar.gz like docker cp netMHC-4.0a.Linux.tar.gz $cID:/netMHC-4.0a.Linux.tar.gz. ?

leeprichman commented 3 years ago

That is possible. What happens when you run config_netMHC.sh?

In the meantime, you can also simply gzip those files to make them into tar.gz and run the config_netMHC.sh script again.

beginner984 commented 3 years ago

I changed to gzip

This is the output of config_netMHC.sh script

(base) loan-mac-13:~ fi1d18$ docker exec $cID config_netMHC.sh
netMHCII-2.3/
netMHCII-2.3/test/
netMHCII-2.3/test/comm
netMHCII-2.3/test/test.fsa
netMHCII-2.3/test/test.fsa.out
netMHCII-2.3/test/test.pep
netMHCII-2.3/test/test.pep.out
netMHCII-2.3/test/time
netMHCII-2.3/test/aa
netMHCII-2.3/netMHCII.1
netMHCII-2.3/netMHCII-2.3.readme
netMHCII-2.3/Linux_x86_64/
netMHCII-2.3/Linux_x86_64/bin/
netMHCII-2.3/Linux_x86_64/bin/nnalign_gaps_pan_play-2.0b
netMHCII-2.3/Linux_x86_64/bin/netMHCII
netMHCII-2.3/Linux_x86_64/bin/fasta2pep
netMHCII-2.3/Linux_x86_64/data
netMHCII-2.3/netMHCII-2.3
netMHCpan-4.1/
netMHCpan-4.1/netMHCpan
netMHCpan-4.1/netMHCpan.1
netMHCpan-4.1/netMHCpan-4.1.readme
netMHCpan-4.1/Linux_x86_64/
netMHCpan-4.1/Linux_x86_64/data
netMHCpan-4.1/Linux_x86_64/bin/
netMHCpan-4.1/Linux_x86_64/bin/mhcfsa2psseq
netMHCpan-4.1/Linux_x86_64/bin/nnalign_gaps_pan_play_MA_wgt_MN_v2_two_outputs_context_allelelist_pboth
netMHCpan-4.1/Linux_x86_64/bin/estimate_PCC
netMHCpan-4.1/Linux_x86_64/bin/netMHCpan
netMHCpan-4.1/test/
netMHCpan-4.1/test/B0702.fsa
netMHCpan-4.1/test/test.pep
netMHCpan-4.1/test/test.fsa
netMHCpan-4.1/test/test.pep.out
netMHCpan-4.1/test/comm
netMHCpan-4.1/test/NetMHCpan_out.xls
netMHCpan-4.1/test/test.fsa.out
netMHCpan-4.1/test/test.pep_userMHC.out
netMHCpan-4.1/test/test.pep_BA.out
netMHCpan-4.1/test/test.pep_wBA.out
netMHCIIpan-4.0/
netMHCIIpan-4.0/NetMHCIIpan-4.0.pl
netMHCIIpan-4.0/test/
netMHCIIpan-4.0/test/example.pep
netMHCIIpan-4.0/test/example.pep.out
netMHCIIpan-4.0/test/example.pep_BA.out
netMHCIIpan-4.0/test/example.pep_context
netMHCIIpan-4.0/test/example.pep_context.out
netMHCIIpan-4.0/test/example.pep_context_BA.out
netMHCIIpan-4.0/test/example.fsa
netMHCIIpan-4.0/test/example.fsa.out
netMHCIIpan-4.0/test/example.fsa_context.out
netMHCIIpan-4.0/test/example.fsa.sorted.out
netMHCIIpan-4.0/test/DRB10101.fsa
netMHCIIpan-4.0/test/alpha.dat
netMHCIIpan-4.0/test/beta.dat
netMHCIIpan-4.0/test/comm
netMHCIIpan-4.0/test/example.fsa_hlaseq.out
netMHCIIpan-4.0/test/example.fsa_hlaseq_A+B.out
netMHCIIpan-4.0/netMHCIIpan
netMHCIIpan-4.0/netMHCIIpan.1
netMHCIIpan-4.0/Linux_x86_64/
netMHCIIpan-4.0/Linux_x86_64/data
netMHCIIpan-4.0/Linux_x86_64/bin/
netMHCIIpan-4.0/Linux_x86_64/bin/make_P1_hist_frames.R
netMHCIIpan-4.0/Linux_x86_64/bin/mhcfsa2psseq
netMHCIIpan-4.0/Linux_x86_64/bin/nnalign_gaps_pan_play_MA_wgt_MN_v2_two_outputs_context_allelelist_pboth
netMHCIIpan-4.0/netMHCIIpan-4.0.readme

But I got the same error

Screenshot 2020-10-23 at 19 50 03
> getwd()
[1] "/"
> list.files()
 [1] "ag"                           "antigen.garnish"             
 [3] "bin"                          "boot"                        
 [5] "dev"                          "Dockerfile_dev"              
 [7] "etc"                          "home"                        
 [9] "lib"                          "lib32"                       
[11] "lib64"                        "libx32"                      
[13] "media"                        "mnt"                         
[15] "netMHC-4.0a.Linux.tar.gz"     "netMHCII-2.3.Linux.tar.gz"   
[17] "netMHCIIpan-4.0.Linux.tar.gz" "netMHCpan-4.1b.Linux.tar.gz" 
[19] "opt"                          "proc"                        
[21] "root"                         "run"                         
[23] "sbin"                         "srv"                         
[25] "sys"                          "tmp"                         
[27] "usr"                          "var"                         
> 
leeprichman commented 3 years ago

I don't see netMHC being unpacked on that output but it might have gotten cut off and I see all the tars are present in the working directory. During the set up process, data from DTU must be downloaded in order for netMHC to work. It's possible that this connection is timing out. What happens when you run:


link <- "http://www.cbs.dtu.dk/services/NetMHC-4.0/data.tar.gz"

cmd <- paste("curl -fsSL", link, ">", "dtu.tar.gz")

curl_status <- system(cmd, intern = TRUE, ignore.stderr = TRUE)

curl_status
beginner984 commented 3 years ago

Thank you

I saw this

> link <- "http://www.cbs.dtu.dk/services/NetMHC-4.0/data.tar.gz"
> cmd <- paste("curl -fsSL", link, ">", "dtu.tar.gz")
> curl_status <- system(cmd, intern = TRUE, ignore.stderr = TRUE)
> curl_status
character(0)
> 
leeprichman commented 3 years ago

How about just the console output from system(cmd)

beginner984 commented 3 years ago

Thank you I saw nothing

Screenshot 2020-10-23 at 20 11 54
leeprichman commented 3 years ago

Ok, try backing out of R into the shell and running: curl -fsSL http://www.cbs.dtu.dk/services/NetMHC-4.0/data.tar.gz > test.tar.gz

beginner984 commented 3 years ago

Sorry, please have a look at screenshots of both shell and R

After shell I saw this in R

> test.tar.gz
Error: object 'test.tar.gz' not found
>
Screenshot 2020-10-23 at 20 17 05
leeprichman commented 3 years ago

Can you quit out of R in the docker container with q(), then if you are in the docker shell type exit. Once you are back on your local machine's command line run docker exec -it $cID bash to reenter the container.

From here, can you run the curl command curl -fsSL http://www.cbs.dtu.dk/services/NetMHC-4.0/data.tar.gz > test.tar.gz

beginner984 commented 3 years ago

Sorry in R I typed q(), in terminal I type exit

I then opened another shell and typed curl -fsSL http://www.cbs.dtu.dk/services/NetMHC-4.0/data.tar.gz

Nothing happening

Screenshot 2020-10-23 at 20 40 03
leeprichman commented 3 years ago

$cID is a placeholder for the container name for the container you had running. It will not persist across terminal sessions so you will need to replace that with the name of the container, which can be found with docker ps -a. They are usually two word phrases separated by a hyphen.

I think what the problem might be here is that your docker container is unable to reach the DTU server to download the supplemental data to run netMHC. You may need to try a different network if your institution's firewall is preventing the connection. Ultimately, its challenging to do this level of personal technical support remotely, I would consider reaching out to others at your institution who might be able to help you troubleshoot. I have not been able to reproduce the errors you have been getting unfortunately so I do not think it is a problem with the package or docker image.

beginner984 commented 3 years ago

Sorry

Is it possible for you to access to this machine by TeamViewer to see what is happening?

I have tried again after disconnecting from University VPN but error is the same

I have created a ticket but IT department only helps in installing tools on the cluster not running the tools

Actually for long time I am trying to predict Neoantigen load as I have been asked but most of tools need a lot of dependencies like VEP, annover, etc

Thank you for any help

leeprichman commented 3 years ago

Unfortunately, I cannot provide that level of personal support at this time. I would first try checking if you can run curl -fsSL http://www.cbs.dtu.dk/services/NetMHC-4.0/data.tar.gz > ~/Downloads/test.tar.gz and make sure it actually creates an output file in your downloads folder. Then I would test from within the docker container by launching a new container and following these steps:

cID=$(docker run -it -d leeprichman/antigen_garnish_2 /bin/bash)

docker cp netMHC-4.0a.Linux.tar.gz $cID:/netMHC-4.0a.Linux.tar.gz
docker cp netMHCII-2.3.Linux.tar.gz $cID:/netMHCII-2.3.Linux.tar.gz
docker cp netMHCpan-4.1b.Linux.tar.gz $cID:netMHCpan-4.1b.Linux.tar.gz
docker cp netMHCIIpan-4.0.Linux.tar.gz $cID:netMHCIIpan-4.0.Linux.tar.gz

docker exec $cID config_netMHC.sh

docker exec -it $cID bash

curl -fsSL http://www.cbs.dtu.dk/services/NetMHC-4.0/data.tar.gz > /test.tar.gz

ls /

If test.tar.gz is not showing up in the / directory on the container, you are unable to connect to the DTU server and download the necessary data and will need to work with your IT support or find another network to connect to.

beginner984 commented 3 years ago

Sorry

by this I can download that file

wget http://www.cbs.dtu.dk/services/NetMHC-4.0/data.tar.gz

But I don't know how ask the container to download the data from DTU by this

Last login: Fri Oct 23 21:06:36 on ttys001
(base) pc-133-235:~ fi1d18$ wget http://www.cbs.dtu.dk/services/NetMHC-4.0/data.tar.gz
--2020-10-23 22:47:17--  http://www.cbs.dtu.dk/services/NetMHC-4.0/data.tar.gz
Resolving www.cbs.dtu.dk (www.cbs.dtu.dk)... 192.38.86.22
Connecting to www.cbs.dtu.dk (www.cbs.dtu.dk)|192.38.86.22|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 63384960 (60M) [application/x-gzip]
Saving to: ‘data.tar.gz’

data.tar.gz         100%[===================>]  60.45M  9.26MB/s    in 6.9s    

2020-10-23 22:47:25 (8.81 MB/s) - ‘data.tar.gz’ saved [63384960/63384960]

(base) pc-133-235:~ fi1d18$ ls
Applications            TUMOR.vcf
Desktop             data.tar.gz
Documents           llvm-project
Downloads           netMHC-4.0a.Linux.tar.gz
Library             netMHCII-2.3.Linux.tar.gz
Movies              netMHCIIpan-4.0.Linux.tar.gz
Music               netMHCpan-4.1b.Linux.tar.gz
Pictures            opt
Public
leeprichman commented 3 years ago

Unfortunately, there isn't a straightfoward way to do this that doesn't involve editing the source code. I'm not sure why curl is not working for you but wget is. If you want to attempt it, you can enter the container and use vi to edit the file /ag/R/antigen.garnish_run.R line 267 and replace "curl -fsSL" with "wget". Then save the file and reinstall with devtools and attempt again. I can't promise this will work. We used curl to be more compatible with different versions of Linux. You can try:

cID=$(docker run -it -d leeprichman/antigen_garnish_2 /bin/bash)

docker cp netMHC-4.0a.Linux.tar.gz $cID:/netMHC-4.0a.Linux.tar.gz
docker cp netMHCII-2.3.Linux.tar.gz $cID:/netMHCII-2.3.Linux.tar.gz
docker cp netMHCpan-4.1b.Linux.tar.gz $cID:netMHCpan-4.1b.Linux.tar.gz
docker cp netMHCIIpan-4.0.Linux.tar.gz $cID:netMHCIIpan-4.0.Linux.tar.gz

docker exec $cID config_netMHC.sh

docker exec -it $cID bash

vi /ag/R/antigen_garnish_run.R

Then edit the line 267 by hand and save with :wq. Now reinstall ag in this container with:

Rscript -e 'devtools::install("/ag")'

And then reattempt the README example.

beginner984 commented 3 years ago

Thank you

I contacted the software developer in DTU and he says this

You need to download the softwares from the download tab at

https://services.healthtech.dtu.dk/service.php?NetMHC-4.0

And next following the installation instructions send to you together with the software package

But I don't know if this makes sense for a docker image

leeprichman commented 3 years ago

Yes, we tried to wrap the download and configuration of the netMHC algorithms for convenience using the config_netMHC.sh and configure_netMHC functions in the package. However because the curl call to download the data does not seem to be working for you, the only solution is to either try switching to wget using the steps above, or set up the docker container and move the preconfigured netMHC folders onto the container.

If you would like to try the latter, download the data file for each tool and untar the data in each directory (follow each netMHC tools readme instructions exactly to do this). If you then turn those back into tar.gz and move them onto the container and run the configuration script, it should automatically rewrite the netMHC path variables and add to $PATH.