linux 中shell脚本实现统计每一个read的长度

发布时间 2023-06-23 23:09:28作者: 小鲨鱼2018

 

001、

[root@PC1 test02]# ls
test.fastq
[root@PC1 test02]# cat test.fastq      ## 测试fastq数据
@SRR8442980.988/2
AAGG
+
:FFF
@SRR8442980.988/2
AAGGTC
+
:FFF:,
@SRR8442980.1134/1
AAAAAAAATATAATTCCA
+
FFFFFFFFFFFFFFFFFF
[root@PC1 test02]# awk '{if((NR % 4 - 2) == 0) print $0, length}' test.fastq  ## 统计每一个read的长度
AAGG 4
AAGGTC 6
AAAAAAAATATAATTCCA 18

。