Title: | Interface to 'NetMHCIIpan' |
Version: | 1.3.2 |
Maintainer: | Richèl J.C. Bilderbeek <richel@richelbilderbeek.nl> |
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. |
License: | GPL-3 |
Encoding: | UTF-8 |
Imports: | devtools, dplyr, rappdirs, readr, seqinr, stringr, testit, tibble |
Suggests: | knitr, rmarkdown, testthat, spelling |
VignetteBuilder: | knitr |
RoxygenNote: | 7.2.3 |
Language: | en-US |
URL: | https://github.com/richelbilderbeek/netmhc2pan/ |
BugReports: | https://github.com/richelbilderbeek/netmhc2pan/issues |
SystemRequirements: | NetMHC2pan (https://services.healthtech.dtu.dk/service.php?NetMHCIIpan-3.2) |
NeedsCompilation: | no |
Packaged: | 2023-11-08 16:05:13 UTC; richel |
Author: | Richèl J.C. Bilderbeek
|
Repository: | CRAN |
Date/Publication: | 2023-11-08 23:10:07 UTC |
Convert the first character to upper case.
Description
Convert the first character to upper case. If the first character is upper case, nothing will happen.
Usage
capitalize_first_char(s)
Arguments
s |
a string |
Value
the string, with the first letter in uppercase
Author(s)
Richèl J.C. Bilderbeek
Examples
capitalize_first_char("hello")
Check the allele names
Description
Check if the alleles have a valid NetMHC2pan name. Will stop if not.
Usage
check_alleles(
alleles,
netmhc2pan_folder_name = get_default_netmhc2pan_folder()
)
Arguments
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. |
Value
nothing
Author(s)
Richèl J.C. Bilderbeek
See Also
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).
Examples
if (is_netmhc2pan_installed()) {
check_alleles("DRB1_0101")
check_alleles(c("DRB1_0102", "DRB1_0103"))
}
Check that a file can be created at a certain path.
Description
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.
Usage
check_can_create_file(filename, overwrite = TRUE)
Arguments
filename |
file that may or may not be created |
overwrite |
if TRUE, if |
Value
Nothing
Author(s)
Richèl J.C. Bilderbeek
Check the lengths of the sequences in a FASTA file
Description
Check if the lengths of the sequences in a FASTA file are at least equal to the desired peptide lengths.
Usage
check_fasta_file_sequence_lengths(fasta_filename, peptide_length)
Arguments
fasta_filename |
the name of a FASTA file with protein sequences |
peptide_length |
length of a peptide |
Value
Nothing.
Author(s)
Richèl J.C. Bilderbeek
Examples
# 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
Description
Check the URL of the NetMHCIIpan binary tarball is valid, will stop if not. This URL link expires after 4 hours.
Usage
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_")
)
Arguments
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. |
Value
Nothing
Check the URL of the NetMHCIIpan binary tarball
Description
Check the URL of the NetMHCIIpan binary tarball is valid, will stop if not. This URL link expires after 4 hours.
Usage
check_netmhc2pan_data_url(
netmhc2pan_data_url = get_netmhc2pan_data_url(),
verbose = FALSE,
temp_local_file = tempfile(pattern = "check_netmhc2pan_data_url_")
)
Arguments
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. |
Value
Nothing
Checks the installation of NetMHCIIpan.
Description
Checks the installation of NetMHCIIpan. Throws a helpful error message if incomplete, else does nothing
Usage
check_netmhc2pan_installation(
netmhc2pan_folder_name = get_default_netmhc2pan_folder()
)
Arguments
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. |
Value
Nothing
Author(s)
Richèl J.C. Bilderbeek
Examples
# Will stop if NetMHC2pan is not installed
try(check_netmhc2pan_installation())
Create a .fasta
file
Description
Create a .fasta
file
Usage
create_temp_fasta_filename()
Value
a path to a non-existing file,
for example, /home/myusername/.cache/temp_582046426735.fasta
Author(s)
Richèl J.C. Bilderbeek
Examples
create_temp_fasta_filename()
Create a .xls
file
Description
Create a .xls
file
Usage
create_temp_xls_filename()
Value
a path to a non-existing file,
for example, /home/myusername/.cache/temp_582047dac733.xls
Author(s)
Richèl J.C. Bilderbeek
Examples
create_temp_xls_filename()
This function does nothing. It is intended to inherit is parameters' documentation.
Description
This function does nothing. It is intended to inherit is parameters' documentation.
Usage
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
)
Arguments
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 |
Note
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
Author(s)
Richèl J.C. Bilderbeek
Download the NetMHCIIpan binary
Description
Download the NetMHCIIpan binary tarball file
Usage
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_")
)
Arguments
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. |
Value
Nothing
Author(s)
Richèl J.C. Bilderbeek
Get the full path to the default NetMHC2pan binary
Description
Get the full path to the default NetMHC2pan binary
Usage
get_default_netmhc2pan_bin_path(
netmhc2pan_subfolder = get_default_netmhc2pan_subfolder()
)
Arguments
netmhc2pan_subfolder |
the subfolder (to be) used by NetMHCIIpan. Use get_default_netmhc2pan_subfolder to see the location of the default NetMHCIIpan subfolder |
Value
the full path to the default NetMHC2pan binary
Author(s)
Richèl J.C. Bilderbeek
Examples
get_default_netmhc2pan_bin_path()
Get the default path for the NetMHCIIpan binary tarball file
Description
Get the default path for the NetMHCIIpan binary tarball file. This is the location where it will be saved to after downloading.
Usage
get_default_netmhc2pan_bin_tarfile_path(
netmhc2pan_folder_name = get_default_netmhc2pan_folder(),
netmhc2pan_archive_filename = get_netmhc2pan_archive_filename()
)
Arguments
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 |
Value
the default path for the NetMHCIIpan binary tarball file
Author(s)
Richèl J.C. Bilderbeek
Examples
get_default_netmhc2pan_bin_tarfile_path()
Get the path to the folder where this package installs NetMHCIIpan by default
Description
Get the path to the folder where this package installs NetMHCIIpan by default
Usage
get_default_netmhc2pan_folder()
Value
the path to the folder where this package installs NetMHCIIpan by default
Author(s)
Richèl J.C. Bilderbeek
Examples
get_default_netmhc2pan_folder()
Get the full path to the NetMHC2pan sub-folder
Description
Get the full path to the NetMHC2pan sub-folder
Usage
get_default_netmhc2pan_subfolder(
netmhc2pan_folder_name = get_default_netmhc2pan_folder(),
netmhc2pan_version = get_default_netmhc2pan_version()
)
Arguments
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 |
Value
the full path to the NetMHC2pan sub-folder
Author(s)
Richèl J.C. Bilderbeek
Examples
get_default_netmhc2pan_subfolder()
Get the default NetMHC2pan version used
Description
Get the default NetMHC2pan version used
Usage
get_default_netmhc2pan_version()
Value
the default NetMHC2pan version used
Author(s)
Richèl J.C. Bilderbeek
Examples
get_default_netmhc2pan_version()
Get a list of the alleles supported by NetMHCIIpan
Description
Get a list of the alleles supported by NetMHCIIpan
Usage
get_netmhc2pan_alleles(
netmhc2pan_folder_name = get_default_netmhc2pan_folder()
)
Arguments
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. |
Value
a character vector with the NetMHCIIpan alleles
Author(s)
Richèl J.C. Bilderbeek
Examples
if (is_netmhc2pan_installed()) {
get_netmhc2pan_alleles()[1:5]
}
Get the filename of the NetMHC2pan archive file
Description
Get the filename of the NetMHC2pan archive file
Usage
get_netmhc2pan_archive_filename(
netmhc2pan_version = get_default_netmhc2pan_version()
)
Arguments
netmhc2pan_version |
the NetMHCIIpan version,
for example |
Value
the filename of the NetMHC2pan archive file
Examples
get_netmhc2pan_archive_filename()
Get the NetMHCIIpan binary download URL.
Description
Get the URL for the NetMHCIIpan binary, as is emailed. These expire after 4 hours.
Usage
get_netmhc2pan_bin_url()
Value
a download URL
Author(s)
Richèl J.C. Bilderbeek
See Also
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.
Description
Get the NetMHCIIpan data tarball URL.
Usage
get_netmhc2pan_data_url()
Value
a download URL
Author(s)
Richèl J.C. Bilderbeek
See Also
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
Description
Deprecated, use get_netmhc2pan_bin_url instead
Usage
get_netmhc2pan_url()
Value
a download URL
Author(s)
Richèl J.C. Bilderbeek
Install NetMHCIIpan
Description
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.
Usage
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_")
)
Arguments
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. |
Details
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
Value
Nothing
Author(s)
Richèl J.C. Bilderbeek
Install the NetMHCIIpan binary to a local folder
Description
Install the NetMHCIIpan binary to a local folder.
Usage
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_")
)
Arguments
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. |
Value
Nothing
Author(s)
Richèl J.C. Bilderbeek
Install the NetMHCIIpan binary to a local folder
Description
Install the NetMHCIIpan binary to a local folder
Usage
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()
)
Arguments
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. |
Value
Nothing
Author(s)
Richèl J.C. Bilderbeek
Install the NetMHCIIpan data to a local folder
Description
Install the NetMHCIIpan data to a local folder.
Usage
install_netmhc2pan_data(
netmhc2pan_data_url = get_netmhc2pan_data_url(),
netmhc2pan_folder_name = rappdirs::user_data_dir(),
verbose = FALSE
)
Arguments
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 |
Details
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.
Value
Nothing
Author(s)
Richèl J.C. Bilderbeek
Install the NetMHCIIpan data from file
Description
Install the NetMHCIIpan data from the NetMHCIIpan data tarball file to the default NetMHCIIpan folder.
Usage
install_netmhc2pan_data_from_file(
netmhc2pan_data_tarfile_path,
netmhc2pan_folder_name = rappdirs::user_data_dir(),
verbose = FALSE
)
Arguments
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 |
Details
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.
Value
Nothing
Author(s)
Richèl J.C. Bilderbeek
Install NetMHCIIpan from files.
Description
Install NetMHCIIpan to a local folder from (already downloaded) binary and date tarball files. Use install_netmhc2pan to install NetMHCIIpan by downloading these files
Usage
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_")
)
Arguments
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. |
Details
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
Value
Nothing
Author(s)
Richèl J.C. Bilderbeek
Measure if NetMHCIIpan binary is installed locally
Description
Measure if NetMHCIIpan binary is installed locally
Usage
is_netmhc2pan_bin_installed(
netmhc2pan_folder_name = get_default_netmhc2pan_folder(),
verbose = FALSE
)
Arguments
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 |
Value
TRUE is NetMHCIIpan binary is installed locally, FALSE otherwise
Author(s)
Richèl J.C. Bilderbeek
Measure if NetMHCIIpan data folder is installed locally
Description
Measure if NetMHCIIpan data folder is installed locally
Usage
is_netmhc2pan_data_installed(
netmhc2pan_folder_name = get_default_netmhc2pan_folder()
)
Arguments
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. |
Value
TRUE is NetMHCIIpan data folder is installed locally, FALSE otherwise
Author(s)
Richèl J.C. Bilderbeek
Is the haplotype valid?
Description
Determines if a haplotype has the same notation as a NetMHC2pan haplotype
Usage
is_netmhc2pan_haplotype(mhc_haplotype)
Arguments
mhc_haplotype |
one MHC haplotype, e.g. |
Value
TRUE if the haplotype is a valid NetMHCIIpan haplotype
Author(s)
Richèl J.C. Bilderbeek
Examples
if (is_netmhc2pan_installed()) {
is_netmhc2pan_haplotype("DRB1_0311")
is_netmhc2pan_haplotype("nonsense")
}
Measure if NetMHCIIpan is installed locally
Description
Measure if NetMHCIIpan is installed locally
Usage
is_netmhc2pan_installed(
netmhc2pan_folder_name = get_default_netmhc2pan_folder(),
verbose = FALSE
)
Arguments
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 |
Value
TRUE is NetMHCIIpan is installed locally, FALSE otherwise
Author(s)
Richèl J.C. Bilderbeek
Measure if NetMHCIIpan is set up
Description
Measure if NetMHCIIpan is set up
Usage
is_netmhc2pan_set_up(netmhc2pan_folder_name = get_default_netmhc2pan_folder())
Arguments
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. |
Value
TRUE is NetMHCIIpan is set up locally, FALSE otherwise
Author(s)
Richèl J.C. Bilderbeek
Determines if the environment is AppVeyor
Description
Determines if the environment is AppVeyor
Usage
is_on_appveyor()
Value
TRUE if run on AppVeyor, FALSE otherwise
Author(s)
Richèl J.C. Bilderbeek
Examples
if (is_on_appveyor()) {
message("Running on AppVeyor")
}
Determines if the environment is a continuous integration service
Description
Determines if the environment is a continuous integration service
Usage
is_on_ci()
Value
TRUE if run on AppVeyor or Travis CI, FALSE otherwise
Note
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 “'
Author(s)
Richèl J.C. Bilderbeek
Examples
is_on_ci()
Determines if the environment is GitHub Actions
Description
Determines if the environment is GitHub Actions
Usage
is_on_github_actions()
Value
TRUE if run on GitHub Actions, FALSE otherwise
Note
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 “'
Author(s)
Richèl J.C. Bilderbeek
Examples
if (is_on_github_actions()) {
message("Running on GitHub Actions")
}
Determines if the environment is Travis CI
Description
Determines if the environment is Travis CI
Usage
is_on_travis()
Value
TRUE if run on Travis CI, FALSE otherwise
Author(s)
Richèl J.C. Bilderbeek
Examples
if (is_on_ci()) {
message("Running on Travis CI")
}
See if tcsh is installed
Description
See if tcsh is installed
Usage
is_tcsh_installed()
Value
TRUE is tcsh is installed, FALSE otherwise
Note
To install tcsh
under Linux, do sudo apt install tcsh
Author(s)
Richèl J.C. Bilderbeek
Is the download URL valid?
Description
The download link expires after 4 hours.
Usage
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_")
)
Arguments
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. |
Value
TRUE if the download URL valid, FALSE otherwise
netmhc2pan: predict peptide binding strengths using NetMHC2pan
Description
'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.
Author(s)
Richèl J.C. Bilderbeek
Examples
if (is_netmhc2pan_installed()) {
predict_ic50(
peptides = c("AIAACAMLLV", "ALVCYIVMPV"),
mhc_haplotype = "DRB1_0416"
)
}
Show a netmhc2pan
report using message,
to be used when reporting bugs
Description
Show a netmhc2pan
report using message,
to be used when reporting bugs
Usage
netmhc2pan_report(netmhc2pan_folder_name = get_default_netmhc2pan_folder())
Arguments
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. |
Value
Nothing, it is called for its side effects
Author(s)
Richèl J.C. Bilderbeek
Examples
netmhc2pan_report()
Test NetMHCIIpan by doing a minimal run.
Description
Test NetMHCIIpan by doing a minimal run.
Usage
netmhc2pan_self_test(
netmhc2pan_folder_name = get_default_netmhc2pan_folder(),
verbose = FALSE
)
Arguments
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 |
Value
Nothing. If the self-test fails, an error will be raised
Author(s)
Richèl J.C. Bilderbeek
Predict the IC50 for peptides.
Description
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)
Usage
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()
)
Arguments
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 |
Value
a tibble with two columns:
(1) peptide
, which holds the peptide sequence, and
(2) ic50
, which holds the predicted IC50
Note
this function uses a temporary file, because NetMHC2pan reads its input from file. This temporary file is deleted after this function passed successfully.
Author(s)
Richèl J.C. Bilderbeek
Examples
if (is_netmhc2pan_installed()) {
predict_ic50(
peptides = c("AIAACAMLLV", "ALVCYIVMPV"),
mhc_haplotype = "DRB1_0416"
)
}
Predict the IC50s from a sequence
Description
Predict the IC50s from a sequence
Usage
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()
)
Arguments
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 |
Value
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 MHC2pan output
Description
Read the output produced by MHC2pan,
which is an XLS
file by default.
Usage
read_netmhc2pan_xls_output(xls_filename)
Arguments
xls_filename |
name of an |
Value
a table
Examples
xls_filename <- system.file("extdata", "example.xls", package = "netmhc2pan")
read_netmhc2pan_xls_output(xls_filename)
Run NetMHCIIpan
Description
Run NetMHCIIpan
Usage
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()
)
Arguments
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 |
Value
a data frame with the NetMHCIIpan results
Author(s)
Richèl J.C. Bilderbeek
Examples
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
Description
Install the NetMHCIIpan binary to a local folder
Usage
set_up_netmhc2pan(
netmhc2pan_folder_name = get_default_netmhc2pan_folder(),
verbose = FALSE
)
Arguments
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 |
Value
Nothing
Author(s)
Richèl J.C. Bilderbeek
Convert a formal haplotype name to its NetMHC2pan notation
Description
Convert a formal MHC-II haplotype name to the notation used by NetMHC2pan.
Usage
to_netmhc2pan_name(mhc_haplotype)
Arguments
mhc_haplotype |
one MHC haplotype, e.g. |
Value
the haplotype name in NetMHC2pan notation
Examples
to_netmhc2pan_name("HLA-DRB1*0101")
to_netmhc2pan_name("HLA-DQA1*0501/DQB1*0201")
Uninstall NetMHCIIpan
Description
Uninstall NetMHCIIpan
Usage
uninstall_netmhc2pan(netmhc2pan_folder_name = get_default_netmhc2pan_folder())
Arguments
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. |
Value
Nothing
Author(s)
Richèl J.C. Bilderbeek