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.
interproscan.sh runs cd "$(dirname "$INSTALL_DIR")", which moves into /usr/local/share/InterProScan, before it checks INTERPROSCAN_CONF.
- 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.
- 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.
- 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
Description of the bug
interproscanignores the database passed asinterproscan_databaseand always uses the small sample database built into the container. With a real database, the run fails:Cause
This is checked against
quay.io/biocontainers/interproscan:5.59_91.0--hec16e2b_1.interproscan.shrunscd "$(dirname "$INSTALL_DIR")", which moves into/usr/local/share/InterProScan, before it checksINTERPROSCAN_CONF.export INTERPROSCAN_CONF=interproscan.propertiesas a relative path. After thecd, that resolves to the container's own/usr/local/share/InterProScan/interproscan.properties, not the edited copy in the task work dir.data.directory=dataandbin.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, sohmmpressfails. The stageddata/folder is never used.sedsetsbin.directory=$INTERPROSCAN_DIR/bin, which is/usr/local/bin. The member-database binaries live in/usr/local/share/InterProScan/bin, for examplebin/pirsf/3.10/pirsf.pl.data.directoryis never rewritten either.The tests pass because the test profile only runs applications that work with the bundled sample data.
Suggested fix
Also worth documenting:
interproscan_databasemust be thedata/folder of a matching InterProScan release, meaning 5.59-91.0 for the current container, and its HMMs must already be pressed withpython3 setup.py -f interproscan.properties. Otherwisehmmpressruns 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
modules/nf-core/interproscan(current master)interproscan:5.59_91.0--hec16e2b_1