Answers.Body: <p>A block compression usually refers to compressing your file into a series of small blocks (with a tool like bgzip). This allows indexing in that the index can record which record lives in which block so that the whole file does not need to be decompressed and therefore can be accessed randomly. This isn't true of files compressed as a single block using gzip. </p>
  
  <p>As far as I was aware samtools only works with uncompressed FASTA files. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-13T10:48:02.000Z
Answers.LastActivityDate: 2018-11-13T10:48:02.000Z
Answers.UserDisplayName: Ian Sudbery
Body: <p>SAMtools returned an error message for my gzipped genome FASTA:</p>
  
  <blockquote>
    <p>Indexed block-compressed FASTA file cannot be handled</p>
  </blockquote>
  
  <p>The source code for the message is <a href="https://github.com/samtools/htsjdk/blob/master/src/main/java/htsjdk/samtools/reference/IndexedFastaSequenceFile.java" rel="nofollow noreferrer">here</a>. </p>
  
  <pre><code>// check if the it is a valid block-compressed file
  if (IOUtil.isBlockCompressed(path, true)) {
      throw new SAMException("Indexed block-compressed FASTA file cannot be handled: " + path);
  }
  </code></pre>
  
  <p>What's a "block-compressed" file?</p>
  
Tags: <sam><samtools>
Title: What is "block-compressed" file in samtools?
ThreadText: # What is "block-compressed" file in samtools?
  
  (Asked by: username_0 on 2018-11-13)
  
  SAMtools returned an error message for my gzipped genome FASTA:
  
  > Indexed block-compressed FASTA file cannot be handled
  
  The source code for the message is [here](https://github.com/samtools/htsjdk/blob/master/src/main/java/htsjdk/samtools/reference/IndexedFastaSequenceFile.java).
  
  ```
  // check if the it is a valid block-compressed file
  if (IOUtil.isBlockCompressed(path, true)) {
      throw new SAMException("Indexed block-compressed FASTA file cannot be handled: " + path);
  }
  
  ```
  
  What's a "block-compressed" file?
  
  **Tags:** sam, samtools
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-11-13. Score: 7 | Accepted answer
  
  A block compression usually refers to compressing your file into a series of small blocks (with a tool like bgzip). This allows indexing in that the index can record which record lives in which block so that the whole file does not need to be decompressed and therefore can be accessed randomly. This isn't true of files compressed as a single block using gzip.
  
  As far as I was aware samtools only works with uncompressed FASTA files.
  
  
  ---
  
  