| Title: | Call MHCnuggets |
|---|---|
| Description: | MHCnuggets (<https://github.com/KarchinLab/mhcnuggets>) is a Python tool to predict MHC class I and MHC class II epitopes. This package allows one to call MHCnuggets from R. |
| Authors: | Richèl J.C. Bilderbeek [aut, cre] (ORCID: <https://orcid.org/0000-0003-1107-7049>), Joshua van Waardenberg [ctb] |
| Maintainer: | Richèl J.C. Bilderbeek <[email protected]> |
| License: | GPL-3 |
| Version: | 1.2.2 |
| Built: | 2026-07-02 15:16:50 UTC |
| Source: | https://github.com/richelbilderbeek/mhcnuggetsr |
Determine if an HLA haplotype name follow the name format that MHCnuggets uses internally
are_mhcnuggets_names(mhcs)are_mhcnuggets_names(mhcs)
mhcs |
the MHC haplotype names |
a vector of booleans, TRUE for HLA haplotypes that follow the MHCnuggets naming convention
if (is_mhcnuggets_installed()) { are_mhcnuggets_names(get_mhc_1_haplotypes()) are_mhcnuggets_names(get_mhc_2_haplotypes()) }if (is_mhcnuggets_installed()) { are_mhcnuggets_names(get_mhc_1_haplotypes()) are_mhcnuggets_names(get_mhc_2_haplotypes()) }
ba_models
Check the ba_models
Will stop if it is invalid.
check_ba_models(ba_models)check_ba_models(ba_models)
ba_models |
Set to TRUE to use a pure BA model |
Nothing.
Richèl J.C. Bilderbeek
check_ba_models(TRUE) check_ba_models(FALSE)check_ba_models(TRUE) check_ba_models(FALSE)
Check if a file exists. stop otherwise.
check_file_exists(filename)check_file_exists(filename)
filename |
name of a file |
TRUE if MHCnuggets is installed
Richèl J.C. Bilderbeek
mhc is a valud MHCnuggets nameCheck if mhc is a valud MHCnuggets name
check_mhc(mhc)check_mhc(mhc)
mhc |
the MHC haplotype name |
Richèl J.C. Bilderbeek
# MHCnuggets uses names without the asterisk check_mhc("HLA-A01:01") # The official name is not the name format used by MHCnuggets # check_mhc("HLA-A*01:01")# MHCnuggets uses names without the asterisk check_mhc("HLA-A01:01") # The official name is not the name format used by MHCnuggets # check_mhc("HLA-A*01:01")
Check the MHC class. Will stop if it is invalid.
check_mhc_class(mhc_class)check_mhc_class(mhc_class)
mhc_class |
MHC class. Must be |
Nothing.
Richèl J.C. Bilderbeek
check_mhc_class("I") check_mhc_class("II") check_mhc_class(NA)check_mhc_class("I") check_mhc_class("II") check_mhc_class(NA)
Check if MHCnuggets is installed. Will stop if not.
check_mhcnuggets_installation( mhcnuggetsr_folder = get_default_mhcnuggetsr_folder(), ormr_folder_name = get_default_orm_folder_name() )check_mhcnuggets_installation( mhcnuggetsr_folder = get_default_mhcnuggetsr_folder(), ormr_folder_name = get_default_orm_folder_name() )
mhcnuggetsr_folder |
folder where |
ormr_folder_name |
folder used by the |
An MHCnuggets installation has two parts:
The installation of the Python package, for running the code
The download of the Python source code, which allows the use of example files
Nothing.
Richèl J.C. Bilderbeek
if (is_mhcnuggets_installed()) { check_mhcnuggets_installation() }if (is_mhcnuggets_installed()) { check_mhcnuggets_installation() }
Check the MHCnuggets options. Will stop if the options are invalid.
check_mhcnuggets_options(mhcnuggets_options)check_mhcnuggets_options(mhcnuggets_options)
mhcnuggets_options |
options to run MHCnuggets with, as can be created by create_mhcnuggets_options. |
an mhcnuggets_options created
by create_mhcnuggets_options is always
checked by check_mhcnuggets_options
Richèl J.C. Bilderbeek
if (is_mhcnuggets_installed()) { check_mhcnuggets_options(create_test_mhcnuggets_options()) }if (is_mhcnuggets_installed()) { check_mhcnuggets_options(create_test_mhcnuggets_options()) }
mhcnuggets_options list.Check the names of the elements in an mhcnuggets_options list.
Will stop if an element is missing.
check_mhcnuggets_options_names(mhcnuggets_options)check_mhcnuggets_options_names(mhcnuggets_options)
mhcnuggets_options |
options to run MHCnuggets with, as can be created by create_mhcnuggets_options. |
Richèl J.C. Bilderbeek
if (is_mhcnuggets_installed()) { check_mhcnuggets_options_names( create_test_mhcnuggets_options() ) }if (is_mhcnuggets_installed()) { check_mhcnuggets_options_names( create_test_mhcnuggets_options() ) }
mhcnuggets_url
Check the mhcnuggets_url.
Will stop if it is invalid.
check_mhcnuggets_url(mhcnuggets_url)check_mhcnuggets_url(mhcnuggets_url)
mhcnuggets_url |
URL to the MHCnuggets GitHub repository |
Nothing.
Richèl J.C. Bilderbeek
check_mhcnuggets_url("/home/username")check_mhcnuggets_url("/home/username")
mhcnuggetsr_folder
Check the mhcnuggetsr_folder.
Will stop if it is invalid.
check_mhcnuggetsr_folder(mhcnuggetsr_folder)check_mhcnuggetsr_folder(mhcnuggetsr_folder)
mhcnuggetsr_folder |
folder where |
Nothing.
Richèl J.C. Bilderbeek
check_mhcnuggetsr_folder("/home/username")check_mhcnuggetsr_folder("/home/username")
verbose
Check the verbose
Will stop if it is invalid.
check_verbose(verbose)check_verbose(verbose)
verbose |
set to TRUE for more debug information |
Nothing.
Richèl J.C. Bilderbeek
check_verbose(TRUE) check_verbose(FALSE)check_verbose(TRUE) check_verbose(FALSE)
Create a set of options to run MHCnuggets with.
create_mhcnuggets_options( mhc_class = NA, mhc, ba_models = FALSE, verbose = FALSE, mhcnuggetsr_folder = get_default_mhcnuggets_folder(), mhcnuggets_url = get_mhcnuggets_url(), folder_name = "deprecated" )create_mhcnuggets_options( mhc_class = NA, mhc, ba_models = FALSE, verbose = FALSE, mhcnuggetsr_folder = get_default_mhcnuggets_folder(), mhcnuggets_url = get_mhcnuggets_url(), folder_name = "deprecated" )
mhc_class |
MHC class. Must be |
mhc |
the MHC haplotype name |
ba_models |
Set to TRUE to use a pure BA model |
verbose |
set to TRUE for more debug information |
mhcnuggetsr_folder |
folder where |
mhcnuggets_url |
URL to the MHCnuggets GitHub repository |
folder_name |
deprecated name for 'mhcnuggetsr_folder' |
This function will give an error message if the arguments are invalid.
an mhcnuggets_options
an mhcnuggets_options created
by create_mhcnuggets_options is always
checked by check_mhcnuggets_options
Richèl J.C. Bilderbeek
use create_test_mhcnuggets_options to create an MHCnuggets object for testing
if (is_mhcnuggets_installed()) { create_mhcnuggets_options( mhc = "HLA-A02:01" ) }if (is_mhcnuggets_installed()) { create_mhcnuggets_options( mhc = "HLA-A02:01" ) }
Create a path to a non-existing temporary file
create_temp_peptides_path(fileext = ".fasta")create_temp_peptides_path(fileext = ".fasta")
fileext |
file extension |
Richèl J.C. Bilderbeek
create_temp_peptides_path()create_temp_peptides_path()
Create a set of testing options to run MHCnuggets with. The most important setting is the use of a specific haplotype.
create_test_mhcnuggets_options( mhc_class = NA, mhc = "HLA-A02:01", ba_models = FALSE, verbose = FALSE, mhcnuggetsr_folder = get_default_mhcnuggets_folder(), mhcnuggets_url = get_mhcnuggets_url(), folder_name = "deprecated" )create_test_mhcnuggets_options( mhc_class = NA, mhc = "HLA-A02:01", ba_models = FALSE, verbose = FALSE, mhcnuggetsr_folder = get_default_mhcnuggets_folder(), mhcnuggets_url = get_mhcnuggets_url(), folder_name = "deprecated" )
mhc_class |
MHC class. Must be |
mhc |
the MHC haplotype name |
ba_models |
Set to TRUE to use a pure BA model |
verbose |
set to TRUE for more debug information |
mhcnuggetsr_folder |
folder where |
mhcnuggets_url |
URL to the MHCnuggets GitHub repository |
folder_name |
deprecated name for 'mhcnuggetsr_folder' |
Richèl J.C. Bilderbeek
if (is_mhcnuggets_installed()) { create_test_mhcnuggets_options() }if (is_mhcnuggets_installed()) { create_test_mhcnuggets_options() }
This function does nothing. It is intended to inherit the documentation of the parameters from.
default_params_doc( ba_models, filename, mhc, mhcs, mhc_class, mhcnuggets_options, mhcnuggets_output_filename, mhcnuggets_url, mhcnuggetsr_folder, n_aas, ormr_folder_name, peptide, peptides, peptide_length, peptides_path, protein_sequence, python_version, verbose )default_params_doc( ba_models, filename, mhc, mhcs, mhc_class, mhcnuggets_options, mhcnuggets_output_filename, mhcnuggets_url, mhcnuggetsr_folder, n_aas, ormr_folder_name, peptide, peptides, peptide_length, peptides_path, protein_sequence, python_version, verbose )
ba_models |
Set to TRUE to use a pure BA model |
filename |
name of a file |
mhc |
the MHC haplotype name |
mhcs |
the MHC haplotype names |
mhc_class |
MHC class. Must be |
mhcnuggets_options |
options to run MHCnuggets with, as can be created by create_mhcnuggets_options. |
mhcnuggets_output_filename |
name of a temporary file where MHCnuggets writes its output to |
mhcnuggets_url |
URL to the MHCnuggets GitHub repository |
mhcnuggetsr_folder |
folder where |
n_aas |
number of amino acids |
ormr_folder_name |
folder used by the |
peptide |
one peptide sequence |
peptides |
one of more peptide sequences |
peptide_length |
length of a peptide, in number of amino acids |
peptides_path |
the path to the peptides |
protein_sequence |
protein sequence, in uppercase,
for example |
python_version |
the Python version as a string |
verbose |
set to TRUE for more debug information |
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
Set the version of pip to a specific earlier version.
downgrade_pip(version = "9.0.0")downgrade_pip(version = "9.0.0")
version |
pip version |
Nothing
Richèl J.C. Bilderbeek
use upgrade_pip to set pip to the latest version. Use set_pip_version to install a specific version of pip
## Not run: if (is_pip_installed()) { downgrade_pip() } ## End(Not run)## Not run: if (is_pip_installed()) { downgrade_pip() } ## End(Not run)
MHCnuggets by defaultGet the path to the folder where this package installs
MHCnuggets by default
get_default_mhcnuggets_folder( mhcnuggetsr_folder = get_default_mhcnuggetsr_folder() )get_default_mhcnuggets_folder( mhcnuggetsr_folder = get_default_mhcnuggetsr_folder() )
mhcnuggetsr_folder |
folder where |
the path to the folder where this package installs 'MHCnuggets“ by default
Richèl J.C. Bilderbeek
get_default_mhcnuggets_folder()get_default_mhcnuggets_folder()
Get the path to the folder where this package installs the required Python packages by default
get_default_mhcnuggetsr_folder()get_default_mhcnuggetsr_folder()
the path to the folder where this package installs the required Python packages by default
Richèl J.C. Bilderbeek
there are two default folders:
the default mhcnuggetsr folder, as can be obtained
with get_default_mhcnuggetsr_folder.
This is where the Python packages needed are installed,
using the ormr package: the ormr_folder_name
equals the mhcnuggetsr_folder
the default MHCnuggets folder, as can be obtained
with get_default_mhcnuggets_folder.
This is where the MHCnuggets source code is cloned to.
get_default_mhcnuggetsr_folder()get_default_mhcnuggetsr_folder()
This is either python3 (such as in this case, when the user uses pip
to install Python packages) or a folder where ormr installs
Python packages using reticulate.
get_default_orm_folder_name()get_default_orm_folder_name()
the default ormr folder
Richèl J.C. Bilderbeek
get_default_orm_folder_name()get_default_orm_folder_name()
ormr folder nameGet the default ormr folder name
get_default_ormr_folder_name()get_default_ormr_folder_name()
the default ormr folder name
Richèl J.C. Bilderbeek
get_default_ormr_folder_name()get_default_ormr_folder_name()
Get the default version of Python used
get_default_python_version()get_default_python_version()
the default version of Python used as a string
Richèl J.C. Bilderbeek
get_default_python_version()get_default_python_version()
Get the full path to an MHCnuggets example file
get_example_filename( filename = "test_peptides.peps", mhcnuggetsr_folder = get_default_mhcnuggetsr_folder() )get_example_filename( filename = "test_peptides.peps", mhcnuggetsr_folder = get_default_mhcnuggetsr_folder() )
filename |
name of the example file, without the path |
mhcnuggetsr_folder |
folder where |
the full path to an MHCnuggets example file
Richèl J.C. Bilderbeek
use get_example_filenames to get all MHCnuggets example filenames
if (is_mhcnuggets_installed()) { get_example_filename("test_peptides.peps") }if (is_mhcnuggets_installed()) { get_example_filename("test_peptides.peps") }
Get the full path to all MHCnuggets example files
get_example_filenames( mhcnuggetsr_folder = get_default_mhcnuggetsr_folder(), ormr_folder_name = get_default_orm_folder_name() )get_example_filenames( mhcnuggetsr_folder = get_default_mhcnuggetsr_folder(), ormr_folder_name = get_default_orm_folder_name() )
mhcnuggetsr_folder |
folder where |
ormr_folder_name |
folder used by the |
a character vector with all MHCnuggets example files
Richèl J.C. Bilderbeek
use get_example_filename to get the full path to a MHCnuggets example file
if (is_mhcnuggets_installed()) { get_example_filenames() }if (is_mhcnuggets_installed()) { get_example_filenames() }
Get all the MHC-I haplotypes that MHCnuggets has been trained upon.
get_mhc_1_haplotypes( mhcnuggetsr_folder = get_default_mhcnuggets_folder(), ormr_folder_name = get_default_orm_folder_name() )get_mhc_1_haplotypes( mhcnuggetsr_folder = get_default_mhcnuggets_folder(), ormr_folder_name = get_default_orm_folder_name() )
mhcnuggetsr_folder |
folder where |
ormr_folder_name |
folder used by the |
a character vector with haplotype names in MHCnuggets format
Richèl J.C. Bilderbeek
if (is_mhcnuggets_installed()) { get_mhc_1_haplotypes() }if (is_mhcnuggets_installed()) { get_mhc_1_haplotypes() }
Get all the MHC-II haplotypes that MHCnuggets has been trained upon.
get_mhc_2_haplotypes( mhcnuggetsr_folder = get_default_mhcnuggets_folder(), ormr_folder_name = get_default_orm_folder_name() )get_mhc_2_haplotypes( mhcnuggetsr_folder = get_default_mhcnuggets_folder(), ormr_folder_name = get_default_orm_folder_name() )
mhcnuggetsr_folder |
folder where |
ormr_folder_name |
folder used by the |
a character vector with haplotype names in MHCnuggets format
Richèl J.C. Bilderbeek
if (is_mhcnuggets_installed()) { get_mhc_2_haplotypes() }if (is_mhcnuggets_installed()) { get_mhc_2_haplotypes() }
Get the URL of the MHCnuggets source code
get_mhcnuggets_url()get_mhcnuggets_url()
a string that is a URL
Richèl J.C. Bilderbeek
get_mhcnuggets_url()get_mhcnuggets_url()
Get the MHCnuggets version
get_mhcnuggets_version( mhcnuggetsr_folder = get_default_mhcnuggetsr_folder(), ormr_folder_name = get_default_orm_folder_name() )get_mhcnuggets_version( mhcnuggetsr_folder = get_default_mhcnuggetsr_folder(), ormr_folder_name = get_default_orm_folder_name() )
mhcnuggetsr_folder |
folder where |
ormr_folder_name |
folder used by the |
a string that is a version, for example 2.3.2
Richèl J.C. Bilderbeek
if (is_mhcnuggets_installed()) { get_mhcnuggets_version() }if (is_mhcnuggets_installed()) { get_mhcnuggets_version() }
Get the version of all Python packages
get_python_package_versions()get_python_package_versions()
a tibble with two columns: (1) package, the name of the
package, for example absl-py, (2) version, the version
of that package, for example 0.9.0
Richèl J.C. Bilderbeek
if (rappdirs::app_dir()$os != "win" && is_pip_installed()) { get_python_package_versions() }if (rappdirs::app_dir()$os != "win" && is_pip_installed()) { get_python_package_versions() }
Get all the MHC-I haplotypes that have been trained on a model
get_trained_mhc_1_haplotypes( mhcnuggetsr_folder = get_default_mhcnuggets_folder(), ormr_folder_name = get_default_orm_folder_name() )get_trained_mhc_1_haplotypes( mhcnuggetsr_folder = get_default_mhcnuggets_folder(), ormr_folder_name = get_default_orm_folder_name() )
mhcnuggetsr_folder |
folder where |
ormr_folder_name |
folder used by the |
a character vector with haplotype names in MHCnuggets format
Richèl J.C. Bilderbeek
if (is_mhcnuggets_installed()) { get_trained_mhc_1_haplotypes() }if (is_mhcnuggets_installed()) { get_trained_mhc_1_haplotypes() }
Get all the MHC-II haplotypes that have been trained on a model
get_trained_mhc_2_haplotypes( mhcnuggetsr_folder = get_default_mhcnuggets_folder(), ormr_folder_name = get_default_orm_folder_name() )get_trained_mhc_2_haplotypes( mhcnuggetsr_folder = get_default_mhcnuggets_folder(), ormr_folder_name = get_default_orm_folder_name() )
mhcnuggetsr_folder |
folder where |
ormr_folder_name |
folder used by the |
a character vector with haplotype names in MHCnuggets format
Richèl J.C. Bilderbeek
if (is_mhcnuggets_installed()) { get_trained_mhc_2_haplotypes() }if (is_mhcnuggets_installed()) { get_trained_mhc_2_haplotypes() }
MHCnuggets Python package.Install the MHCnuggets Python package.
install_mhcnuggets(folder_name = "deprecated", mhcnuggets_url = "deprecated")install_mhcnuggets(folder_name = "deprecated", mhcnuggets_url = "deprecated")
folder_name |
deprecated name for 'mhcnuggetsr_folder' |
mhcnuggets_url |
URL to the MHCnuggets GitHub repository |
Nothing
Richèl J.C. Bilderbeek
## Not run: install_mhcnuggets() ## End(Not run)## Not run: install_mhcnuggets() ## End(Not run)
Install pip.
install_pip( python_script_filename = file.path(tmpdir = rappdirs::user_cache_dir(), "temp_install_pip.py") )install_pip( python_script_filename = file.path(tmpdir = rappdirs::user_cache_dir(), "temp_install_pip.py") )
python_script_filename |
name of a temporary Python script file. Will be deleted at the end of the function |
Nothing
Richèl J.C. Bilderbeek
## Not run: install_pip() ## End(Not run)## Not run: install_pip() ## End(Not run)
Check if MHCnuggets is installed
is_mhcnuggets_installed(mhcnuggetsr_folder = get_default_mhcnuggetsr_folder())is_mhcnuggets_installed(mhcnuggetsr_folder = get_default_mhcnuggetsr_folder())
mhcnuggetsr_folder |
folder where |
TRUE if MHCnuggets is installed
Richèl J.C. Bilderbeek
is_mhcnuggets_installed()is_mhcnuggets_installed()
Determine if an HLA haplotype name follow the name format that MHCnuggets uses internally
is_mhcnuggets_name(mhc)is_mhcnuggets_name(mhc)
mhc |
the MHC haplotype name |
TRUE if the name follows the MHCnuggets naming convention
# The official name is not the name format used by MHCnuggets is_mhcnuggets_name("HLA-A*01:01") # MHCnuggets uses names without the asterisk is_mhcnuggets_name("HLA-A01:01")# The official name is not the name format used by MHCnuggets is_mhcnuggets_name("HLA-A*01:01") # MHCnuggets uses names without the asterisk is_mhcnuggets_name("HLA-A01:01")
mhcnuggets_options?Determine if the MHCnuggets options is valid.
is_mhcnuggets_options(mhcnuggets_options)is_mhcnuggets_options(mhcnuggets_options)
mhcnuggets_options |
options to run MHCnuggets with, as can be created by create_mhcnuggets_options. |
TRUE if this a valid set of MHCnuggets options
Richèl J.C. Bilderbeek
if (is_mhcnuggets_installed()) { is_mhcnuggets_options(create_test_mhcnuggets_options()) }if (is_mhcnuggets_installed()) { is_mhcnuggets_options(create_test_mhcnuggets_options()) }
Determines if the environment is AppVeyor
is_on_appveyor()is_on_appveyor()
TRUE if run on AppVeyor, FALSE otherwise
Richèl J.C. Bilderbeek
is_on_appveyor()is_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
Richèl J.C. Bilderbeek
is_on_ci()is_on_ci()
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
is_on_travis()is_on_travis()
Determine if pip is installed
is_pip_installed()is_pip_installed()
TRUE if pip is installed, FALSE otherwise
Richèl J.C. Bilderbeek
is_pip_installed()is_pip_installed()
mhcnuggets_options to textConvert a mhcnuggets_options to text
mhcnuggets_options_to_text(mhcnuggets_options)mhcnuggets_options_to_text(mhcnuggets_options)
mhcnuggets_options |
options to run MHCnuggets with, as can be created by create_mhcnuggets_options. |
Nothing.
Richèl J.C. Bilderbeek
if (is_mhcnuggets_installed()) { mhcnuggets_options_to_text(create_test_mhcnuggets_options()) }if (is_mhcnuggets_installed()) { mhcnuggets_options_to_text(create_test_mhcnuggets_options()) }
Create a mhcnuggetsr report, to be used when reporting bugs
mhcnuggetsr_report( mhcnuggetsr_folder = get_default_mhcnuggetsr_folder(), ormr_folder_name = get_default_orm_folder_name() )mhcnuggetsr_report( mhcnuggetsr_folder = get_default_mhcnuggetsr_folder(), ormr_folder_name = get_default_orm_folder_name() )
mhcnuggetsr_folder |
folder where |
ormr_folder_name |
folder used by the |
Richèl J.C. Bilderbeek
## Not run: mhcnuggetsr_report() ## End(Not run)## Not run: mhcnuggetsr_report() ## End(Not run)
Self-test the package
mhcnuggetsr_self_test( mhcnuggets_options = create_test_mhcnuggets_options(), peptides_path = create_temp_peptides_path(), mhcnuggets_output_filename = mhcnuggetsr::create_temp_peptides_path(fileext = ".csv"), verbose = FALSE )mhcnuggetsr_self_test( mhcnuggets_options = create_test_mhcnuggets_options(), peptides_path = create_temp_peptides_path(), mhcnuggets_output_filename = mhcnuggetsr::create_temp_peptides_path(fileext = ".csv"), verbose = FALSE )
mhcnuggets_options |
options to run MHCnuggets with, as can be created by create_mhcnuggets_options. |
peptides_path |
the path to the peptides |
mhcnuggets_output_filename |
name of a temporary file where MHCnuggets writes its output to |
verbose |
set to TRUE for more debug information |
Richèl J.C. Bilderbeek
if (is_mhcnuggets_installed()) { mhcnuggetsr_self_test() }if (is_mhcnuggets_installed()) { mhcnuggetsr_self_test() }
Predict the half maximal inhibitory concentration (aka IC50) (in nM) for one or more peptides. Each peptide must be 15 amino acids at most (use predict_ic50s to predict the IC50s for longer peptides)
predict_ic50( mhcnuggets_options, peptides, peptides_path = create_temp_peptides_path(), mhcnuggets_output_filename = mhcnuggetsr::create_temp_peptides_path(fileext = ".csv"), verbose = FALSE )predict_ic50( mhcnuggets_options, peptides, peptides_path = create_temp_peptides_path(), mhcnuggets_output_filename = mhcnuggetsr::create_temp_peptides_path(fileext = ".csv"), verbose = FALSE )
mhcnuggets_options |
options to run MHCnuggets with, as can be created by create_mhcnuggets_options. |
peptides |
one of more peptide sequences |
peptides_path |
the path to the peptides |
mhcnuggets_output_filename |
name of a temporary file where MHCnuggets writes its output to |
verbose |
set to TRUE for more debug information |
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 MHCnuggets reads its input from file. This temporary file is deleted after this function passed successfully.
Richèl J.C. Bilderbeek
if (is_mhcnuggets_installed()) { peptides <- c("AIAACAMLLV", "ALVCYIVMPV", "ALEPRKEIDV") mhc_1_haplotype <- "HLA-A02:01" mhcnuggets_options <- create_mhcnuggets_options( mhc = mhc_1_haplotype ) predict_ic50( peptides = peptides, mhcnuggets_options = mhcnuggets_options ) }if (is_mhcnuggets_installed()) { peptides <- c("AIAACAMLLV", "ALVCYIVMPV", "ALEPRKEIDV") mhc_1_haplotype <- "HLA-A02:01" mhcnuggets_options <- create_mhcnuggets_options( mhc = mhc_1_haplotype ) predict_ic50( peptides = peptides, mhcnuggets_options = mhcnuggets_options ) }
Predict the half maximal inhibitory concentration (aka IC50) (in nM) for one or more peptides as saved in a file. Each peptide must be 15 amino acids at most (use predict_ic50s to predict the IC50s for longer peptides)
predict_ic50_from_file( mhcnuggets_options, peptides_path, mhcnuggets_output_filename = mhcnuggetsr::create_temp_peptides_path(fileext = ".csv"), verbose = FALSE )predict_ic50_from_file( mhcnuggets_options, peptides_path, mhcnuggets_output_filename = mhcnuggetsr::create_temp_peptides_path(fileext = ".csv"), verbose = FALSE )
mhcnuggets_options |
options to run MHCnuggets with, as can be created by create_mhcnuggets_options. |
peptides_path |
the path to the peptides |
mhcnuggets_output_filename |
path to a temporary file to write the MHCnuggets results to. This file will be deleted at the end of the function if it passes successfully. |
verbose |
set to TRUE for more debug information |
Richèl J.C. Bilderbeek
if (is_mhcnuggets_installed()) { peptides_path <- get_example_filename("test_peptides.peps") mhc_1_haplotype <- "HLA-A02:01" mhcnuggets_options <- create_mhcnuggets_options( mhc = mhc_1_haplotype ) predict_ic50_from_file( peptides_path = peptides_path, mhcnuggets_options = mhcnuggets_options ) }if (is_mhcnuggets_installed()) { peptides_path <- get_example_filename("test_peptides.peps") mhc_1_haplotype <- "HLA-A02:01" mhcnuggets_options <- create_mhcnuggets_options( mhc = mhc_1_haplotype ) predict_ic50_from_file( peptides_path = peptides_path, mhcnuggets_options = mhcnuggets_options ) }
Predict the half maximal inhibitory concentrations (aka IC50s) (in nM) of all possible n-mers within a peptide
predict_ic50s( protein_sequence, peptide_length, mhcnuggets_options, peptides_path = create_temp_peptides_path() )predict_ic50s( protein_sequence, peptide_length, mhcnuggets_options, peptides_path = create_temp_peptides_path() )
protein_sequence |
protein sequence, in uppercase,
for example |
peptide_length |
length of a peptide, in number of amino acids |
mhcnuggets_options |
options to run MHCnuggets with, as can be created by create_mhcnuggets_options. |
peptides_path |
the path to the peptides |
a tibble with columns:
peptide the peptide fragment, each of length peptide_length
ic50 the predicted IC50 (in nM)
Richèl J.C. Bilderbeek
if (is_mhcnuggets_installed()) { mhcnuggets_options <- create_mhcnuggets_options( mhc = "HLA-A02:01" ) predict_ic50s( protein_sequence = "AIAACAMLLVCCCCCC", peptide_length = 13, mhcnuggets_options = mhcnuggets_options ) }if (is_mhcnuggets_installed()) { mhcnuggets_options <- create_mhcnuggets_options( mhc = "HLA-A02:01" ) predict_ic50s( protein_sequence = "AIAACAMLLVCCCCCC", peptide_length = 13, mhcnuggets_options = mhcnuggets_options ) }
Set the MHCnuggets installation state to the desired one
set_is_mhcnuggets_installed( is_installed, verbose = "deprecated", folder_name = "deprecated", mhcnuggets_url = "deprecated" )set_is_mhcnuggets_installed( is_installed, verbose = "deprecated", folder_name = "deprecated", mhcnuggets_url = "deprecated" )
is_installed |
|
verbose |
set to TRUE for more debug information |
folder_name |
deprecated name for 'mhcnuggetsr_folder' |
mhcnuggets_url |
URL to the MHCnuggets GitHub repository |
Nothing
Richèl J.C. Bilderbeek
Set the version of pip to a specific version, by installing that version.
set_pip_version(version)set_pip_version(version)
version |
pip version |
Nothing
Richèl J.C. Bilderbeek
use upgrade_pip to set pip to the latest version. Use downgrade_pip to set pip to a specific earlier version.
Convert a standard haplotype name to the MHCnuggets name. Will stop if this conversion fails.
to_mhcnuggets_name(mhc)to_mhcnuggets_name(mhc)
mhc |
the MHC haplotype name |
the MHCnuggets name for the haplotype
Richèl J.C. Bilderbeek
to_mhcnuggets_name("HLA-A*01:01")to_mhcnuggets_name("HLA-A*01:01")
Convert one or more standard haplotype names to the MHCnuggets names. Will stop if this conversion fails.
to_mhcnuggets_names(mhcs)to_mhcnuggets_names(mhcs)
mhcs |
the MHC haplotype names |
the MHCnuggets names for the haplotypes
Richèl J.C. Bilderbeek
to_mhcnuggets_names("HLA-A*01:01")to_mhcnuggets_names("HLA-A*01:01")
Uninstall the MHCnuggets Python package.
uninstall_mhcnuggets(folder_name = "deprecated", mhcnuggets_url = "deprecated")uninstall_mhcnuggets(folder_name = "deprecated", mhcnuggets_url = "deprecated")
folder_name |
deprecated name for 'mhcnuggetsr_folder' |
mhcnuggets_url |
URL to the MHCnuggets GitHub repository |
Richèl J.C. Bilderbeek
Install pip.
uninstall_pip()uninstall_pip()
Nothing
Richèl J.C. Bilderbeek
## Not run: uninstall_pip() ## End(Not run)## Not run: uninstall_pip() ## End(Not run)
Uograde pip.
upgrade_pip()upgrade_pip()
Nothing
Richèl J.C. Bilderbeek
use downgrade_pip to set pip to an earlier version. Use set_pip_version to install a specific version of pip