Package 'mhcnuggetsr'

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

Help Index


Are these MHCnuggets names?

Description

Determine if an HLA haplotype name follow the name format that MHCnuggets uses internally

Usage

are_mhcnuggets_names(mhcs)

Arguments

mhcs

the MHC haplotype names

Value

a vector of booleans, TRUE for HLA haplotypes that follow the MHCnuggets naming convention

Examples

if (is_mhcnuggets_installed()) {
  are_mhcnuggets_names(get_mhc_1_haplotypes())
  are_mhcnuggets_names(get_mhc_2_haplotypes())
}

Check the ba_models

Description

Check the ba_models Will stop if it is invalid.

Usage

check_ba_models(ba_models)

Arguments

ba_models

Set to TRUE to use a pure BA model

Value

Nothing.

Author(s)

Richèl J.C. Bilderbeek

Examples

check_ba_models(TRUE)
check_ba_models(FALSE)

Check if a file exists.

Description

Check if a file exists. stop otherwise.

Usage

check_file_exists(filename)

Arguments

filename

name of a file

Value

TRUE if MHCnuggets is installed

Author(s)

Richèl J.C. Bilderbeek


Check if mhc is a valud MHCnuggets name

Description

Check if mhc is a valud MHCnuggets name

Usage

check_mhc(mhc)

Arguments

mhc

the MHC haplotype name

Author(s)

Richèl J.C. Bilderbeek

Examples

# 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.

Description

Check the MHC class. Will stop if it is invalid.

Usage

check_mhc_class(mhc_class)

Arguments

mhc_class

MHC class. Must be I, II or NA. Use NA to let the class be deduced automatically

Value

Nothing.

Author(s)

Richèl J.C. Bilderbeek

Examples

check_mhc_class("I")
check_mhc_class("II")
check_mhc_class(NA)

Check if MHCnuggets is installed.

Description

Check if MHCnuggets is installed. Will stop if not.

Usage

check_mhcnuggets_installation(
  mhcnuggetsr_folder = get_default_mhcnuggetsr_folder(),
  ormr_folder_name = get_default_orm_folder_name()
)

Arguments

mhcnuggetsr_folder

folder where mhcnuggetsr stores its temporary files. Use get_default_mhcnuggetsr_folder for its default value.

ormr_folder_name

folder used by the ormr package to install Python packages to. Use python3 to install Python packages via pip. Default value is python3

Details

An MHCnuggets installation has two parts:

  1. The installation of the Python package, for running the code

  2. The download of the Python source code, which allows the use of example files

Value

Nothing.

Author(s)

Richèl J.C. Bilderbeek

Examples

if (is_mhcnuggets_installed()) {
  check_mhcnuggets_installation()
}

Check the MHCnuggets options.

Description

Check the MHCnuggets options. Will stop if the options are invalid.

Usage

check_mhcnuggets_options(mhcnuggets_options)

Arguments

mhcnuggets_options

options to run MHCnuggets with, as can be created by create_mhcnuggets_options.

Note

an mhcnuggets_options created by create_mhcnuggets_options is always checked by check_mhcnuggets_options

Author(s)

Richèl J.C. Bilderbeek

Examples

if (is_mhcnuggets_installed()) {
  check_mhcnuggets_options(create_test_mhcnuggets_options())
}

Check the names of the elements in an mhcnuggets_options list.

Description

Check the names of the elements in an mhcnuggets_options list. Will stop if an element is missing.

Usage

check_mhcnuggets_options_names(mhcnuggets_options)

Arguments

mhcnuggets_options

options to run MHCnuggets with, as can be created by create_mhcnuggets_options.

Author(s)

Richèl J.C. Bilderbeek

Examples

if (is_mhcnuggets_installed()) {
  check_mhcnuggets_options_names(
    create_test_mhcnuggets_options()
  )
}

Check the mhcnuggets_url

Description

