I am trying to write a for loop where I conditionally parse specific values from a csv file into the do command.
My situation is as follows: I have several directories containing genome sequences. The samples are numbered and the directories are named accordingly.
Dir 1 contains sample1_genome.fasta
Dir 2 contains sample2_genome.fasta
Dir 3 contains sample3_genome.fasta
The genome sequences have differing average read lengths. It is important to adress this. Therefore, I created a csv file containing the sample number and the according average read length of the genome sequence. csv file example (first column = sample_no, 2nd column = avg_read_length):
1,130
2,134
3,129
Now, I want to loop through the directories, take the genome sequences as input and parse the respective average read length to the process.
my code is as follows:
for f in *
do
shortbred_quantify.py --genome $f/sample${f%}.fasta --aerage_read_length *THE SAMPLE MATCHING VALUE FROM 2nd COLUMN* --results results/quantify_results_sample${f%}
done
Can you help me out with this?