Hello
I am using kallisto | bustools workflow for single-cell RNA-seq analysis. In their workflow (https://www.kallistobus.tools/multiple_files_tutorial.html), they executed the below code to run kallisto bus command for four pair of fastq files as below:
$ kallisto bus -i Mus_musculus.GRCm38.cdna.all.idx -o bus_output/ -x 10xv2 -t 4 \
bamtofastq_S1_L001_R1_001.fastq.gz \
bamtofastq_S1_L001_R2_001.fastq.gz \
bamtofastq_S1_L002_R1_001.fastq.gz \
bamtofastq_S1_L002_R2_001.fastq.gz \
bamtofastq_S1_L003_R1_001.fastq.gz \
bamtofastq_S1_L003_R2_001.fastq.gz \
bamtofastq_S1_L004_R1_001.fastq.gz \
bamtofastq_S1_L004_R2_001.fastq.gz
However, as I have many fastq.gz files (around 800), it is tough to give all 800 files to kallisto bus command like the above approach. I really need to run all of them at once using a loop. So, I used a kallisto quant loop from a RNA-seq course to adapt it for kallisto bus command (for the same abovementioned paired samples) as below. However, It did not produce any output.
## Run kallisto:
# for four paired samples (-n 8):
find /scratch/fs/kallisto_bustools_multiple_lanes/fastqs -name "*_[R1R2]_001.fastq.gz" | sort | head -n 8 | while read
FW_READ
do
read RV_READ
FILEBASE=$(basename "${FW_READ%_R1_001.fastq.gz}")
kallisto bus -i /scratch/fs/kallisto_bustools_multiple_lanes/Mus_musculus.GRCm38.cdna.all.idx -x 10xv2 \
-o . -t 16 "$FW_READ" "$RV_READ"
# Kallisto doesn't let us specify an output filename so we rename all output files
mv "matrix.ec" $FILEBASE-"matrix.ec"
mv "output.bus" $FILEBASE-"output.bus"
mv "run_info.json" $FILEBASE-"run_info.json"
mv "transcripts.txt" $FILEBASE-"transcripts.txt"
done
#
May I kindly ask you to help me how to fix this chunk of code to run a loop for kallisto bus command for all of samples at once?
Thank you so much.
bash
kallisto
bustools