Check the mhcnuggets_url. Will stop if it is invalid.

Usage

check_mhcnuggets_url(mhcnuggets_url)

Arguments

mhcnuggets_url

URL to the MHCnuggets GitHub repository

Value

Nothing.

Author(s)

Richèl J.C. Bilderbeek

Examples

check_mhcnuggets_url("/home/username")

Check the mhcnuggetsr_folder

Description

Check the mhcnuggetsr_folder. Will stop if it is invalid.

Usage

check_mhcnuggetsr_folder(mhcnuggetsr_folder)

Arguments

mhcnuggetsr_folder

folder where mhcnuggetsr stores its temporary files. Use get_default_mhcnuggetsr_folder for its default value.

Value

Nothing.

Author(s)

Richèl J.C. Bilderbeek

Examples

check_mhcnuggetsr_folder("/home/username")

Check the verbose

Description

Check the verbose Will stop if it is invalid.

Usage

check_verbose(verbose)

Arguments

verbose

set to TRUE for more debug information

Value

Nothing.

Author(s)

Richèl J.C. Bilderbeek

Examples

check_verbose(TRUE)
check_verbose(FALSE)

Create a set of MHCnuggets options.

Description

Create a set of options to run MHCnuggets with.

Usage

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"
)

Arguments

mhc_class

MHC class. Must be I, II or NA. Use NA to let the class be deduced automatically

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 mhcnuggetsr stores its temporary files. Use get_default_mhcnuggetsr_folder for its default value.

mhcnuggets_url

URL to the MHCnuggets GitHub repository

folder_name

deprecated name for 'mhcnuggetsr_folder'

Details

This function will give an error message if the arguments are invalid.

Value

an mhcnuggets_options

Note

an mhcnuggets_options created by create_mhcnuggets_options is always checked by check_mhcnuggets_options

Author(s)

Richèl J.C. Bilderbeek

See Also

use create_test_mhcnuggets_options to create an MHCnuggets object for testing

Examples

if (is_mhcnuggets_installed()) {
  create_mhcnuggets_options(
    mhc = "HLA-A02:01"
  )
}

Create a path to a non-existing temporary file

Description

Create a path to a non-existing temporary file

Usage

create_temp_peptides_path(fileext = ".fasta")

Arguments

fileext

file extension

Author(s)

Richèl J.C. Bilderbeek

Examples

create_temp_peptides_path()

Create testing options for MHCnuggets

Description

Create a set of testing options to run MHCnuggets with. The most important setting is the use of a specific haplotype.

Usage

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"
)

Arguments

mhc_class

MHC class. Must be I, II or NA. Use NA to let the class be deduced automatically

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 mhcnuggetsr stores its temporary files. Use get_default_mhcnuggetsr_folder for its default value.

mhcnuggets_url

URL to the MHCnuggets GitHub repository

folder_name

deprecated name for 'mhcnuggetsr_folder'

Author(s)

Richèl J.C. Bilderbeek

Examples

if (is_mhcnuggets_installed()) {
  create_test_mhcnuggets_options()
}

This function does nothing. It is intended to inherit the documentation of the parameters from.

Description

This function does nothing. It is intended to inherit the documentation of the parameters from.

Usage

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
)

Arguments

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 I, II or NA. Use NA to let the class be deduced automatically

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 mhcnuggetsr stores its temporary files. Use get_default_mhcnuggetsr_folder for its default value.

n_aas

number of amino acids

ormr_folder_name

folder used by the ormr package to install Python packages to. Use python3 to install Python packages via pip. Default value is python3

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 FAMILYVW

python_version

the Python version as a string

verbose

set to TRUE for more debug information

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


Downgrade pip.

Description

Set the version of pip to a specific earlier version.

Usage

downgrade_pip(version = "9.0.0")

Arguments

version

pip version

Value

Nothing

Author(s)

Richèl J.C. Bilderbeek

See Also

