Skip to main content
2 of 5
added 217 characters in body

Run kallisto iteratively across many samples

I am on a Mac using UNIX. I am trying to use the kallisto quant command on all files in a directory (instead of manually entering them). Because I'm running the analysis against the same index file, I first enter the following:

./kallisto index -i --index --make-unique index.fa 

This successfully creates an index file. Then, I tried this:

for file in *.fasta; do kallisto quant --single -l 200 -s 0.1 -o $file-aligned 
"$file"; done

While the $file-aligned folders are created, they're empty. I get an error that states that the index file is missing. So I assumed I would need to specify the index file in the command line. I then tried this:

for file in *.fasta; do kallisto quant -i index.fa --single -l 200 -s 0.1 -o
$file-aligned  "$file"; done

I get an error that says "Error: incompatible indices. Found version 0, expected version 10.

I have now also tried the following:

for file in *.fasta; do ./kallisto quant -i index --single - 200 -s 0.01 -o 
"${file}-aligned" "${file}"; 

but I get an error saying the index file is not found.

I searched around for solutions to that error message, and only found that rebuilding the index file should resolve the error. I don't really care if I have to build an index for each file uniquely (I have 40 samples and it only takes 2 minutes to build an index) so I can run it over night on a local machine. However, I'm not entirely sure how to include that in what I've gotten so far.