Fred2.HLAtyping Module

HLAtyping.External

class Fred2.HLAtyping.External.AExternalHLATyping

Bases: Fred2.Core.Base.AHLATyping, Fred2.Core.Base.AExternal

clean_up(_output)

Cleans the generated files after prediction

Parameters:output (str) – The path to the output file or directory
command

Defines the commandline call for external tool

get_external_version(path=None)

Returns the external version of the tool by executing >{command} –version

might be dependent on the method and has to be overwritten therefore it is declared abstract to enforce the user to overwrite the method. The function in the base class can be called with super()

Parameters:path (str) –
  • Optional specification of executable path if deviant from self.__command
Returns:The external version of the tool or None if tool does not support versioning
Return type:str
is_in_path()

Checks whether the specified execution command can be found in PATH

Returns:Whether or not command could be found in PATH
Return type:bool
name

The name of the predictor

parse_external_result(file)

Parses external results and returns the result

Parameters:file (str) – The file path or the external prediction results
Returns:A dictionary containing the prediction results
Return type:dict
predict(ngsFile, output, command=None, options=None, delete=True, **kwargs)

Implementation of prediction

Parameters:
  • ngsFile (str) – The path to the NGS file of interest
  • output (str) – The path to the output file or directory
  • command (str) – The path to a alternative binary (if binary is not globally executable)
  • options (str) – A string with additional options that is directly past to the tool
  • delete (bool) – Boolean indicator whether generated files should be deleted afterwards
Returns:

A list of Allele objects representing the most likely HLA genotype

Return type:

list(Allele)

version

Parameter specifying the version of the prediction method

class Fred2.HLAtyping.External.ATHLATES_1_0

Bases: Fred2.HLAtyping.External.AExternalHLATyping

Wrapper for ATHLATES.

Note

C. Liu, X. Yang, B. Duffy, T. Mohanakumar, R.D. Mitra, M.C. Zody, J.D. Pfeifer (2012) ATHLATES: accurate typing of human leukocyte antigen through exome sequencing, Nucl. Acids Res. (2013)

clean_up(output)

Deletes files created by ATHLATES within _output

Parameters:output (str) – The path to the output file or directory of the programme
command

Defines the commandline call for external tool

get_external_version(path=None)

Returns the external version of the tool by executing >{command} –version

might be dependent on the method and has to be overwritten therefore it is declared abstract to enforce the user to overwrite the method. The function in the base class can be called with super()

Parameters:path (str) – Optional specification of executable path if deviant from self.__command
Returns:The external version of the tool or None if tool does not support versioning
Return type:str
is_in_path()

Checks whether the specified execution command can be found in PATH

Returns:Whether or not command could be found in PATH
Return type:bool
name

The name of the predictor

parse_external_result(output)

Searches within the defined dir _file for the newest dir and reads the prediction file from there

Parameters:output (str) – The path to the output dir
Returns:The predicted HLA genotype
Return type:list(Allele)
predict(ngsFile, output, command=None, options=None, delete=True, **kwargs)

Implementation of prediction

Parameters:
  • ngsFile (str) – The path to the NGS file of interest
  • output (str) – The path to the output file or directory
  • command (str) – The path to a alternative binary (if binary is not globally executable)
  • options (str) – A string with additional options that is directly past to the tool
  • delete (bool) – Boolean indicator whether generated files should be deleted afterwards
Returns:

A list of Allele objects representing the most likely HLA genotype

Return type:

list(Allele)

version

The version of the predictor

class Fred2.HLAtyping.External.OptiType_1_0

Bases: Fred2.HLAtyping.External.AExternalHLATyping

Wrapper of OptiType v1.0.

Note

Szolek, A., Schubert, B., Mohr, C., Sturm, M., Feldhahn, M., & Kohlbacher, O. (2014). OptiType: precision HLA typing from next-generation sequencing data. Bioinformatics, 30(23), 3310-3316.

clean_up(output)

Searches within the defined dir _file for the newest dir and deletes it. This should be the one OptiType had created

This could cause some terrible site effects if someone or something also writes in that directory!! OptiType should change the way it writes its output!

Parameters:output (str) – The path to the output file or directory of the programme
command

Defines the commandline call for external tool

get_external_version(path=None)

Returns the external version of the tool by executing >{command} –version

might be dependent on the method and has to be overwritten therefore it is declared abstract to enforce the user to overwrite the method. The function in the base class can be called with super()

Parameters:path (str) – Optional specification of executable path if deviant from self.command
Returns:The external version of the tool or None if tool does not support versioning
Return type:str
is_in_path()