use upgrade_pip to set pip to the latest version. Use set_pip_version to install a specific version of pip

Examples

## Not run: 
  if (is_pip_installed()) {
    downgrade_pip()
  }

## End(Not run)

Get the path to the folder where this package installs MHCnuggets by default

Description

Get the path to the folder where this package installs MHCnuggets by default

Usage

get_default_mhcnuggets_folder(
  mhcnuggetsr_folder = get_default_mhcnuggetsr_folder()
)

Arguments

mhcnuggetsr_folder

folder where mhcnuggetsr stores its temporary files. Use get_default_mhcnuggetsr_folder for its default value.

Value

the path to the folder where this package installs 'MHCnuggets“ by default

Author(s)

Richèl J.C. Bilderbeek

Examples

get_default_mhcnuggets_folder()

Get the path to the folder where this package installs the required Python packages by default

Description

Get the path to the folder where this package installs the required Python packages by default

Usage

get_default_mhcnuggetsr_folder()

Value

the path to the folder where this package installs the required Python packages by default

Author(s)

Richèl J.C. Bilderbeek

See Also

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.

Examples

get_default_mhcnuggetsr_folder()

Get the default folder for ormr.

Description

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.

Usage

get_default_orm_folder_name()

Value

the default ormr folder

Author(s)

Richèl J.C. Bilderbeek

Examples

get_default_orm_folder_name()

Get the default ormr folder name

Description

Get the default ormr folder name

Usage

get_default_ormr_folder_name()

Value

the default ormr folder name

Author(s)

Richèl J.C. Bilderbeek

Examples

get_default_ormr_folder_name()

Get the default version of Python used

Description

Get the default version of Python used

Usage

get_default_python_version()

Value

the default version of Python used as a string

Author(s)

Richèl J.C. Bilderbeek

Examples

get_default_python_version()

Get the full path to an MHCnuggets example file

Description

Get the full path to an MHCnuggets example file

Usage

get_example_filename(
  filename = "test_peptides.peps",
  mhcnuggetsr_folder = get_default_mhcnuggetsr_folder()
)

Arguments

filename

name of the example file, without the path

mhcnuggetsr_folder

folder where mhcnuggetsr stores its temporary files. Use get_default_mhcnuggetsr_folder for its default value.

Value

the full path to an MHCnuggets example file

Author(s)

Richèl J.C. Bilderbeek

See Also

use get_example_filenames to get all MHCnuggets example filenames

Examples

if (is_mhcnuggets_installed()) {
  get_example_filename("test_peptides.peps")
}

Get the full path to all MHCnuggets example files

Description

Get the full path to all MHCnuggets example files

Usage

get_example_filenames(
  mhcnuggetsr_folder = get_default_mhcnuggetsr_folder(),
  ormr_folder_name = get_default_orm_folder_name()
)

Arguments

mhcnuggetsr_folder

folder where mhcnuggetsr stores its temporary files. Use get_default_mhcnuggetsr_folder for its default value.

ormr_folder_name

folder used by the ormr package to install Python packages to. Use python3 to install Python packages via pip. Default value is python3

Value

a character vector with all MHCnuggets example files

Author(s)

Richèl J.C. Bilderbeek

See Also

use get_example_filename to get the full path to a MHCnuggets example file

Examples

if (is_mhcnuggets_installed()) {
  get_example_filenames()
}

Get all the MHC-I haplotypes

Description

Get all the MHC-I haplotypes that MHCnuggets has been trained upon.

Usage

get_mhc_1_haplotypes(
  mhcnuggetsr_folder = get_default_mhcnuggets_folder(),
  ormr_folder_name = get_default_orm_folder_name()
)

Arguments

mhcnuggetsr_folder

folder where mhcnuggetsr stores its temporary files. Use get_default_mhcnuggetsr_folder for its default value.

ormr_folder_name

folder used by the ormr package to install Python packages to. Use python3 to install Python packages via pip. Default value is python3

