This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to create out dir's using shell scripting to run FIMO on multiple files?

Hello everyone,

I am trying to run FIMO on my server for multiple motif files. But it cannot create output directories instead overwrites the output directory with motif outputs. So, i am trying to do the following command but it doesn't seem to work. Can you please tell me how can i create multiple out directories, so that i can direct each motif output to its respective directory?

for f in /home/arunbodd/Fimo/Encode__CLIP_HepG2_2016/*.motif; do mkdir -p "$(dirname "/home/arunbodd/Fimo/$f_out")" &&  fimo --o /home/arunbodd/Fimo/{$f}_out --max-seq-length 2.5e8 --thresh 0.05  $f  /home/arunbodd/Fimo/mart_export.txt; done

Thank You

shell script fimo command line

1 answer

Just as a good practice, always enclose bash variables in {} - in your $f_out for example - how does bash know if you're looking for $f_out or $f_out? Use ${f}_out.

hey ram

thank you, It was working.

Glad to know it worked - please accept my answer if it was helpful.

Log in to answer this question.