dcouvin / CRISPRCasFinder

A Perl script allowing to identify CRISPR arrays and associated Cas proteins from DNA sequences
https://crisprcas.i2bc.paris-saclay.fr
GNU General Public License v3.0
82 stars 29 forks source link

[FEATURE REQUEST] macsyfinder models custom dir #51

Open jowodo opened 1 year ago

jowodo commented 1 year ago

It would be nice to add a flag, where one specify the path to a custom macsyfinder models dir. This is my current installation solution as admin on Oracle Linux 8.8:

VERSION=4.3.2
URL=https://github.com/dcouvin/CRISPRCasFinder
conda env create --name crisprcasfinder-$VERSION --file https://raw.githubusercontent.com/dcouvin/CRISPRCasFinder/release-${VERSION}/ccf.environment.yml
conda activate crisprcasfinder-${VERSION}
conda install -c bioconda macsyfinder=2.0
macsydata install --models $CONDA_PREFIX/share/macsyfinder/models CASFinder==3.1.0
pushd $CONDA_PREFIX/share
git clone --quiet --depth 1 --branch release-$VERSION $URL crisprcasfinder
chmod +x crisprcasfinder/CRISPRCasFinder.pl
sed --in-place=.orig "s@macsyfinder -w@macsyfinder --models-dir ${CONDA_PREFIX}/share/macsyfinder/models/ -w@" ${CONDA_PREFIX}/share/crisprcasfinder/CRISPRCasFinder.pl
pushd ../bin
ln -s ../share/crisprcasfinder/CRISPRCasFinder.pl .
popd ; popd

And running with test user:

TEMPDIR=$(mktemp -d)
pushd $TEMPDIR
conda activate crisprcasfinder-4.3.2
git clone https://github.com/dcouvin/CRISPRCasFinder
cd CRISPRCasFinder
CRISPRCasFinder.pl -in install_test/sequence.fasta -cas -keep

It would be nice to omit the sed command and be able to do something like this:

TEMPDIR=$(mktemp -d)
pushd $TEMPDIR
conda activate crisprcasfinder-4.3.2
git clone https://github.com/dcouvin/CRISPRCasFinder
cd CRISPRCasFinder
CRISPRCasFinder.pl -in install_test/sequence.fasta -cas -keep -msfdir $CONDA_PREFIX/share/macsyfinder/models