Body: <p>I am new to pacbio sequencing data. I just did some alignment of pacbio HiFI data using pbmm2. I have the bam now, I would like to collect some metrics on the alignment. I used to work on the illumina data, I used picard CollectAlignmentSummaryMetrics, CollectGcBiasMetrics, CollectInsertSizeMetrics to collect a series of alignment metrics.
  I was wondering if there is similar tools for pacbio data. I searched and did not find an answer.</p>
  <p>We are mainly interested in aligned rate, sequence length, coverage, accuracy, and GC content. So I write some scripts for it. These scripts are inside the nextflow, the input is the bam file</p>
  <pre><code>samtools flagstat <span class="math-container">$bam \
   | head -8 \
   | tr " " ","  \
   | tr "+" " " \
   | awk -F',' '{ print $1, $3}' \
   | paste - - - - - - - -  \
   | awk '{print $1, $3, $5, $7, $9, $11, $2, $4, $6, $8, $10, $</span>12 }' &gt;  align_prp
   
   samtools depth <span class="math-container">$bam \
   |  awk '{sum+=$3; sumsq+=$3*$</span>3} END { print sum/NR, sqrt(sumsq/NR - (sum/NR)**2)}' &gt; coverage
   
   samtools view <span class="math-container">$bam \
   | awk '{ $35=length($10); sum+=$35; sumsq+=$35*$</span>35} END { print sum/NR, sqrt(sumsq/NR - (sum/NR)**2)}' &gt; length
   
  
   
   samtools view  <span class="math-container">$bam \
   | cut -f 10 \
   | fold -w 1 \
   | awk '($</span>1==&quot;G&quot; || $1==&quot;C&quot;) {N++;} END {print (N/(1.0*NR)*100);}' &gt; GC_content
  </code></pre>
  <p>But I am still interested to know if there are some package available there.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-09T20:38:27.150Z
Comments.Text: Is this useful at all? https://www.biostars.org/p/9494195/
Comments.UserDisplayName: Ram RS
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-09T20:43:01.603Z
Comments.Text: No, I am not accessible to Revio, Sequel II and IIe systems.
Comments.UserDisplayName: cautree
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-06-12T20:40:42.210Z
Comments.Text: Have you tried --log-level INFO in pbmm2 align
Comments.UserDisplayName: María José
Tags: <phylogenetics><pacbio>
Title: Pacbio HIFI pbmm2 alignment metrics
ThreadText: # Pacbio HIFI pbmm2 alignment metrics
  
  (Asked by: username_0 on 2023-06-09)
  
  I am new to pacbio sequencing data. I just did some alignment of pacbio HiFI data using pbmm2. I have the bam now, I would like to collect some metrics on the alignment. I used to work on the illumina data, I used picard CollectAlignmentSummaryMetrics, CollectGcBiasMetrics, CollectInsertSizeMetrics to collect a series of alignment metrics.
  I was wondering if there is similar tools for pacbio data. I searched and did not find an answer.
  
  We are mainly interested in aligned rate, sequence length, coverage, accuracy, and GC content. So I write some scripts for it. These scripts are inside the nextflow, the input is the bam file
  
  ```
  samtools flagstat $bam \
   | head -8 \
   | tr " " ","  \
   | tr "+" " " \
   | awk -F',' '{ print $1, $3}' \
   | paste - - - - - - - -  \
   | awk '{print $1, $3, $5, $7, $9, $11, $2, $4, $6, $8, $10, $12 }' >  align_prp
   
   samtools depth $bam \
   |  awk '{sum+=$3; sumsq+=$3*$3} END { print sum/NR, sqrt(sumsq/NR - (sum/NR)**2)}' > coverage
   
   samtools view $bam \
   | awk '{ $35=length($10); sum+=$35; sumsq+=$35*$35} END { print sum/NR, sqrt(sumsq/NR - (sum/NR)**2)}' > length
   
  
   
   samtools view  $bam \
   | cut -f 10 \
   | fold -w 1 \
   | awk '($1=="G" || $1=="C") {N++;} END {print (N/(1.0*NR)*100);}' > GC_content
  
  ```
  
  But I am still interested to know if there are some package available there.
  
  **Tags:** phylogenetics, pacbio
  
  > **Comments:**
  > **username_1**: Is this useful at all? https://www.biostars.org/p/9494195/  
  > **username_0**: No, I am not accessible to Revio, Sequel II and IIe systems.  
  > **username_2**: Have you tried --log-level INFO in pbmm2 align  
  
  ---
  
  ## 0 answers
  
  