prediction
pypythia.prediction.predict_difficulty(msa_file, model_file=DEFAULT_MODEL_FILE, raxmlng=DEFAULT_RAXMLNG_EXE, threads=None, seed=0, file_format=None, data_type=None, deduplicate=True, remove_full_gaps=True, reduced_msa_file=None)
Predict the difficulty of an MSA using the PyPythia difficulty predictor.
Per default, the MSA is deduplicated and full gap sequences are removed before the difficulty is predicted.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
msa_file
|
Path
|
Path to the MSA file. Note that the MSA file must be in either FASTA or PHYLIP format. |
required |
model_file
|
Path
|
Path to the trained difficulty predictor model. Defaults to the latest model shipped with PyPythia. |
DEFAULT_MODEL_FILE
|
raxmlng
|
Path
|
Path to the RAxML-NG executable. If not set, uses the RAxML-NG binary found in the PATH environment variable. |
DEFAULT_RAXMLNG_EXE
|
threads
|
int
|
Number of threads to use for parallel parsimony tree inference. If not set, uses the RAxML-NG auto parallelization scheme. |
None
|
seed
|
int
|
Random seed to use for the parsimony tree inference. Defaults to 0. |
0
|
file_format
|
FileFormat
|
File format of the MSA file. Defaults to None. In this case, the file format
is inferred based on the file content. See |
None
|
data_type
|
DataType
|
Data type of the MSA sequences. Defaults to None. In this case, the data type
is inferred based on the file content. See |
None
|
deduplicate
|
bool
|
If True, remove duplicate sequences from the MSA. Defaults to True. |
True
|
remove_full_gaps
|
bool
|
If True, remove full gap sequences from the MSA. Defaults to True. |
True
|
reduced_msa_file
|
Path
|
Path to store the reduced MSA after deduplication and removal of full gap sequences. |
None
|
Returns:
Type | Description |
---|---|
float64
|
np.float64: Predicted difficulty of the MSA. |
Source code in pypythia/prediction.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
|
pypythia.prediction.collect_features(msa, msa_file, raxmlng, pars_trees_file=None, log_info=True, threads=None, seed=0)
Helper function to collect all features required for predicting the difficulty of the MSA.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
msa
|
MSA
|
MSA object corresponding to the MSA file to compute the features for. |
required |
raxmlng
|
RAxMLNG
|
Initialized RAxMLNG object. |
required |
pars_trees_file
|
Path
|
Path to store the inferred parsimony trees. Defaults to None. In this case, the trees are not stored. |
None
|
log_info
|
bool
|
If True, log intermediate progress information using the default logger. |
True
|
threads
|
int
|
The number of threads to use for parallel parsimony tree inference. Defaults to None. Uses the RAxML-NG auto parallelization scheme if none is set. |
None
|
seed
|
int
|
Random seed to use for the parsimony tree inference. Defaults to 0. |
0
|
Returns: Dataframe containing a single row with all features required for predicting the difficulty of the MSA. The columns correspond to the feature names the predictor was trained with.
Source code in pypythia/prediction.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
|