richelbilderbeek / netmhc2pan

R package for NetMHCIIpan

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

netmhc2pan

CRAN_Status_Badge

Branch GitHub Actions logo Codecov logo
master R-CMD-check codecov.io
develop R-CMD-check codecov.io

R package for NetMHCIIpan [1].

Please note that this page is intended for academic users only. Other users are requested to contact the Software Package Manager at health-software@dtu.dk

Install

Use remotes to install the netmhc2pan package:

remotes::install_github("richelbilderbeek/netmhc2pan")

Load the netmhc2pan library:

library(netmhc2pan)

Install NetMHCIIpan to a default folder using netmhc2pan and a download URL. The download URL can be obtained from the NetMHCIIpan website at https://services.healthtech.dtu.dk/services/NetMHCIIpan-3.2/ (at the 'Downloads' tab) and expires after four hours.

install_netmhc2pan("https://services.healthtech.dtu.dk/download/fb4dee93-ddbb-4639-ab21-45fdfd0ed23e")

Installation troubleshooting

URL is expired

Request a new download link

cannot open URL 'https://services.healthtech.dtu.dk/download/[number]/netMHCIIpan-3.2.Linux.tar.gz'

From a fresh download link, you can download the file, yet not install using the install_netmhc2pan function.

In that case, use the install_netmhc2pan_bin_from_file function:

install_netmhc2pan_bin_from_file("netMHCIIpan-3.2.Linux.tar.gz")

This function assumes that the file netMHCIIpan-3.2.Linux.tar.gz is in the working directory.

After this, install like normal:

install_netmhc2pan()

cannot open URL 'https://www.cbs.dtu.dk/services/NetMHCIIpan-3.2/data.Linux.tar.gz'

This happens when the university website is down (yes, this has happened!).

In that case, use the install_netmhc2pan_data_from_file function:

install_netmhc2pan_data_from_file("data.Linux.tar.gz")

This function assumes that the file data.Linux.tar.gz is in the working directory.

After this, install like normal:

install_netmhc2pan()

Usage

We start from a FASTA file with one or more protein sequences:

fasta_filename <- system.file(
  "extdata", "example.fasta", package = "netmhc2pan"
)

This is how to content of such a FASTA file looks like:

message(readLines(fasta_filename), sep = "\n")
>sp|L0T550|RIP2_MYCTU_158_180
AVLWAGVAFLAFLQLTALVLNLL

MHC2 has multiple alleles that bind differently to protein parts. NetMHCIIpan supports more than 5000 alleles:

all_alleles <- get_netmhc2pan_alleles()
testit::assert(length(all_alleles) > 5000)

We simply pick the first two alleles:

alleles <- all_alleles[1:2]

Running the NetMHCIIpan analysis:

bindings <- run_netmhc2pan(
  fasta_filename = fasta_filename,
  alleles = alleles
)

The data frame bindings contains the results:

