This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Running a script for each of the Reference .fa files along with their respective .abi files

I have a bash script to process ".abi" files with its reference ".fasta" file.

When I have a multiple header single FASTA file (each containing different genes), it would be split into multiple fasta files with each file containing one FASTA header and sequence.

What I need to know is how can I iterate through each of the ".fasta" gene reference files along with their respective ".abi" files through the script so that I get one result at a time for each of the ".abi" file (which is done by the script)..

fasta bash-scripting abi

1 answer

Your question is not totally clear, but I think what you are asking is: How do I loop over pairs of .fasta and .abi files as input for single script? If so you can probably do:

$ for fasta in *fasta; do sh script.sh $fasta ${fasta%.fasta}.abi; done

which will run "script.sh" supplying the fasta and abi file names (assuming the prefixes are the same) as arg1 and arg2, for all fasta files in a directory.

Thats exactly what I want to do but the problem is that the names of each of the .abi files will be different from the .fasta file and the .fasta files header contain something like this:

>chr1:12345

Why this is needed is that 12345, for example, is the start position of the respective genes in the .fasta files and this would be necessary for the script.

Log in to answer this question.