Skip to content

interproscan: staged database is ignored (relative INTERPROSCAN_CONF, wrong bin/data directories) #13009

Description

@vagkaratzas

Description of the bug

interproscan ignores the database passed as interproscan_database and always uses the small sample database built into the container. With a real database, the run fails:

Running hmmpress (/usr/local/bin//hmmpress) on data/pirsf/3.10/sf_hmm_all
failed to open SSI index data/pirsf/3.10/sf_hmm_all.h3i
Could not run hmmpress!

Cause

This is checked against quay.io/biocontainers/interproscan:5.59_91.0--hec16e2b_1.

  1. interproscan.sh runs cd "$(dirname "$INSTALL_DIR")", which moves into /usr/local/share/InterProScan, before it checks INTERPROSCAN_CONF.
  2. The module sets export INTERPROSCAN_CONF=interproscan.properties as a relative path. After the cd, that resolves to the container's own /usr/local/share/InterProScan/interproscan.properties, not the edited copy in the task work dir.
  3. The container's properties file has data.directory=data and bin.directory=bin, both relative to the install dir. InterProScan therefore reads the bundled sample data. That data is not pressed and sits on a read-only image, so hmmpress fails. The staged data/ folder is never used.
  4. Separately, the sed sets bin.directory=$INTERPROSCAN_DIR/bin, which is /usr/local/bin. The member-database binaries live in /usr/local/share/InterProScan/bin, for example bin/pirsf/3.10/pirsf.pl. data.directory is never rewritten either.

The tests pass because the test profile only runs applications that work with the bundled sample data.

Suggested fix

if [ -d 'data' ]; then
    INTERPROSCAN_DIR="$( dirname "$( dirname "$( which interproscan.sh )" )" )"
    INTERPROSCAN_PROPERTIES="$( find "$INTERPROSCAN_DIR/share" -name "interproscan.properties" )"
    cp "$INTERPROSCAN_PROPERTIES" .
    sed -i \
        -e "s|^bin\\.directory=.*|bin.directory=$( dirname "$INTERPROSCAN_PROPERTIES" )/bin|" \
        -e "s|^data\\.directory=.*|data.directory=$PWD/data|" \
        interproscan.properties
    export INTERPROSCAN_CONF=$PWD/interproscan.properties
fi

Also worth documenting: interproscan_database must be the data/ folder of a matching InterProScan release, meaning 5.59-91.0 for the current container, and its HMMs must already be pressed with python3 setup.py -f interproscan.properties. Otherwise hmmpress runs inside every task and parallel tasks race.

Workaround

Bind the database over the container's data folder:

process {
    withName: '.*:INTERPROSCAN' {
        containerOptions = '-B /abs/path/interproscan-5.59-91.0/data:/usr/local/share/InterProScan/data'
    }
}

System information

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions