Skip to content

KINC 3D viewer attempts to read in p_value as character string #183

@JohnHadish

Description

@JohnHadish

If the first row of p_value use exponential format (X.XXXe-XX) rather than long form (X.XXXXX), python will attempt to read that column as a string. This will cause python to fail with this error:

Traceback (most recent call last):
  File "/usr/local/bin/kinc-3d-viewer.py", line 1764, in <module>
    main()
  File "/usr/local/bin/kinc-3d-viewer.py", line 1738, in main
    bin_edges(net)
  File "/usr/local/bin/kinc-3d-viewer.py", line 225, in bin_edges
    net['Pval_Bin'] = np.round(-np.log10(net['p_value']))
  File "/home/jah/.local/lib/python3.8/site-packages/pandas/core/series.py", line 679, in __array_ufunc__
    result = getattr(ufunc, method)(*inputs, **kwargs)
TypeError: loop of ufunc does not support argument 0 of type str which has no callable log10 method

This can be partially fixed by addressing issue #182, but KINC extract will sometimes still use the exponential format when it is extracting a network, which will also cause failure:

image

Suggested Fix:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions