Permission denied (running a script)

The file is not marked executable, or you are writing where you may not

why

A downloaded or freshly written script has no execute bit, so running it directly fails even though the contents are fine. The same message also appears when a tool tries to write into a directory you do not own — read-only reference directories are the classic case.

what to do

For a script: chmod +x script.sh, or run it as bash script.sh. If it is a write failure, point the tool's output somewhere you own — many tools default to writing next to their input, which fails on shared reference data.

POSIX permissions
This is one entry from BioErrors, a catalogue of bioinformatics error messages that point at the wrong thing. Every entry was traced to its real cause before it was written down.
If your error is not in it, paste it there and it gets traced and added.