Title: | Interface to 'NetMHCIIpan' |
---|---|
Description: | The field of immunology benefits from software that can predict which peptide sequences trigger an immune response. 'NetMHCIIpan' is a such a tool: it predicts the binding strength of a short peptide to a Major Histocompatibility Complex class II (MHC-II) molecule. 'NetMHCIIpan' can be used from a web server at <https://services.healthtech.dtu.dk/services/NetMHCIIpan-3.2/> or from the command-line, using a local installation. This package allows to call 'NetMHCIIpan' from R. |
Authors: | Richèl J.C. Bilderbeek [aut, cre] , Lue Ping Zhao [ctb], Byungkuk Min [ctb] |
Maintainer: | Richèl J.C. Bilderbeek <[email protected]> |
License: | GPL-3 |
Version: | 1.3.3 |
Built: | 2024-11-07 05:13:27 UTC |
Source: | https://github.com/richelbilderbeek/netmhc2pan |
Convert the first character to upper case. If the first character is upper case, nothing will happen.
capitalize_first_char(s)
capitalize_first_char(s)
s |
a string |
the string, with the first letter in uppercase
Richèl J.C. Bilderbeek
capitalize_first_char("hello")
capitalize_first_char("hello")
Check if the alleles have a valid NetMHC2pan name. Will stop if not.
check_alleles( alleles, netmhc2pan_folder_name = get_default_netmhc2pan_folder() )
check_alleles( alleles, netmhc2pan_folder_name = get_default_netmhc2pan_folder() )
alleles |
one or more alleles, e.g. |
netmhc2pan_folder_name |
the folder (to be) used by NetMHCIIpan. From this location, a subfolder for NetMHCIIpan is created. Use get_default_netmhc2pan_folder to see the location of the default NetMHCIIpan folder. Use get_default_netmhc2pan_subfolder to see the location of the default NetMHCIIpan subfolder. |
nothing
Richèl J.C. Bilderbeek
Use to_netmhc2pan_name to convert a formal name to an NetMHC2pan name. Use get_netmhc2pan_alleles for a list of all supported alleles (in NetMHC2pan naming format).
if (is_netmhc2pan_installed()) { check_alleles("DRB1_0101") check_alleles(c("DRB1_0102", "DRB1_0103")) }
if (is_netmhc2pan_installed()) { check_alleles("DRB1_0101") check_alleles(c("DRB1_0102", "DRB1_0103")) }
Will stop if not. Will stop if the file already exists. Does so by creating an empty file at the path, and then deleting it.
check_can_create_file(filename, overwrite = TRUE)
check_can_create_file(filename, overwrite = TRUE)
filename |
file that may or may not be created |
overwrite |
if TRUE, if |
Nothing
Richèl J.C. Bilderbeek
Check if the lengths of the sequences in a FASTA file are at least equal to the desired peptide lengths.
check_fasta_file_sequence_lengths(fasta_filename, peptide_length)
check_fasta_file_sequence_lengths(fasta_filename, peptide_length)
fasta_filename |
the name of a FASTA file with protein sequences |
peptide_length |
length of a peptide |
Nothing.
Richèl J.C. Bilderbeek
# FASTA file in which all proteons have a length of at keast 13 fasta_filename <- system.file( "extdata", "example.fasta", package = "netmhc2pan" ) check_fasta_file_sequence_lengths( fasta_filename = fasta_filename, peptide_length = 13 )
# FASTA file in which all proteons have a length of at keast 13 fasta_filename <- system.file( "extdata", "example.fasta", package = "netmhc2pan" ) check_fasta_file_sequence_lengths( fasta_filename = fasta_filename, peptide_length = 13 )
Check the URL of the NetMHCIIpan binary tarball is valid, will stop if not. This URL link expires after 4 hours.
check_netmhc2pan_bin_url( netmhc2pan_bin_url = get_netmhc2pan_bin_url(), verbose = FALSE, netmhc2pan_archive_filename = get_netmhc2pan_archive_filename(), temp_local_file = tempfile(pattern = "check_netmhc2pan_bin_url_") )
check_netmhc2pan_bin_url( netmhc2pan_bin_url = get_netmhc2pan_bin_url(), verbose = FALSE, netmhc2pan_archive_filename = get_netmhc2pan_archive_filename(), temp_local_file = tempfile(pattern = "check_netmhc2pan_bin_url_") )
netmhc2pan_bin_url |
URL to download the
NetMHCIIpan binary tarball file from,
similar to, for example,
|
verbose |
set to TRUE for more output |
netmhc2pan_archive_filename |
the NetMHC2pan archive
filename, for example |
temp_local_file |
path to the temporary file to store the URL to. This file will be deleted afterwards. |
Nothing
Check the URL of the NetMHCIIpan binary tarball is valid, will stop if not. This URL link expires after 4 hours.
check_netmhc2pan_data_url( netmhc2pan_data_url = get_netmhc2pan_data_url(), verbose = FALSE, temp_local_file = tempfile(pattern = "check_netmhc2pan_data_url_") )
check_netmhc2pan_data_url( netmhc2pan_data_url = get_netmhc2pan_data_url(), verbose = FALSE, temp_local_file = tempfile(pattern = "check_netmhc2pan_data_url_") )
netmhc2pan_data_url |
URL to download the NetMHCIIpan data tarball file from, similar to, for example, https://services.healthtech.dtu.dk/services/NetMHCIIpan-3.2/data.Linux.tar.gz. Use get_netmhc2pan_data_url to get the default URL. |
verbose |
set to TRUE for more output |
temp_local_file |
path to the temporary file to store the URL to. This file will be deleted afterwards. |
Nothing
Checks the installation of NetMHCIIpan. Throws a helpful error message if incomplete, else does nothing
check_netmhc2pan_installation( netmhc2pan_folder_name = get_default_netmhc2pan_folder() )
check_netmhc2pan_installation( netmhc2pan_folder_name = get_default_netmhc2pan_folder() )
netmhc2pan_folder_name |
the folder (to be) used by NetMHCIIpan. From this location, a subfolder for NetMHCIIpan is created. Use get_default_netmhc2pan_folder to see the location of the default NetMHCIIpan folder. Use get_default_netmhc2pan_subfolder to see the location of the default NetMHCIIpan subfolder. |
Nothing
Richèl J.C. Bilderbeek
# Will stop if NetMHC2pan is not installed try(check_netmhc2pan_installation())
# Will stop if NetMHC2pan is not installed try(check_netmhc2pan_installation())
.fasta
fileCreate a .fasta
file
create_temp_fasta_filename()
create_temp_fasta_filename()
a path to a non-existing file,
for example, /home/myusername/.cache/temp_582046426735.fasta
Richèl J.C. Bilderbeek
create_temp_fasta_filename()
create_temp_fasta_filename()
.xls
fileCreate a .xls
file
create_temp_xls_filename()
create_temp_xls_filename()
a path to a non-existing file,
for example, /home/myusername/.cache/temp_582047dac733.xls
Richèl J.C. Bilderbeek
create_temp_xls_filename()
create_temp_xls_filename()
This function does nothing. It is intended to inherit is parameters' documentation.
default_params_doc( alleles, do_filter, fasta_filename, folder_name, mhc_haplotype, netmhc2pan_archive_filename, netmhc2pan_bin_tarfile_path, netmhc2pan_bin_url, netmhc2pan_data_tarfile_path, netmhc2pan_data_url, netmhc2pan_folder_name, netmhc2pan_subfolder, netmhc2pan_version, os, peptide_length, peptides, protein_sequence, temp_fasta_filename, temp_local_file, temp_xls_filename, verbose, xls_filename )
default_params_doc( alleles, do_filter, fasta_filename, folder_name, mhc_haplotype, netmhc2pan_archive_filename, netmhc2pan_bin_tarfile_path, netmhc2pan_bin_url, netmhc2pan_data_tarfile_path, netmhc2pan_data_url, netmhc2pan_folder_name, netmhc2pan_subfolder, netmhc2pan_version, os, peptide_length, peptides, protein_sequence, temp_fasta_filename, temp_local_file, temp_xls_filename, verbose, xls_filename )
alleles |
one or more alleles, e.g. |
do_filter |
set to TRUE if the results of NetMHCIIpan must be filtered |
fasta_filename |
the name of a FASTA file with protein sequences |
folder_name |
the folder to install NetMHCIIpan, which is
|
mhc_haplotype |
one MHC haplotype, e.g. |
netmhc2pan_archive_filename |
the NetMHC2pan archive
filename, for example |
netmhc2pan_bin_tarfile_path |
path of the NetMHCIIpan binary tarball file |
netmhc2pan_bin_url |
URL to download the
NetMHCIIpan binary tarball file from,
similar to, for example,
|
netmhc2pan_data_tarfile_path |
path of the NetMHCIIpan data tarball file |
netmhc2pan_data_url |
URL to download the NetMHCIIpan data tarball file from, similar to, for example, https://services.healthtech.dtu.dk/services/NetMHCIIpan-3.2/data.Linux.tar.gz. Use get_netmhc2pan_data_url to get the default URL. |
netmhc2pan_folder_name |
the folder (to be) used by NetMHCIIpan. From this location, a subfolder for NetMHCIIpan is created. Use get_default_netmhc2pan_folder to see the location of the default NetMHCIIpan folder. Use get_default_netmhc2pan_subfolder to see the location of the default NetMHCIIpan subfolder. |
netmhc2pan_subfolder |
the subfolder (to be) used by NetMHCIIpan. Use get_default_netmhc2pan_subfolder to see the location of the default NetMHCIIpan subfolder |
netmhc2pan_version |
the NetMHCIIpan version,
for example |
os |
the operating system as obtained by |
peptide_length |
length of a peptide |
peptides |
one or more peptide sequences |
protein_sequence |
a protein sequence, for example |
temp_fasta_filename |
name for a temporary FASTA file, which will be deleted automatically |
temp_local_file |
path to the temporary file to store the URL to. This file will be deleted afterwards. |
temp_xls_filename |
name for a temporary |
verbose |
set to TRUE for more output |
xls_filename |
name of an |
This is an internal function, so it should be marked with
@noRd
. This is not done, as this will disallow all
functions to find the documentation parameters
Richèl J.C. Bilderbeek
Download the NetMHCIIpan binary tarball file
download_netmhc2pan_bin( netmhc2pan_bin_url = get_netmhc2pan_bin_url(), netmhc2pan_bin_tarfile_path = get_default_netmhc2pan_bin_tarfile_path(), verbose = FALSE, netmhc2pan_archive_filename = get_netmhc2pan_archive_filename(), temp_local_file = tempfile(pattern = "netmhc2pan_download_netmhc2pan_") )
download_netmhc2pan_bin( netmhc2pan_bin_url = get_netmhc2pan_bin_url(), netmhc2pan_bin_tarfile_path = get_default_netmhc2pan_bin_tarfile_path(), verbose = FALSE, netmhc2pan_archive_filename = get_netmhc2pan_archive_filename(), temp_local_file = tempfile(pattern = "netmhc2pan_download_netmhc2pan_") )
netmhc2pan_bin_url |
URL to download the
NetMHCIIpan binary tarball file from,
similar to, for example,
|
netmhc2pan_bin_tarfile_path |
path of the NetMHCIIpan binary tarball file |
verbose |
set to TRUE for more output |
netmhc2pan_archive_filename |
the NetMHC2pan archive
filename, for example |
temp_local_file |
path to the temporary file to store the URL to. This file will be deleted afterwards. |
Nothing
Richèl J.C. Bilderbeek
Get the full path to the default NetMHC2pan binary
get_default_netmhc2pan_bin_path( netmhc2pan_subfolder = get_default_netmhc2pan_subfolder() )
get_default_netmhc2pan_bin_path( netmhc2pan_subfolder = get_default_netmhc2pan_subfolder() )
netmhc2pan_subfolder |
the subfolder (to be) used by NetMHCIIpan. Use get_default_netmhc2pan_subfolder to see the location of the default NetMHCIIpan subfolder |
the full path to the default NetMHC2pan binary
Richèl J.C. Bilderbeek
get_default_netmhc2pan_bin_path()
get_default_netmhc2pan_bin_path()
Get the default path for the NetMHCIIpan binary tarball file. This is the location where it will be saved to after downloading.
get_default_netmhc2pan_bin_tarfile_path( netmhc2pan_folder_name = get_default_netmhc2pan_folder(), netmhc2pan_archive_filename = get_netmhc2pan_archive_filename() )
get_default_netmhc2pan_bin_tarfile_path( netmhc2pan_folder_name = get_default_netmhc2pan_folder(), netmhc2pan_archive_filename = get_netmhc2pan_archive_filename() )
netmhc2pan_folder_name |
the folder (to be) used by NetMHCIIpan. From this location, a subfolder for NetMHCIIpan is created. Use get_default_netmhc2pan_folder to see the location of the default NetMHCIIpan folder. Use get_default_netmhc2pan_subfolder to see the location of the default NetMHCIIpan subfolder. |
netmhc2pan_archive_filename |
the NetMHC2pan archive
filename, for example |
the default path for the NetMHCIIpan binary tarball file
Richèl J.C. Bilderbeek
get_default_netmhc2pan_bin_tarfile_path()
get_default_netmhc2pan_bin_tarfile_path()
Get the path to the folder where this package installs NetMHCIIpan by default
get_default_netmhc2pan_folder()
get_default_netmhc2pan_folder()
the path to the folder where this package installs NetMHCIIpan by default
Richèl J.C. Bilderbeek
get_default_netmhc2pan_folder()
get_default_netmhc2pan_folder()
Get the full path to the NetMHC2pan sub-folder
get_default_netmhc2pan_subfolder( netmhc2pan_folder_name = get_default_netmhc2pan_folder(), netmhc2pan_version = get_default_netmhc2pan_version() )
get_default_netmhc2pan_subfolder( netmhc2pan_folder_name = get_default_netmhc2pan_folder(), netmhc2pan_version = get_default_netmhc2pan_version() )
netmhc2pan_folder_name |
the folder (to be) used by NetMHCIIpan. From this location, a subfolder for NetMHCIIpan is created. Use get_default_netmhc2pan_folder to see the location of the default NetMHCIIpan folder. Use get_default_netmhc2pan_subfolder to see the location of the default NetMHCIIpan subfolder. |
netmhc2pan_version |
the NetMHCIIpan version,
for example |
the full path to the NetMHC2pan sub-folder
Richèl J.C. Bilderbeek
get_default_netmhc2pan_subfolder()
get_default_netmhc2pan_subfolder()
Get the default NetMHC2pan version used
get_default_netmhc2pan_version()
get_default_netmhc2pan_version()
the default NetMHC2pan version used
Richèl J.C. Bilderbeek
get_default_netmhc2pan_version()
get_default_netmhc2pan_version()
Get a list of the alleles supported by NetMHCIIpan
get_netmhc2pan_alleles( netmhc2pan_folder_name = get_default_netmhc2pan_folder() )
get_netmhc2pan_alleles( netmhc2pan_folder_name = get_default_netmhc2pan_folder() )
netmhc2pan_folder_name |
the folder (to be) used by NetMHCIIpan. From this location, a subfolder for NetMHCIIpan is created. Use get_default_netmhc2pan_folder to see the location of the default NetMHCIIpan folder. Use get_default_netmhc2pan_subfolder to see the location of the default NetMHCIIpan subfolder. |
a character vector with the NetMHCIIpan alleles
Richèl J.C. Bilderbeek
if (is_netmhc2pan_installed()) { get_netmhc2pan_alleles()[1:5] }
if (is_netmhc2pan_installed()) { get_netmhc2pan_alleles()[1:5] }
Get the filename of the NetMHC2pan archive file
get_netmhc2pan_archive_filename( netmhc2pan_version = get_default_netmhc2pan_version() )
get_netmhc2pan_archive_filename( netmhc2pan_version = get_default_netmhc2pan_version() )
netmhc2pan_version |
the NetMHCIIpan version,
for example |
the filename of the NetMHC2pan archive file
get_netmhc2pan_archive_filename()
get_netmhc2pan_archive_filename()
Get the URL for the NetMHCIIpan binary, as is emailed. These expire after 4 hours.
get_netmhc2pan_bin_url()
get_netmhc2pan_bin_url()
a download URL
Richèl J.C. Bilderbeek
Use is_url_valid to determine if the download URL is still valid. Use check_netmhc2pan_bin_url to get a helpful error message if this URL is invalid.
Get the NetMHCIIpan data tarball URL.
get_netmhc2pan_data_url()
get_netmhc2pan_data_url()
a download URL
Richèl J.C. Bilderbeek
Use is_url_valid to determine if the download URL is still valid. Use check_netmhc2pan_data_url to get a helpful error message if this URL is invalid.
Deprecated, use get_netmhc2pan_bin_url instead
get_netmhc2pan_url()
get_netmhc2pan_url()
a download URL
Richèl J.C. Bilderbeek
Install NetMHCIIpan to a local folder, by downloading the binary and data files. Use install_netmhc2pan_from_files to install NetMHCIIpan from files that are already downloaded.
install_netmhc2pan( netmhc2pan_bin_url = get_netmhc2pan_bin_url(), netmhc2pan_data_url = get_netmhc2pan_data_url(), verbose = FALSE, netmhc2pan_archive_filename = get_netmhc2pan_archive_filename(), netmhc2pan_folder_name = get_default_netmhc2pan_folder(), temp_local_file = tempfile(pattern = "netmhc2pan_install_netmhc2pan_") )
install_netmhc2pan( netmhc2pan_bin_url = get_netmhc2pan_bin_url(), netmhc2pan_data_url = get_netmhc2pan_data_url(), verbose = FALSE, netmhc2pan_archive_filename = get_netmhc2pan_archive_filename(), netmhc2pan_folder_name = get_default_netmhc2pan_folder(), temp_local_file = tempfile(pattern = "netmhc2pan_install_netmhc2pan_") )
netmhc2pan_bin_url |
URL to download the
NetMHCIIpan binary tarball file from,
similar to, for example,
|
netmhc2pan_data_url |
URL to download the NetMHCIIpan data tarball file from, similar to, for example, https://services.healthtech.dtu.dk/services/NetMHCIIpan-3.2/data.Linux.tar.gz. Use get_netmhc2pan_data_url to get the default URL. |
verbose |
set to TRUE for more output |
netmhc2pan_archive_filename |
the NetMHC2pan archive
filename, for example |
netmhc2pan_folder_name |
the folder (to be) used by NetMHCIIpan. From this location, a subfolder for NetMHCIIpan is created. Use get_default_netmhc2pan_folder to see the location of the default NetMHCIIpan folder. Use get_default_netmhc2pan_subfolder to see the location of the default NetMHCIIpan subfolder. |
temp_local_file |
path to the temporary file to store the URL to. This file will be deleted afterwards. |
These are three steps:
Install the NetMHCIIpan binary, using install_netmhc2pan_bin
Install the NetMHCIIpan data, using install_netmhc2pan_data
Set up NetMHCIIpan, using set_up_netmhc2pan
Nothing
Richèl J.C. Bilderbeek
Install the NetMHCIIpan binary to a local folder.
install_netmhc2pan_bin( netmhc2pan_bin_url = get_netmhc2pan_bin_url(), verbose = FALSE, netmhc2pan_archive_filename = get_netmhc2pan_archive_filename(), netmhc2pan_folder_name = get_default_netmhc2pan_folder(), temp_local_file = tempfile(pattern = "netmhc2pan_install_netmhc2pan_bin_") )
install_netmhc2pan_bin( netmhc2pan_bin_url = get_netmhc2pan_bin_url(), verbose = FALSE, netmhc2pan_archive_filename = get_netmhc2pan_archive_filename(), netmhc2pan_folder_name = get_default_netmhc2pan_folder(), temp_local_file = tempfile(pattern = "netmhc2pan_install_netmhc2pan_bin_") )
netmhc2pan_bin_url |
URL to download the
NetMHCIIpan binary tarball file from,
similar to, for example,
|
verbose |
set to TRUE for more output |
netmhc2pan_archive_filename |
the NetMHC2pan archive
filename, for example |
netmhc2pan_folder_name |
the folder (to be) used by NetMHCIIpan. From this location, a subfolder for NetMHCIIpan is created. Use get_default_netmhc2pan_folder to see the location of the default NetMHCIIpan folder. Use get_default_netmhc2pan_subfolder to see the location of the default NetMHCIIpan subfolder. |
temp_local_file |
path to the temporary file to store the URL to. This file will be deleted afterwards. |
Nothing
Richèl J.C. Bilderbeek
Install the NetMHCIIpan binary to a local folder
install_netmhc2pan_bin_from_file( netmhc2pan_bin_tarfile_path, verbose = FALSE, netmhc2pan_archive_filename = get_netmhc2pan_archive_filename(), netmhc2pan_folder_name = get_default_netmhc2pan_folder() )
install_netmhc2pan_bin_from_file( netmhc2pan_bin_tarfile_path, verbose = FALSE, netmhc2pan_archive_filename = get_netmhc2pan_archive_filename(), netmhc2pan_folder_name = get_default_netmhc2pan_folder() )
netmhc2pan_bin_tarfile_path |
path of the NetMHCIIpan binary tarball file |
verbose |
set to TRUE for more output |
netmhc2pan_archive_filename |
the NetMHC2pan archive
filename, for example |
netmhc2pan_folder_name |
the folder (to be) used by NetMHCIIpan. From this location, a subfolder for NetMHCIIpan is created. Use get_default_netmhc2pan_folder to see the location of the default NetMHCIIpan folder. Use get_default_netmhc2pan_subfolder to see the location of the default NetMHCIIpan subfolder. |
Nothing
Richèl J.C. Bilderbeek
Install the NetMHCIIpan data to a local folder.
install_netmhc2pan_data( netmhc2pan_data_url = get_netmhc2pan_data_url(), netmhc2pan_folder_name = rappdirs::user_data_dir(), verbose = FALSE )
install_netmhc2pan_data( netmhc2pan_data_url = get_netmhc2pan_data_url(), netmhc2pan_folder_name = rappdirs::user_data_dir(), verbose = FALSE )
netmhc2pan_data_url |
URL to download the NetMHCIIpan data tarball file from, similar to, for example, https://services.healthtech.dtu.dk/services/NetMHCIIpan-3.2/data.Linux.tar.gz. Use get_netmhc2pan_data_url to get the default URL. |
netmhc2pan_folder_name |
the folder (to be) used by NetMHCIIpan. From this location, a subfolder for NetMHCIIpan is created. Use get_default_netmhc2pan_folder to see the location of the default NetMHCIIpan folder. Use get_default_netmhc2pan_subfolder to see the location of the default NetMHCIIpan subfolder. |
verbose |
set to TRUE for more output |
This data can be downloaded from https://services.healthtech.dtu.dk/services/NetMHCIIpan-3.2/data.Linux.tar.gz, without filling in a contact form.
Nothing
Richèl J.C. Bilderbeek
Install the NetMHCIIpan data from the NetMHCIIpan data tarball file to the default NetMHCIIpan folder.
install_netmhc2pan_data_from_file( netmhc2pan_data_tarfile_path, netmhc2pan_folder_name = rappdirs::user_data_dir(), verbose = FALSE )
install_netmhc2pan_data_from_file( netmhc2pan_data_tarfile_path, netmhc2pan_folder_name = rappdirs::user_data_dir(), verbose = FALSE )
netmhc2pan_data_tarfile_path |
path of the NetMHCIIpan data tarball file |
netmhc2pan_folder_name |
the folder (to be) used by NetMHCIIpan. From this location, a subfolder for NetMHCIIpan is created. Use get_default_netmhc2pan_folder to see the location of the default NetMHCIIpan folder. Use get_default_netmhc2pan_subfolder to see the location of the default NetMHCIIpan subfolder. |
verbose |
set to TRUE for more output |
The NetMHCIIpan data tarball file can be in any path.
The data tarball file can be downloaded from https://services.healthtech.dtu.dk/services/NetMHCIIpan-3.2/data.Linux.tar.gz, without filling in a contact form.
Nothing
Richèl J.C. Bilderbeek
Install NetMHCIIpan to a local folder from (already downloaded) binary and date tarball files. Use install_netmhc2pan to install NetMHCIIpan by downloading these files
install_netmhc2pan_from_files( netmhc2pan_bin_tarfile_path, netmhc2pan_data_tarfile_path, verbose = FALSE, netmhc2pan_archive_filename = get_netmhc2pan_archive_filename(), netmhc2pan_folder_name = get_default_netmhc2pan_folder(), temp_local_file = tempfile(pattern = "netmhc2pan_install_netmhc2pan_") )
install_netmhc2pan_from_files( netmhc2pan_bin_tarfile_path, netmhc2pan_data_tarfile_path, verbose = FALSE, netmhc2pan_archive_filename = get_netmhc2pan_archive_filename(), netmhc2pan_folder_name = get_default_netmhc2pan_folder(), temp_local_file = tempfile(pattern = "netmhc2pan_install_netmhc2pan_") )
netmhc2pan_bin_tarfile_path |
path of the NetMHCIIpan binary tarball file |
netmhc2pan_data_tarfile_path |
path of the NetMHCIIpan data tarball file |
verbose |
set to TRUE for more output |
netmhc2pan_archive_filename |
the NetMHC2pan archive
filename, for example |
netmhc2pan_folder_name |
the folder (to be) used by NetMHCIIpan. From this location, a subfolder for NetMHCIIpan is created. Use get_default_netmhc2pan_folder to see the location of the default NetMHCIIpan folder. Use get_default_netmhc2pan_subfolder to see the location of the default NetMHCIIpan subfolder. |
temp_local_file |
path to the temporary file to store the URL to. This file will be deleted afterwards. |
These are three steps:
Install the NetMHCIIpan binary, using install_netmhc2pan_bin_from_file
Install the NetMHCIIpan data, using install_netmhc2pan_data_from_file
Set up NetMHCIIpan, using set_up_netmhc2pan
Nothing
Richèl J.C. Bilderbeek
Measure if NetMHCIIpan binary is installed locally
is_netmhc2pan_bin_installed( netmhc2pan_folder_name = get_default_netmhc2pan_folder(), verbose = FALSE )
is_netmhc2pan_bin_installed( netmhc2pan_folder_name = get_default_netmhc2pan_folder(), verbose = FALSE )
netmhc2pan_folder_name |
the folder (to be) used by NetMHCIIpan. From this location, a subfolder for NetMHCIIpan is created. Use get_default_netmhc2pan_folder to see the location of the default NetMHCIIpan folder. Use get_default_netmhc2pan_subfolder to see the location of the default NetMHCIIpan subfolder. |
verbose |
set to TRUE for more output |
TRUE is NetMHCIIpan binary is installed locally, FALSE otherwise
Richèl J.C. Bilderbeek
Measure if NetMHCIIpan data folder is installed locally
is_netmhc2pan_data_installed( netmhc2pan_folder_name = get_default_netmhc2pan_folder() )
is_netmhc2pan_data_installed( netmhc2pan_folder_name = get_default_netmhc2pan_folder() )
netmhc2pan_folder_name |
the folder (to be) used by NetMHCIIpan. From this location, a subfolder for NetMHCIIpan is created. Use get_default_netmhc2pan_folder to see the location of the default NetMHCIIpan folder. Use get_default_netmhc2pan_subfolder to see the location of the default NetMHCIIpan subfolder. |
TRUE is NetMHCIIpan data folder is installed locally, FALSE otherwise
Richèl J.C. Bilderbeek
Determines if a haplotype has the same notation as a NetMHC2pan haplotype
is_netmhc2pan_haplotype(mhc_haplotype)
is_netmhc2pan_haplotype(mhc_haplotype)
mhc_haplotype |
one MHC haplotype, e.g. |
TRUE if the haplotype is a valid NetMHCIIpan haplotype
Richèl J.C. Bilderbeek
if (is_netmhc2pan_installed()) { is_netmhc2pan_haplotype("DRB1_0311") is_netmhc2pan_haplotype("nonsense") }
if (is_netmhc2pan_installed()) { is_netmhc2pan_haplotype("DRB1_0311") is_netmhc2pan_haplotype("nonsense") }
Measure if NetMHCIIpan is installed locally
is_netmhc2pan_installed( netmhc2pan_folder_name = get_default_netmhc2pan_folder(), verbose = FALSE )
is_netmhc2pan_installed( netmhc2pan_folder_name = get_default_netmhc2pan_folder(), verbose = FALSE )
netmhc2pan_folder_name |
the folder (to be) used by NetMHCIIpan. From this location, a subfolder for NetMHCIIpan is created. Use get_default_netmhc2pan_folder to see the location of the default NetMHCIIpan folder. Use get_default_netmhc2pan_subfolder to see the location of the default NetMHCIIpan subfolder. |
verbose |
set to TRUE for more output |
TRUE is NetMHCIIpan is installed locally, FALSE otherwise
Richèl J.C. Bilderbeek
Measure if NetMHCIIpan is set up
is_netmhc2pan_set_up(netmhc2pan_folder_name = get_default_netmhc2pan_folder())
is_netmhc2pan_set_up(netmhc2pan_folder_name = get_default_netmhc2pan_folder())
netmhc2pan_folder_name |
the folder (to be) used by NetMHCIIpan. From this location, a subfolder for NetMHCIIpan is created. Use get_default_netmhc2pan_folder to see the location of the default NetMHCIIpan folder. Use get_default_netmhc2pan_subfolder to see the location of the default NetMHCIIpan subfolder. |
TRUE is NetMHCIIpan is set up locally, FALSE otherwise
Richèl J.C. Bilderbeek
Determines if the environment is AppVeyor
is_on_appveyor()
is_on_appveyor()
TRUE if run on AppVeyor, FALSE otherwise
Richèl J.C. Bilderbeek
if (is_on_appveyor()) { message("Running on AppVeyor") }
if (is_on_appveyor()) { message("Running on AppVeyor") }
Determines if the environment is a continuous integration service
is_on_ci()
is_on_ci()
TRUE if run on AppVeyor or Travis CI, FALSE otherwise
It is possible to fake being on continuous integration service, in this case GitHub Actions, using:
“'r Sys.setenv(GITHUB_ACTIONS = "I fake being on GitHub Actions") is_on_ci() # Will be true “'
To undo this, do
“'r Sys.setenv(GITHUB_ACTIONS = "") is_on_ci() # Will be false “'
Richèl J.C. Bilderbeek
is_on_ci()
is_on_ci()
Determines if the environment is GitHub Actions
is_on_github_actions()
is_on_github_actions()
TRUE if run on GitHub Actions, FALSE otherwise
It is possible to fake being on GitHub Actions, using:
“'r Sys.setenv(GITHUB_ACTIONS = "I fake being on GitHub Actions") is_on_github_actions() # Will be true “'
To undo this, do
“'r Sys.setenv(GITHUB_ACTIONS = "") is_on_github_actions() # Will be false “'
Richèl J.C. Bilderbeek
if (is_on_github_actions()) { message("Running on GitHub Actions") }
if (is_on_github_actions()) { message("Running on GitHub Actions") }
Determines if the environment is Travis CI
is_on_travis()
is_on_travis()
TRUE if run on Travis CI, FALSE otherwise
Richèl J.C. Bilderbeek
if (is_on_ci()) { message("Running on Travis CI") }
if (is_on_ci()) { message("Running on Travis CI") }
See if tcsh is installed
is_tcsh_installed()
is_tcsh_installed()
TRUE is tcsh is installed, FALSE otherwise
To install tcsh
under Linux, do sudo apt install tcsh
Richèl J.C. Bilderbeek
The download link expires after 4 hours.
is_url_valid( netmhc2pan_bin_url = get_netmhc2pan_bin_url(), verbose = FALSE, netmhc2pan_archive_filename = get_netmhc2pan_archive_filename(), temp_local_file = tempfile(pattern = "netmhc2pan_is_url_valid_") )
is_url_valid( netmhc2pan_bin_url = get_netmhc2pan_bin_url(), verbose = FALSE, netmhc2pan_archive_filename = get_netmhc2pan_archive_filename(), temp_local_file = tempfile(pattern = "netmhc2pan_is_url_valid_") )
netmhc2pan_bin_url |
URL to download the
NetMHCIIpan binary tarball file from,
similar to, for example,
|
verbose |
set to TRUE for more output |
netmhc2pan_archive_filename |
the NetMHC2pan archive
filename, for example |
temp_local_file |
path to the temporary file to store the URL to. This file will be deleted afterwards. |
TRUE if the download URL valid, FALSE otherwise
'NetMHCIIpan' is a tool to predict the binding strength of a short peptide to an MHC-II complex. 'NetMHCIIpan' can be used from a web server at 'https://services.healthtech.dtu.dk/services/NetMHCIIpan-3.2/' or from the command-line, using a local installation. This package allows to call 'NetMHCIIpan' from R.
Richèl J.C. Bilderbeek
if (is_netmhc2pan_installed()) { predict_ic50( peptides = c("AIAACAMLLV", "ALVCYIVMPV"), mhc_haplotype = "DRB1_0416" ) }
if (is_netmhc2pan_installed()) { predict_ic50( peptides = c("AIAACAMLLV", "ALVCYIVMPV"), mhc_haplotype = "DRB1_0416" ) }
netmhc2pan
report using message,
to be used when reporting bugsShow a netmhc2pan
report using message,
to be used when reporting bugs
netmhc2pan_report(netmhc2pan_folder_name = get_default_netmhc2pan_folder())
netmhc2pan_report(netmhc2pan_folder_name = get_default_netmhc2pan_folder())
netmhc2pan_folder_name |
the folder (to be) used by NetMHCIIpan. From this location, a subfolder for NetMHCIIpan is created. Use get_default_netmhc2pan_folder to see the location of the default NetMHCIIpan folder. Use get_default_netmhc2pan_subfolder to see the location of the default NetMHCIIpan subfolder. |
Nothing, it is called for its side effects
Richèl J.C. Bilderbeek
netmhc2pan_report()
netmhc2pan_report()
Test NetMHCIIpan by doing a minimal run.
netmhc2pan_self_test( netmhc2pan_folder_name = get_default_netmhc2pan_folder(), verbose = FALSE )
netmhc2pan_self_test( netmhc2pan_folder_name = get_default_netmhc2pan_folder(), verbose = FALSE )
netmhc2pan_folder_name |
the folder (to be) used by NetMHCIIpan. From this location, a subfolder for NetMHCIIpan is created. Use get_default_netmhc2pan_folder to see the location of the default NetMHCIIpan folder. Use get_default_netmhc2pan_subfolder to see the location of the default NetMHCIIpan subfolder. |
verbose |
set to TRUE for more output |
Nothing. If the self-test fails, an error will be raised
Richèl J.C. Bilderbeek
Predict the half maximal inhibitory concentration (aka IC50) (in nM) for one or more peptides, where the peptides are used as-is, instead of split into smaller peptides. Each peptide must be 15 amino acids at most (use predict_ic50s to predict the IC50s for longer peptides)
predict_ic50( peptides, mhc_haplotype, netmhc2pan_folder_name = get_default_netmhc2pan_folder(), temp_fasta_filename = netmhc2pan::create_temp_fasta_filename(), temp_xls_filename = netmhc2pan::create_temp_xls_filename() )
predict_ic50( peptides, mhc_haplotype, netmhc2pan_folder_name = get_default_netmhc2pan_folder(), temp_fasta_filename = netmhc2pan::create_temp_fasta_filename(), temp_xls_filename = netmhc2pan::create_temp_xls_filename() )
peptides |
one or more peptide sequences |
mhc_haplotype |
one MHC haplotype, e.g. |
netmhc2pan_folder_name |
the folder (to be) used by NetMHCIIpan. From this location, a subfolder for NetMHCIIpan is created. Use get_default_netmhc2pan_folder to see the location of the default NetMHCIIpan folder. Use get_default_netmhc2pan_subfolder to see the location of the default NetMHCIIpan subfolder. |
temp_fasta_filename |
name for a temporary FASTA file, which will be deleted automatically |
temp_xls_filename |
name for a temporary |
a tibble with two columns:
(1) peptide
, which holds the peptide sequence, and
(2) ic50
, which holds the predicted IC50
this function uses a temporary file, because NetMHC2pan reads its input from file. This temporary file is deleted after this function passed successfully.
Richèl J.C. Bilderbeek
if (is_netmhc2pan_installed()) { predict_ic50( peptides = c("AIAACAMLLV", "ALVCYIVMPV"), mhc_haplotype = "DRB1_0416" ) }
if (is_netmhc2pan_installed()) { predict_ic50( peptides = c("AIAACAMLLV", "ALVCYIVMPV"), mhc_haplotype = "DRB1_0416" ) }
Predict the IC50s from a sequence
predict_ic50s( protein_sequence, peptide_length, mhc_haplotype, netmhc2pan_folder_name = get_default_netmhc2pan_folder(), temp_fasta_filename = netmhc2pan::create_temp_fasta_filename(), temp_xls_filename = netmhc2pan::create_temp_xls_filename() )
predict_ic50s( protein_sequence, peptide_length, mhc_haplotype, netmhc2pan_folder_name = get_default_netmhc2pan_folder(), temp_fasta_filename = netmhc2pan::create_temp_fasta_filename(), temp_xls_filename = netmhc2pan::create_temp_xls_filename() )
protein_sequence |
a protein sequence, for example |
peptide_length |
length of a peptide |
mhc_haplotype |
one MHC haplotype, e.g. |
netmhc2pan_folder_name |
the folder (to be) used by NetMHCIIpan. From this location, a subfolder for NetMHCIIpan is created. Use get_default_netmhc2pan_folder to see the location of the default NetMHCIIpan folder. Use get_default_netmhc2pan_subfolder to see the location of the default NetMHCIIpan subfolder. |
temp_fasta_filename |
name for a temporary FASTA file, which will be deleted automatically |
temp_xls_filename |
name for a temporary |
a tibble with columns:
peptide the peptide fragment, each of length peptide_length
ic50 the predicted IC50 (in nM)
The number of rows equals protein_sequence - peptide_length + 1
.
Read the output produced by MHC2pan,
which is an XLS
file by default.
read_netmhc2pan_xls_output(xls_filename)
read_netmhc2pan_xls_output(xls_filename)
xls_filename |
name of an |
a table
xls_filename <- system.file("extdata", "example.xls", package = "netmhc2pan") read_netmhc2pan_xls_output(xls_filename)
xls_filename <- system.file("extdata", "example.xls", package = "netmhc2pan") read_netmhc2pan_xls_output(xls_filename)
Run NetMHCIIpan
run_netmhc2pan( fasta_filename, alleles = "DRB1_0101", peptide_length = 15, netmhc2pan_folder_name = get_default_netmhc2pan_folder(), temp_xls_filename = netmhc2pan::create_temp_xls_filename() )
run_netmhc2pan( fasta_filename, alleles = "DRB1_0101", peptide_length = 15, netmhc2pan_folder_name = get_default_netmhc2pan_folder(), temp_xls_filename = netmhc2pan::create_temp_xls_filename() )
fasta_filename |
the name of a FASTA file with protein sequences |
alleles |
one or more alleles, e.g. |
peptide_length |
length of a peptide |
netmhc2pan_folder_name |
the folder (to be) used by NetMHCIIpan. From this location, a subfolder for NetMHCIIpan is created. Use get_default_netmhc2pan_folder to see the location of the default NetMHCIIpan folder. Use get_default_netmhc2pan_subfolder to see the location of the default NetMHCIIpan subfolder. |
temp_xls_filename |
name for a temporary |
a data frame with the NetMHCIIpan results
Richèl J.C. Bilderbeek
if (is_netmhc2pan_installed()) { fasta_filename <- system.file( "extdata", "example.fasta", package = "netmhc2pan" ) run_netmhc2pan(fasta_filename) # Two alleles alleles <- c("DRB1_0101", "DRB1_0102") # Run NetMHCpan with these two alleles run_netmhc2pan(fasta_filename, alleles = alleles) }
if (is_netmhc2pan_installed()) { fasta_filename <- system.file( "extdata", "example.fasta", package = "netmhc2pan" ) run_netmhc2pan(fasta_filename) # Two alleles alleles <- c("DRB1_0101", "DRB1_0102") # Run NetMHCpan with these two alleles run_netmhc2pan(fasta_filename, alleles = alleles) }
Install the NetMHCIIpan binary to a local folder
set_up_netmhc2pan( netmhc2pan_folder_name = get_default_netmhc2pan_folder(), verbose = FALSE )
set_up_netmhc2pan( netmhc2pan_folder_name = get_default_netmhc2pan_folder(), verbose = FALSE )
netmhc2pan_folder_name |
the folder (to be) used by NetMHCIIpan. From this location, a subfolder for NetMHCIIpan is created. Use get_default_netmhc2pan_folder to see the location of the default NetMHCIIpan folder. Use get_default_netmhc2pan_subfolder to see the location of the default NetMHCIIpan subfolder. |
verbose |
set to TRUE for more output |
Nothing
Richèl J.C. Bilderbeek
Convert a formal MHC-II haplotype name to the notation used by NetMHC2pan.
to_netmhc2pan_name(mhc_haplotype)
to_netmhc2pan_name(mhc_haplotype)
mhc_haplotype |
one MHC haplotype, e.g. |
the haplotype name in NetMHC2pan notation
to_netmhc2pan_name("HLA-DRB1*0101") to_netmhc2pan_name("HLA-DQA1*0501/DQB1*0201")
to_netmhc2pan_name("HLA-DRB1*0101") to_netmhc2pan_name("HLA-DQA1*0501/DQB1*0201")
Uninstall NetMHCIIpan
uninstall_netmhc2pan(netmhc2pan_folder_name = get_default_netmhc2pan_folder())
uninstall_netmhc2pan(netmhc2pan_folder_name = get_default_netmhc2pan_folder())
netmhc2pan_folder_name |
the folder (to be) used by NetMHCIIpan. From this location, a subfolder for NetMHCIIpan is created. Use get_default_netmhc2pan_folder to see the location of the default NetMHCIIpan folder. Use get_default_netmhc2pan_subfolder to see the location of the default NetMHCIIpan subfolder. |
Nothing
Richèl J.C. Bilderbeek