How can I run the same command in mac terminal for multiple files in a folder? The files are named like 24538_7#1_paired1.fq
, 24538_7#1_paired2.fq
, 24538_7#2_paired1.fq
, 24538_7#2_paired2.fq
, 24538_7#3_paired1.fq
, 24538_7#3_paired2.fq
, and so on.
The command is:
STAR --runThreadN 12 --genomeDir indices/STAR --twopassMode Basic --readFilesIn data/24538_7#1_paired1.fq data/24538_7#1_paired2.fq --outFileNamePrefix results/STAR/
Since filename involves a counter, so, obviously the filenames need to be changed.
I was trying to write command, but it's giving segmentation fault. My effort for the command is below:
for file in 24538_7#*.fq; do STAR --runThreadN 12 --genomeDir indices/STAR --twopassMode Basic --readFilesIn data/"${file%.fq}_paired1.fq" data/"${file%.fq}_paired2.fq" --outFileNamePrefix results/STAR/ ; done
(PS- I use MacOS)
What genome are you aligning against? STAR requires at least 30+G of free RAM (for human sized genomes) so unless you have that available that may be your first problem.
Mouse genome. RAM isn't an issue for me. I've got a RAM 64 GB desktop(Mac- currently in use) and a 192 GB RAM Workstation Dell (in-store).