jade.nnk package

Submodules

jade.nnk.NNKAbMaturation module

class jade.nnk.NNKAbMaturation.GetNNKData(data_dir, ab_group='glCHA31')[source]

Bases: object

Get NNK Data as a formatted tupple of 1d data (Or raw Pandas DF)

get_1d_data_tuple_freq_nnk_data(antigen='C5-SOSIP', sort='S1')[source]
get_2D_data_freq_nnk_data(antigen='C5-SOSIP', sort='S1')[source]

Return a dataframe with ResType as index and resnum as columns. :param antigen: :param sort: :rtype: pandas.DataFrame

get_nnk_data(dt='freqTopPerPosition', antigen='C5-SOSIP', sort='S1')[source]

Get pandas dataframe of NNK data.

reinit(ab_class)[source]
jade.nnk.NNKAbMaturation.load_1d_data(data_dir, data_type)[source]

Here, this is a test bed for SVM and simple neural networks No recurrent Neural nets or anything fancy. Will have to try that next.

The 1D data is so that the residuetypes all line up in the SVM. :param data_dir: :return:

jade.nnk.NNKAbMaturation.load_2d_data(data_dir, data_type)[source]

Load a representation of the 2D data with res and position.

Parameters:data_dir
Returns:
jade.nnk.NNKAbMaturation.write_raw_sorts(data, outdir, outname='raw_enrichments.csv', antigen='GT81')[source]

Write the data as columns, S1, S2, S3 for easy import into matlab.

Parameters:
  • data
  • outdir
  • outname
  • antigen
Returns:

jade.nnk.NNKEnrichments module

class jade.nnk.NNKEnrichments.NNKEnrichments(data_dir, zeros=-2.0, class_type='VRC01', antibody='glCHA31', antigen='GT81', sort='S1')[source]

Bases: object

Simple class that holds all the enrichment data for a particular class, antibody, and antigen.

calculate_factors()[source]

Return a dataframe of calculated factors

Factor is Sergeys definition:

(P-M)/MAD = scaling factor; where
P - total propensity for amino acid at this position, M - mean total propensity for all amino acids at this position MAD - mean average deviation for propensities at this position.
Return type:pandas.DataFrame
max(position)[source]

Get the maximum enrichment at a particular position, and the amino acid

Parameters:position
Returns:
mean(position)[source]
min(position)[source]

Get the minimum enrichment at a particular position, and the amino acid

Note: There may be multiple minumum amino acids - this is not yet accounted for!

Parameters:position
Returns:
value(position, three_letter_code)[source]

Get the enrichment value of a particular position and code.

Parameters:
  • position
  • three_letter_code
Returns:

jade.nnk.NNKEnrichments.combine_enrichments(list_of_nnk_enrichments, additive_combine=False)[source]

Combine a list of nnk_enrichments to populate this one. @type list_of_nnk_enrichments: [NNKEnrichments] :rtype: NNKEnrichments