FRED-2 / OptiType

Precision HLA typing from next-generation sequencing data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OptiType returns ValueError with some samples while running just fine with others

isinaltinkaya opened this issue · comments

Hi,

I get the following error with some of our samples. The program works just fine with the same conda environment, same commands on the same machine with other samples, and this error is only occuring with a few samples. Does this mean we cannot obtain any results thus all inferences are NA?

$  python /maps/projects/racimolab/data/MHC/tools/OptiType/OptiType/OptiTypePipeline.py                       -i hla_typing/OptiType/bwa-aln/simulations/xMHC_f4_relALT/HG01978/HG01978_0.1c_120bp_0.2d_rep1-GRCh38_p13_alt-n0.04_o1-xMHC_f4_relALT.fq                               --dna                 -v                               --outdir hla_typing/OptiType/bwa-aln/simulations/xMHC_f4_relALT/HG01978/OptiType_results/HG01978_0.1c_120bp_0.2d_rep1-GRCh38_p13_alt-n0.04_o1               --prefix HG01978_0.1c_120bp_0.2d_rep1-GRCh38_p13_alt-n0.04_o1-xMHC_f4_relALT                            -c /maps/projects/racimolab/data/MHC/tools/OptiType/OptiType/config.ini              --enumerate 5

mapping with 1 threads...

 0:00:00.49 Mapping HG01978_0.1c_120bp_0.2d_rep1-GRCh38_p13_alt-n0.04_o1-xMHC_f4_relALT.fq to GEN reference...

 0:00:04.19 Generating binary hit matrix.
[E::idx_find_and_load] Could not retrieve index file for 'hla_typing/OptiType/bwa-aln/simulations/xMHC_f4_relALT/HG01978/OptiType_results/HG01978_0.1c_120bp_0.2d_rep1-GRCh38_p13_alt-n0.04_o1/HG01978_0.1c_120bp_0.2d_rep1-GRCh38_p13_alt-n0.04_o1-xMHC_f4_relALT_1.bam'
0:00:04.22 Loading hla_typing/OptiType/bwa-aln/simulations/xMHC_f4_relALT/HG01978/OptiType_results/HG01978_0.1c_120bp_0.2d_rep1-GRCh38_p13_alt-n0.04_o1/HG01978_0.1c_120bp_0.2d_rep1-GRCh38_p13_alt-n0.04_o1-xMHC_f4_relALT_1.bam started. Number of HLA reads loaded (updated every thousand):                               

 0:00:04.22 15 reads loaded. Creating dataframe...
0:00:04.99 Dataframes created. Shape: 15 x 11179, hits: 70 (70), sparsity: 1 in 2395.50

 0:00:07.32 temporary pruning of identical rows and columns

 0:00:07.33 Size of mtx with unique rows and columns: (2, 2)
0:00:07.33 determining minimal set of non-overshadowed alleles

 0:00:07.33 Keeping only the minimal number of required alleles (1,)

 0:00:07.33 Creating compact model...

starting ilp solver with 1 threads...

 0:00:07.34 Initializing OptiType model...
WARNING: Initializing ordered Set R with a fundamentally unordered data source
    (type: set).  This WILL potentially lead to nondeterministic behavior in
    Pyomo
GLPSOL: GLPK LP/MIP Solver, v4.56
Parameter(s) specified in the command line:
 --write /tmp/tmpkRGX0a.glpk.raw --wglp /tmp/tmpXBqz4w.glpk.glp --cpxlp /tmp/tmpiCTgCN.pyomo.lp
Reading problem data from '/tmp/tmpiCTgCN.pyomo.lp'...
/tmp/tmpiCTgCN.pyomo.lp:53: warning: lower bound of variable 'x1' redefined
/tmp/tmpiCTgCN.pyomo.lp:53: warning: upper bound of variable 'x1' redefined
8 rows, 5 columns, 14 non-zeros
2 integer variables, all of which are binary
55 lines were read
Writing problem data to '/tmp/tmpXBqz4w.glpk.glp'...
43 lines were written
GLPK Integer Optimizer, v4.56
8 rows, 5 columns, 14 non-zeros
2 integer variables, all of which are binary
Preprocessing...
3 rows, 3 columns, 7 non-zeros
1 integer variable,  which is binary
Scaling...
 A: min|aij| =  1.000e+00  max|aij| =  1.000e+00  ratio =  1.000e+00
Problem data seem to be well scaled
Constructing initial basis...
Size of triangular part is 3
Solving LP relaxation...
GLPK Simplex Optimizer, v4.56
3 rows, 3 columns, 7 non-zeros
*     0: obj =  -0.000000000e+00 inf =   0.000e+00 (1)
*     1: obj =   2.000000000e+00 inf =   0.000e+00 (0)
OPTIMAL LP SOLUTION FOUND
Integer optimization begins...
+     1: mip =     not found yet <=              +inf        (1; 0)
+     1: >>>>>   2.000000000e+00 <=   2.000000000e+00   0.0% (1; 0)
+     1: mip =   2.000000000e+00 <=     tree is empty   0.0% (0; 1)
INTEGER OPTIMAL SOLUTION FOUND
Time used:   0.0 secs
Memory used: 0.0 Mb (49251 bytes)
Writing MIP solution to '/tmp/tmpkRGX0a.glpk.raw'...
15 lines were written
Traceback (most recent call last):
  File "/maps/projects/racimolab/data/MHC/tools/OptiType/OptiType/OptiTypePipeline.py", line 419, in <module>
    result = op.solve(args.enumerate)
  File "/maps/projects/racimolab/data/MHC/tools/OptiType/OptiType/model.py", line 188, in solve
    self.__instance.c.add(expr >= 1)
  File "/maps/projects/racimolab/data/MHC/tools/OptiType/optitype_env/lib/python2.7/site-packages/pyomo/core/base/constraint.py", line 1100, in add
    return self.__setitem__(next_idx, expr)
  File "/maps/projects/racimolab/data/MHC/tools/OptiType/optitype_env/lib/python2.7/site-packages/pyomo/core/base/indexed_component.py", line 482, in __setitem__
    return self._setitem_when_not_present(index, val)
  File "/maps/projects/racimolab/data/MHC/tools/OptiType/optitype_env/lib/python2.7/site-packages/pyomo/core/base/indexed_component.py", line 779, in _setitem_when_not_present
    obj.set_value(value)
  File "/maps/projects/racimolab/data/MHC/tools/OptiType/optitype_env/lib/python2.7/site-packages/pyomo/core/base/constraint.py", line 557, in set_value
    expr, self.name ))
ValueError: Invalid constraint expression. The constraint expression resolved to a trivial Boolean (False) instead of a Pyomo object. Please modify your rule to return Constraint.Infeasible instead of False.

Error thrown for Constraint 'c[1]'

Thank you!