Can I index a compressed FASTA file using STAR?
I can think of two possible workarounds. The simplest would be to try using zcat instead of gunzip -c, in case that works. Assuming it doesn't, you can use process substitution, if your shell supports it. Something like this:

STAR --runThreadN 8 --runMode genomeGenerate --genomeDir output/index/star \
    --genomeFastaFiles &lt;(zcat ref.fa.gz) --sjdbGTFfile ref.gtf --sjdbOverhang 100


The &lt;() creates a file descriptor and passes that to the command. It is very useful for passing streams to commands that expect files. 

If your shell doesn't support this construct, assuming you are on a system that supports named pipes (Linux does), you can do the same thing a bit more manually:


Create a named pipe (FIFO)

mkfifo foo

Set it to read the uncompressed genome

zcat ref.fa.gz &gt; foo &amp;


The &amp; is important since the command above will hang until something starts reading from foo. Alternatively, you can just run this in one terminal and the next command in another. 
Read the input from the pipe

STAR --runThreadN 8 --runMode genomeGenerate --genomeDir output/index/star \
    --genomeFastaFiles foo --sjdbGTFfile ref.gtf --sjdbOverhang 100