I'm using RepeatMasker on human sequences. When running RepeatMasker this way:

RepeatMasker -e rmblast -species human -dir . myFile.fa

RepeatMasker builds some libraries:

Building general libraries in: /path/to/share/RepeatMasker/Libraries/CONS-Dfam_3.3/general
Building species libraries in: /path/to/share/RepeatMasker/Libraries/CONS-Dfam_3.3/human

(Paths edited) On subsequent runs, this does not happen. I want to check if these libraries exist beforehand (which I can easily do with ls /path/to/share/RepeatMasker/Libraries/CONS-Dfam_3.3/), and if they don't, build them.

I could do a run with a decoy fasta to trigger that step, but it's a bit hacky. Is there a better way to force Repeat Masker to build those libraries?

(I mention that I'm using bioconda in the title because I'm working on a remote server with restrictions, so that should be taken into account, no because there is already a solution for other installation methods).


1 Answer 1


Something like this:


if [ -d "${db_dir}" ] && [ -n "$(ls -A ${db_dir})" ]; then
    echo "CONS-Dfam folder is not empty"
    # ... do something
    echo > sequence.fasta
    RepeatMasker -e rmblast -species human -dir . sequence.fasta

If the folder exists and is not empty, otherwise build it using an empty file.

  • $\begingroup$ That's what I mentioned in my question, using a decoy FASTA. It seems there are not alternatives $\endgroup$ Oct 26, 2021 at 11:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.