Value

a character vector with haplotype names in MHCnuggets format

Author(s)

Richèl J.C. Bilderbeek

Examples

if (is_mhcnuggets_installed()) {
  get_mhc_1_haplotypes()
}

Get all the MHC-II haplotypes

Description

Get all the MHC-II haplotypes that MHCnuggets has been trained upon.

Usage

get_mhc_2_haplotypes(
  mhcnuggetsr_folder = get_default_mhcnuggets_folder(),
  ormr_folder_name = get_default_orm_folder_name()
)

Arguments

mhcnuggetsr_folder

folder where mhcnuggetsr stores its temporary files. Use get_default_mhcnuggetsr_folder for its default value.

ormr_folder_name

folder used by the ormr package to install Python packages to. Use python3 to install Python packages via pip. Default value is python3

Value

a character vector with haplotype names in MHCnuggets format

Author(s)

Richèl J.C. Bilderbeek

Examples

if (is_mhcnuggets_installed()) {
  get_mhc_2_haplotypes()
}

Get the URL of the MHCnuggets source code

Description

Get the URL of the MHCnuggets source code

Usage

get_mhcnuggets_url()

Value

a string that is a URL

Author(s)

Richèl J.C. Bilderbeek

Examples

get_mhcnuggets_url()

Get the MHCnuggets version

Description

Get the MHCnuggets version

Usage

get_mhcnuggets_version(
  mhcnuggetsr_folder = get_default_mhcnuggetsr_folder(),
  ormr_folder_name = get_default_orm_folder_name()
)

Arguments

mhcnuggetsr_folder

folder where mhcnuggetsr stores its temporary files. Use get_default_mhcnuggetsr_folder for its default value.

ormr_folder_name

folder used by the ormr package to install Python packages to. Use python3 to install Python packages via pip. Default value is python3

Value

a string that is a version, for example 2.3.2

Author(s)

Richèl J.C. Bilderbeek

Examples

if (is_mhcnuggets_installed()) {
  get_mhcnuggets_version()
}

Get the version of all Python packages

Description

Get the version of all Python packages

Usage

get_python_package_versions()

Value

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

Author(s)

Richèl J.C. Bilderbeek

Examples

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

Description

Get all the MHC-I haplotypes that have been trained on a model

Usage

get_trained_mhc_1_haplotypes(
  mhcnuggetsr_folder = get_default_mhcnuggets_folder(),
  ormr_folder_name = get_default_orm_folder_name()
)

Arguments

mhcnuggetsr_folder

folder where mhcnuggetsr stores its temporary files. Use get_default_mhcnuggetsr_folder for its default value.

ormr_folder_name

folder used by the ormr package to install Python packages to. Use python3 to install Python packages via pip. Default value is python3

Value

a character vector with haplotype names in MHCnuggets format

Author(s)

Richèl J.C. Bilderbeek

Examples

if (is_mhcnuggets_installed()) {
  get_trained_mhc_1_haplotypes()
}

Get all the MHC-II haplotypes that have been trained on a model

Description

Get all the MHC-II haplotypes that have been trained on a model

Usage

get_trained_mhc_2_haplotypes(
  mhcnuggetsr_folder = get_default_mhcnuggets_folder(),
  ormr_folder_name = get_default_orm_folder_name()
)

Arguments

mhcnuggetsr_folder

folder where mhcnuggetsr stores its temporary files. Use get_default_mhcnuggetsr_folder for its default value.

ormr_folder_name

folder used by the ormr package to install Python packages to. Use python3 to install Python packages via pip. Default value is python3

Value

a character vector with haplotype names in MHCnuggets format

Author(s)

Richèl J.C. Bilderbeek

Examples

if (is_mhcnuggets_installed()) {
  get_trained_mhc_2_haplotypes()
}

Install the MHCnuggets Python package.

Description

Install the MHCnuggets Python package.

Usage

