text: user1770: What is the standard way to measure contig sequence lengths in a BAM? 
  My understanding is that the community would use samtools idxstats to compute this information from the corresponding index file. 
  Are there more precise/standard approaches? 
  
  user77: Standard approaches would be either samtools idxstats or samtools view -H, both of which will produce the exact same results. In fact, all methods will produce the exact same result, since contig length is set by the reference you align against.
  
original_text: 1770: <p>What is the standard way to measure contig sequence lengths in a BAM? </p>
  
  <p>My understanding is that the community would use <code>samtools idxstats</code> to compute this information from the corresponding index file. </p>
  
  <p>Are there more precise/standard approaches? </p>
   77: <p>Standard approaches would be either <code>samtools idxstats</code> or <code>samtools view -H</code>, both of which will produce the exact same results. In fact, all methods will produce the exact same result, since contig length is set by the reference you align against.</p>
  