Skip to content

Incompatibility between modisco with ISM and Specificify transform with subtract function #80

@dagarfield

Description

@dagarfield

The function run_modisco currently calculates that attributions that are fed to modisco with:

attrs = -np.log2(np.divide(ism_preds, ref_preds))

This runs into issues, however, if there are negative values involved. A fix could be:

ref_preds_safe = np.where(ref_preds == 0, np.finfo(float).eps, ref_preds)
division_result = np.divide(ism_preds, ref_preds_safe)
division_result_safe = np.where(division_result <= 0, np.finfo(float).eps, division_result)
attrs = -np.log2(division_result_safe)

More intelligently, however, for someone better with numpy arrays would be to take the absolute values for ism_preds and then re-assign negative values after the fact (or some how otherwise scaling)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingv1.1

    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