tho4
February 9th, 2015, 12:27 PM
Hi Ubuntu users,
I struggle to define a loop taking name in a first file (Bureau/taxa, each line of the file is a species name) and retrieving the line with the corresponding name and the DNA sequence associated in a second file (Bureau/conc_5genes.fas). The file Bureau/conc_5genes.fas is as follows:
>species1 ATTGTCTAT
>species2 TTGCATATC
...
Here is the loop:
for line in Bureau/taxa ;
do
grep '$line' Bureau/conc_5genes.fas >> Bureau/moldata_hostrecords;
done
Thank you for your help!
I struggle to define a loop taking name in a first file (Bureau/taxa, each line of the file is a species name) and retrieving the line with the corresponding name and the DNA sequence associated in a second file (Bureau/conc_5genes.fas). The file Bureau/conc_5genes.fas is as follows:
>species1 ATTGTCTAT
>species2 TTGCATATC
...
Here is the loop:
for line in Bureau/taxa ;
do
grep '$line' Bureau/conc_5genes.fas >> Bureau/moldata_hostrecords;
done
Thank you for your help!