install_mhcnuggets(folder_name = "deprecated", mhcnuggets_url = "deprecated")

Arguments

folder_name

deprecated name for 'mhcnuggetsr_folder'

mhcnuggets_url

URL to the MHCnuggets GitHub repository

Value

Nothing

Author(s)

Richèl J.C. Bilderbeek

Examples

## Not run: 
  install_mhcnuggets()

## End(Not run)

Install pip.

Description

Install pip.

Usage

install_pip(
  python_script_filename = file.path(tmpdir = rappdirs::user_cache_dir(),
    "temp_install_pip.py")
)

Arguments

python_script_filename

name of a temporary Python script file. Will be deleted at the end of the function

Value

Nothing

Author(s)

Richèl J.C. Bilderbeek

Examples

## Not run: 
  install_pip()

## End(Not run)

Check if MHCnuggets is installed

Description

Check if MHCnuggets is installed

Usage

is_mhcnuggets_installed(mhcnuggetsr_folder = get_default_mhcnuggetsr_folder())

Arguments

mhcnuggetsr_folder

folder where mhcnuggetsr stores its temporary files. Use get_default_mhcnuggetsr_folder for its default value.

Value

TRUE if MHCnuggets is installed

Author(s)

Richèl J.C. Bilderbeek

Examples

is_mhcnuggets_installed()

Is this an MHCnuggets name?

Description

Determine if an HLA haplotype name follow the name format that MHCnuggets uses internally

Usage

is_mhcnuggets_name(mhc)

Arguments

mhc

the MHC haplotype name

Value

TRUE if the name follows the MHCnuggets naming convention

Examples

# 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")

Is this a mhcnuggets_options?

Description

Determine if the MHCnuggets options is valid.

Usage

is_mhcnuggets_options(mhcnuggets_options)

Arguments

mhcnuggets_options

options to run MHCnuggets with, as can be created by create_mhcnuggets_options.

Value

TRUE if this a valid set of MHCnuggets options

Author(s)

Richèl J.C. Bilderbeek

Examples

if (is_mhcnuggets_installed()) {
  is_mhcnuggets_options(create_test_mhcnuggets_options())
}

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

is_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

Author(s)

Richèl J.C. Bilderbeek

Examples

is_on_ci()

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

is_on_travis()

Determine if pip is installed

Description

Determine if pip is installed

Usage

is_pip_installed()

Value

TRUE if pip is installed, FALSE otherwise

Author(s)

Richèl J.C. Bilderbeek

Examples

is_pip_installed()

Convert a mhcnuggets_options to text

Description

Convert a mhcnuggets_options to text

Usage

mhcnuggets_options_to_text(mhcnuggets_options)

Arguments

mhcnuggets_options

options to run MHCnuggets with, as can be created by create_mhcnuggets_options.

Value

Nothing.

Author(s)

Richèl J.C. Bilderbeek

Examples

if (is_mhcnuggets_installed()) {
  mhcnuggets_options_to_text(create_test_mhcnuggets_options())
}

Create a mhcnuggetsr report, to be used when reporting bugs

Description

Create a mhcnuggetsr report, to be used when reporting bugs

Usage

mhcnuggetsr_report(
  mhcnuggetsr_folder = get_default_mhcnuggetsr_folder(),
  ormr_folder_name = get_default_orm_folder_name()
)

Arguments

mhcnuggetsr_folder

folder where mhcnuggetsr stores its temporary files. Use get_default_mhcnuggetsr_folder for its default value.

ormr_folder_name

folder used by the ormr package to install Python packages to. Use python3 to install Python packages via pip. Default value is python3

Author(s)

Richèl J.C. Bilderbeek

Examples

## Not run: 
  mhcnuggetsr_report()

## End(Not run)

Self-test the package

Description

Self-test the package

Usage

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
)

Arguments

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

Author(s)

Richèl J.C. Bilderbeek

Examples

