Question: Running a script for each of the Reference .fa files along with their respective .abi files
0
gravatar for anilkanthi
4.2 years ago by
anilkanthi0
India
anilkanthi0 wrote:

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)..

ADD COMMENTlink modified 4.2 years ago by Matt Shirley9.0k • written 4.2 years ago by anilkanthi0
0
gravatar for Matt Shirley
4.2 years ago by
Matt Shirley9.0k
Cambridge, MA
Matt Shirley9.0k wrote:

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.

ADD COMMENTlink written 4.2 years ago by Matt Shirley9.0k

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.

ADD REPLYlink modified 4.2 years ago • written 4.2 years ago by anilkanthi0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1104 users visited in the last hour