Answers.Body: <p>No, there is no way to decompress .bwt or .sa files, because they are not compressed. After indexing you'll get these files, which some programs (bwa) use. They should be in the same folder as your reference fasta file. What are you trying to do with these files? To get proper help here, please explain why you need these files, and show how you made the files.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-10T07:45:18.760Z
Answers.Text: thanks for your reply. I need to use BWT and SA in my algorithm that why I need to decompress them because in the first step to produce BWT and SA: we have to form all rotations. All these rotations took too much memory that why I prefer to produce BWT and SA by using BWA. Do you a way to use BWT and SA while they are compressed ?
Answers.UserDisplayName: Mariam
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-10T08:10:29.990Z
Answers.Text: Or what is the best way to produce BWT ? better than the naive version of the BWT that forms all rotations.
Answers.UserDisplayName: Mariam
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-10T10:08:48.903Z
Answers.Text: I still do not fully understand the problem or what you need. `.bwt` and `.sa` are needed for bwa alignment and can be generated by your `bwa index` command. If you run out of memory, I think the solution is to buy more RAM. Or are you talking about the size of your HD? Please ask a new question, where you exactly explain your limitations and more about your algorithm and why (and how) it needs to `.bwt` and `.sa` files.
Answers.UserDisplayName: benn
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-10T10:33:52.113Z
Answers.Text: ok here is my question in another way: how BWA generate .bwt file and .sa file in with less memory usage ? Do they save all rotations temporary ?
Answers.UserDisplayName: Mariam
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-10T10:40:52.147Z
Answers.Text: This is indeed a whole other question.
Answers.UserDisplayName: benn
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-10T10:51:36.577Z
Answers.Text: This is my actual question I miswrote it. Ok I will open a new question.
Answers.UserDisplayName: Mariam
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-09T19:53:46.443Z
Answers.LastActivityDate: 2018-02-09T20:05:30.587Z
Answers.LastEditDate: 2018-02-09T20:05:30.587Z
Answers.UserDisplayName: benn
Body: <p>Also posted <a href="https://www.biostars.org/p/298033/" rel="nofollow noreferrer">on biostars</a></p>
  
  <p>After indexing</p>
  
  <pre><code>bwa index -a bwtsw reference.fa 
  </code></pre>
  
  <p>I got files. like .bwt file and .sa file. The naive way of generating these file is:
    </p>
  
  <ol>
  <li>Create all rotations of T</li>
  <li>Sort the rotations lexicographically  </li>
  <li>Concatenate the last character of each rotation to form 
   BWT(T)</li>
  </ol>
  
  <p>I used this naive way in my algorithm. The problem is it took too much memory.</p>
  
  <p>My question is: is there an effective memory way to generate .bwt file and .sa file ?</p>
  
  <p>Any help will be appreciated.</p>
  
Tags: <phylogenetics><bwa>
Title: Generating burrows-wheeler-transform and a suffix array of a DNA sequence with less memory
ThreadText: # Generating burrows-wheeler-transform and a suffix array of a DNA sequence with less memory
  
  (Asked by: username_0 on 2018-02-09)
  
  Also posted [on biostars](https://www.biostars.org/p/298033/)
  
  After indexing
  
  ```
  bwa index -a bwtsw reference.fa 
  
  ```
  
  I got files. like .bwt file and .sa file. The naive way of generating these file is:
  
  1. Create all rotations of T
  2. Sort the rotations lexicographically
  3. Concatenate the last character of each rotation to form
      BWT(T)
  
  I used this naive way in my algorithm. The problem is it took too much memory.
  
  My question is: is there an effective memory way to generate .bwt file and .sa file ?
  
  Any help will be appreciated.
  
  **Tags:** phylogenetics, bwa
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-02-09. Score: 4 | Accepted answer
  
  No, there is no way to decompress .bwt or .sa files, because they are not compressed. After indexing you'll get these files, which some programs (bwa) use. They should be in the same folder as your reference fasta file. What are you trying to do with these files? To get proper help here, please explain why you need these files, and show how you made the files.
  
  > **Comments:**
  > **username_0**: thanks for your reply. I need to use BWT and SA in my algorithm that why I need to decompress them because in the first step to produce BWT and SA: we have to form all rotations. All these rotations took too much memory that why I prefer to produce BWT and SA by using BWA. Do you a way to use BWT and SA while they are compressed ?  
  > **username_0**: Or what is the best way to produce BWT ? better than the naive version of the BWT that forms all rotations.  
  > **username_1**: I still do not fully understand the problem or what you need. `.bwt` and `.sa` are needed for bwa alignment and can be generated by your `bwa index` command. If you run out of memory, I think the solution is to buy more RAM. Or are you talking about the size of your HD? Please ask a new question, where you exactly explain your limitations and more about your algorithm and why (and how) it needs to `.bwt` and `.sa` files.  
  > **username_0**: ok here is my question in another way: how BWA generate .bwt file and .sa file in with less memory usage ? Do they save all rotations temporary ?  
  > **username_1**: This is indeed a whole other question.  
  > **username_0**: This is my actual question I miswrote it. Ok I will open a new question.  
  
  ---
  
  