Checks whether the specified execution command can be found in PATH

Returns:Whether or not command could be found in PATH
Return type:bool
name

The name of the predictor

parse_external_result(output)

Searches within the defined dir _file for the newest dir and reads the prediction file from there

Parameters:output (str) – The path to the output dir
Returns:The predicted HLA genotype
Return type:list(Allele)
predict(ngsFile, output, command=None, options=None, delete=True, **kwargs)

Implementation of prediction

Parameters:
  • ngsFile (str) – The path to the NGS file of interest
  • output (str) – The path to the output file or directory
  • command (str) – The path to a alternative binary (if binary is not globally executable)
  • options (str) – A string with additional options that is directly past to the tool
  • delete (bool) – Boolean indicator whether generated files should be deleted afterwards
Returns:

A list of Allele objects representing the most likely HLA genotype

Return type:

list(Allele)

version

The version of the predictor

class Fred2.HLAtyping.External.Polysolver

Bases: Fred2.HLAtyping.External.AExternalHLATyping

Wrapper for Polysolver.

Note

Shukla, Sachet A., Rooney, Michael S., Rajasagi, Mohini, Tiao, Grace, et al. (2015). Comprehensive analysis of cancer-associated somatic mutations in class I HLA genes. Nat Biotech, advance online publication. doi: 10.1038/nbt.3344

clean_up(output)

Deletes files created by Polysolver within output

Parameters:output (str) – The path to the output file or directory of the programme
command

Defines the commandline call for external tool

get_external_version(path=None)

Returns the external version of the tool by executing >{command} –version

might be dependent on the method and has to be overwritten therefore it is declared abstract to enforce the user to overwrite the method. The function in the base class can be called with super()

Parameters:path (str) – Optional specification of executable path if deviant from self.__command
Returns:The external version of the tool or None if tool does not support versioning
Return type:str
is_in_path()

Checks whether the specified execution command can be found in PATH

Returns:Whether or not command could be found in PATH
Return type:bool
name

The name of the predictor

parse_external_result(output)

Searches within the defined dir _file for the newest dir and reads the prediction file from there

Parameters:output (str) – The path to the output dir
Returns:The predicted HLA genotype
Return type:list(Allele)
predict(ngsFile, output, command=None, options=None, delete=True, **kwargs)

Implementation of prediction

Parameters:
  • ngsFile (str) – The path to the NGS file of interest
  • output (str) – The path to the output file or directory
  • command (str) – The path to a alternative binary (if binary is not globally executable)
  • options (str) – A string with additional options that is directly past to the tool
  • delete (bool) – Boolean indicator whether generated files should be deleted afterwards
Returns:

A list of Allele objects representing the most likely HLA genotype

Return type:

list(Allele)

version

The version of the predictor

class Fred2.HLAtyping.External.Seq2HLA_2_2

Bases: Fred2.HLAtyping.External.AExternalHLATyping

Wrapper of seq2HLA v2.2.

Note

Boegel, S., Scholtalbers, J., Loewer, M., Sahin, U., & Castle, J. C. (2015). In Silico HLA Typing Using Standard RNA-Seq Sequence Reads. Molecular Typing of Blood Cell Antigens, 247.

clean_up(output)

Deletes all created files.

Parameters:output (str) – The path to the output file or directory of the programme
command

Defines the commandline call for external tool

get_external_version(path=None)

Returns the external version of the tool by executing >{command} –version

might be dependent on the method and has to be overwritten therefore it is declared abstract to enforce the user to overwrite the method. The function in the base class can be called with super()

Parameters:path (str) – Optional specification of executable path if deviant from self.__command
Returns:The external version of the tool or None if tool does not support versioning
Return type:str
is_in_path()

Checks whether the specified execution command can be found in PATH

Returns:Whether or not command could be found in PATH
Return type:bool
name

The name of the predictor

parse_external_result(output)

Searches within the defined dir _file for the newest dir and reads the prediction file from there

Parameters:output (str) – The path to the output dir
Returns:The predicted HLA genotype
Return type:list(Allele)
predict(ngsFile, output, command=None, options=None, delete=True, **kwargs)

Implementation of prediction

Parameters:
  • ngsFile (str) – The path to the NGS file of interest
  • output (str) – The path to the output file or directory
  • command (str) – The path to a alternative binary (if binary is not globally executable)
  • options (str) – A string with additional options that is directly past to the tool
  • delete (bool) – Boolean indicator whether generated files should be deleted afterwards
Returns:

A list of Allele objects representing the most likely HLA genotype

Return type:

list(Allele)

version

The version of the predictor