if (is_mhcnuggets_installed()) {
  mhcnuggetsr_self_test()
}

Predict the IC50 for peptides.

Description

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)

Usage

predict_ic50(
  mhcnuggets_options,
  peptides,
  peptides_path = create_temp_peptides_path(),
  mhcnuggets_output_filename = mhcnuggetsr::create_temp_peptides_path(fileext = ".csv"),
  verbose = FALSE
)

Arguments

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

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 MHCnuggets 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_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)

Description

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)

Usage

predict_ic50_from_file(
  mhcnuggets_options,
  peptides_path,
  mhcnuggets_output_filename = mhcnuggetsr::create_temp_peptides_path(fileext = ".csv"),
  verbose = FALSE
)

Arguments

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

Author(s)

Richèl J.C. Bilderbeek

Examples

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

Description

Predict the half maximal inhibitory concentrations (aka IC50s) (in nM) of all possible n-mers within a peptide

Usage

predict_ic50s(
  protein_sequence,
  peptide_length,
  mhcnuggets_options,
  peptides_path = create_temp_peptides_path()
)

Arguments

protein_sequence

protein sequence, in uppercase, for example FAMILYVW

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

Value

a tibble with columns:

  • peptide the peptide fragment, each of length peptide_length

  • ic50 the predicted IC50 (in nM)

Author(s)

Richèl J.C. Bilderbeek

Examples

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

Description

Set the MHCnuggets installation state to the desired one

Usage

set_is_mhcnuggets_installed(
  is_installed,
  verbose = "deprecated",
  folder_name = "deprecated",
  mhcnuggets_url = "deprecated"
)

Arguments

is_installed

the desired installation state. Must be TRUE or FALSE

verbose

set to TRUE for more debug information

folder_name

deprecated name for 'mhcnuggetsr_folder'

mhcnuggets_url

URL to the MHCnuggets GitHub repository

Value

Nothing

Author(s)

Richèl J.C. Bilderbeek


Set the version of pip.

Description

Set the version of pip to a specific version, by installing that version.

Usage

set_pip_version(version)

Arguments

version

pip version

Value

Nothing

Author(s)

Richèl J.C. Bilderbeek

See Also

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

Description

Convert a standard haplotype name to the MHCnuggets name. Will stop if this conversion fails.

Usage

to_mhcnuggets_name(mhc)

Arguments

mhc

the MHC haplotype name

Value

the MHCnuggets name for the haplotype

Author(s)

Richèl J.C. Bilderbeek

Examples

to_mhcnuggets_name("HLA-A*01:01")

Convert one or more standard haplotype name to the MHCnuggets names

Description

Convert one or more standard haplotype names to the MHCnuggets names. Will stop if this conversion fails.

Usage

to_mhcnuggets_names(mhcs)

Arguments

mhcs

the MHC haplotype names

Value

the MHCnuggets names for the haplotypes

Author(s)

Richèl J.C. Bilderbeek

Examples

to_mhcnuggets_names("HLA-A*01:01")

Uninstall the MHCnuggets Python package.

Description

Uninstall the MHCnuggets Python package.

Usage

uninstall_mhcnuggets(folder_name = "deprecated", mhcnuggets_url = "deprecated")

Arguments

folder_name

deprecated name for 'mhcnuggetsr_folder'

mhcnuggets_url

URL to the MHCnuggets GitHub repository

Author(s)

Richèl J.C. Bilderbeek


Install pip.

Description

Install pip.

Usage

uninstall_pip()

Value

Nothing

Author(s)

Richèl J.C. Bilderbeek

Examples

## Not run: 
  uninstall_pip()

## End(Not run)

Uograde pip.

Description

Uograde pip.

Usage

upgrade_pip()

Value

Nothing

Author(s)

Richèl J.C. Bilderbeek

See Also

use downgrade_pip to set pip to an earlier version. Use set_pip_version to install a specific version of pip