Hi all,
I performed the mapping back of reads to a assembled transcriptome using bowtie2 with the default settings. I'm trying to get the average insert size using the command of "head -10000 mappings.sam | awk '{if ($9 > 0) {S+=$9; T+=1}}END{print "Mean: " S/T}' ". But, it says that : awk: cmd. line:1: (FILENAME=- FNR=10000) fatal: division by zero attempted. Also, the head of sam output is like below:
@HD VN:1.0 SO:unsorted
@SQ SN:seq1 LN:797
@SQ SN:seq2 LN:1925
@SQ SN:seq3 LN:493
@SQ SN:seq4 LN:1240
@SQ SN:seq5 LN:2098
@SQ SN:seq6 LN:2722
@SQ SN:seq7 LN:1772
@SQ SN:seq8 LN:2028
@SQ SN:seq9 LN:2337
As far as I read I should look for the average insert size on the TLEN (9th) column, where is these columns?
Could you please let me know if this output is normal and how I can calculate the average insert size using them?
Thanks so much,