insert size、fragment、 inner 的解释,Filter BAM/SAM files by insert size

insert size、fragment、 inner 的解释

  • 1: list insert sizes, one line per read
    • 为什么 insert sizes有负值
  • 2: filter by insert sizes
  • Limitation
  • 采样

insert size、fragment、 inner 的解释,Filter BAM/SAM files by insert size_第1张图片

SAM 文件的第九列,即观察到的模板 LENgth (TLEN),可用作fragment 长度的近似值。这是近似值.

1: list insert sizes, one line per read

insert size、fragment、 inner 的解释,Filter BAM/SAM files by insert size_第2张图片

samtools view -f66 file.bam | cut -f 9 > insert-sizes.txt

为什么 insert sizes有负值

The reason is that the first read is mapped to the reverse strand. In this case, the insert size of the second read is positive

# To report the absolute values,
samtools view -f66 file.bam  | cut -f9 | awk '{print sqrt($0^2)}' > insert-sizes.txt

2: filter by insert sizes

insert size、fragment、 inner 的解释,Filter BAM/SAM files by insert size_第3张图片

samtools view -h file.bam | \
  awk 'substr($0,1,1)=="@" || ($9>= 200 && $9<=500) || ($9<=-200 && $9>=-500)' | \
  samtools view -b > is-200-500.bam

Limitation

insert size、fragment、 inner 的解释,Filter BAM/SAM files by insert size_第4张图片

采样

insert size、fragment、 inner 的解释,Filter BAM/SAM files by insert size_第5张图片

Filter BAM/SAM files by insert size

你可能感兴趣的:(生信,NGS,NGS)