Hello,
I'm trying to write a bash script to use bioperl bash command bp_fetch and return a CDS list in fasta format.
I have installed bioperl and bp_fetch works as intended:
xxxx@xxxx:~/Documents$ bp_fetch net::embl:AAA24658.1
>AAA24658 Escherichia coli hypothetical protein
ATGGAACGTTGCGGCTGGGTGAGTCAGGACCCGCTTTATATTGCCTACCATGATAATGAG
TGGGGCGTGCCTGAAACTGACAGTAAAAAACTGTTCGAAATGATCTGCCTTGAAGGGCAG
CAGGCTGGATTATCGTGGATCACCGTCCTCAAAAAACGCGAAAACTATCGCGCCTGCTTT
CATCAGTTCGATCCGGTGAAGGTCGCAGCAATGCAGGAAGAGGATGTCGAAAGACTGGTA
CAGGACGCCGGGATTATCCGCCATCGAGGGAAAATTCAGGCAATTATTGGTAATGCGCGG
GCGTACCTGCAAATGGAACAGAACGGCGAACCGTTTGTCGACTTTGTCTGGTCGTTTGTA
AATCATCAGCCACAGGTGACACAAGCCACAACGTTGAGCGAAATTCCCACATCTACGTCC
GCCTCCGACGCCCTATCTAAGGCACTGAAAAAACGTGGTTTTAAGTTTGTCGGCACCACA
ATCTGTTACTCCTTTATGCAGGCATGTGGGCTGGTGAATGATCATGTGGTTGGCTGCTGT
TGCTATCCGGGAAATAAACCATGA
The problem is that i have a file with long list of acession numbers, and i'm trying to do a bash script to run "bp_fetch net::" with every line of the file (each line has an acession number) and output the list of FASTA CDS's in a txt file. I have tried something like:
for line in $file
do
bp_fetch net::$line
But I'm having no success. Can I get some help?
Thanks in advance.
Hey Frédéric, thanks a lot! Your script worked flawlessly! :)