I have been trying to get the depth of several fastq files using for in loop approach: I have used this code to print out name of each fastq then the depth of that file: what I used was:
Sample=(*.fastq)
for f in *.fastq
do
Depth=$(grep -c @ $f)
echo "$Sample:$Depth" >> Depth_before_trimm
done
but what it produces is the file name of the first fastq and keep repeating it again instead of the names of other files.
Could you tell what might be causing this ?
you cannot get a "DEPTH" from a fastq file. the depth is associated to BAM/SAM/CRAM/VCF files.