knitr::kable(bindings)
Pos Peptide ID Allele one_minus_log50k nM Rank
1 AVLWAGVAFLAFLQL sp|L0T550|RIP2_MYCTU_158_180 DRB1_0101 0.510 201.09 39.0
2 VLWAGVAFLAFLQLT sp|L0T550|RIP2_MYCTU_158_180 DRB1_0101 0.475 293.98 47.0
3 LWAGVAFLAFLQLTA sp|L0T550|RIP2_MYCTU_158_180 DRB1_0101 0.524 172.31 36.0
4 WAGVAFLAFLQLTAL sp|L0T550|RIP2_MYCTU_158_180 DRB1_0101 0.566 109.07 26.0
5 AGVAFLAFLQLTALV sp|L0T550|RIP2_MYCTU_158_180 DRB1_0101 0.602 73.94 19.0
6 GVAFLAFLQLTALVL sp|L0T550|RIP2_MYCTU_158_180 DRB1_0101 0.680 31.93 7.0
7 VAFLAFLQLTALVLN sp|L0T550|RIP2_MYCTU_158_180 DRB1_0101 0.688 29.20 6.5
8 AFLAFLQLTALVLNL sp|L0T550|RIP2_MYCTU_158_180 DRB1_0101 0.680 32.04 7.0
9 FLAFLQLTALVLNLL sp|L0T550|RIP2_MYCTU_158_180 DRB1_0101 0.669 35.92 8.5
1 AVLWAGVAFLAFLQL sp|L0T550|RIP2_MYCTU_158_180 DRB1_0102 0.346 1188.96 38.0
2 VLWAGVAFLAFLQLT sp|L0T550|RIP2_MYCTU_158_180 DRB1_0102 0.329 1414.85 44.0
3 LWAGVAFLAFLQLTA sp|L0T550|RIP2_MYCTU_158_180 DRB1_0102 0.379 823.82 28.0
4 WAGVAFLAFLQLTAL sp|L0T550|RIP2_MYCTU_158_180 DRB1_0102 0.406 616.05 21.0
5 AGVAFLAFLQLTALV sp|L0T550|RIP2_MYCTU_158_180 DRB1_0102 0.425 504.55 17.0
6 GVAFLAFLQLTALVL sp|L0T550|RIP2_MYCTU_158_180 DRB1_0102 0.458 353.10 11.0
7 VAFLAFLQLTALVLN sp|L0T550|RIP2_MYCTU_158_180 DRB1_0102 0.456 360.90 11.0
8 AFLAFLQLTALVLNL sp|L0T550|RIP2_MYCTU_158_180 DRB1_0102 0.456 361.54 11.0
9 FLAFLQLTALVLNLL sp|L0T550|RIP2_MYCTU_158_180 DRB1_0102 0.442 420.88 14.0

The strongest binding is between the MHC2 allele DRB1_0101 at the 7th (to and including 21st) amino acid of the sp&#124;L0T550&#124;RIP2_MYCTU_158_180 protein, as it is in the top 6.5% of best binders.

FAQ

Under which operating systems does netmhc2pan work?

netmhc2pan can only work on the set of operating systems NetMHCIIpan works on. Currently, only Linux is supported:

Operating system Supported by NetMHCIIpan Supported by netmhc2pan
Darwin Y N
Linux Y Y
Windows N N

How to solve Can't locate Env.pm in @INC?

Install the Perl Env package with:

/usr/bin/perl -MCPAN -e 'install Env'

See notes at this Issue.

Are there similar packages?

These are the ones I use:

I am a non-academic user, can you help me obtain NetMHCIIpan?

No.

Note that I -the maintainer of this package- have the same problem. DTU will not make an exception, here is a quote from Morten Nielsen:

The university is very strict on these issues, and we will not able able to grant you access to the tool if you cannot provide an email address from an academic institution. I am sorry about this.

Troubleshooting

problem copying [file]: Permission denied

When installing the package as documented ...

remotes::install_github("richelbilderbeek/netmhc2pan")

... you get warnings such as these:

Warning messages:

1: In file.copy(savedcopy, lib, recursive = TRUE) :

  problem copying C:\Users\johndoe\Documents\R\win-library\4.1\00LOCK\xfun\libs\x64\xfun.dll to C:\Users\johndoe\Documents\R\win-library\4.1\xfun\libs\x64\xfun.dll: Permission denied

It means that you cannot install R packages there.

As this has nothing to do with this package, I suggest to contact your IT department to let them help you out.

Links

References

  • [1] Improved methods for predicting peptide binding affinity to MHC class II molecules. Jensen KK, Andreatta M, Marcatili P, Buus S, Greenbaum JA, Yan Z, Sette A, Peters B, Nielsen M. Immunology. 2018 Jan 6. doi: 10.1111/imm.12889. PubMed: 29315598

About

R package for NetMHCIIpan

License:GNU General Public License v3.0


Languages

Language:R 96.6%Language:Shell 3.4%