<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>

CC BY-SA 3.0
2018-02-10T07:45:18.760Z
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 ?
Mariam
CC BY-SA 3.0
2018-02-10T08:10:29.990Z
Or what is the best way to produce BWT ? better than the naive version of the BWT that forms all rotations.
Mariam
CC BY-SA 3.0
2018-02-10T10:08:48.903Z
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.
benn
CC BY-SA 3.0
2018-02-10T10:33:52.113Z
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 ?
Mariam
CC BY-SA 3.0
2018-02-10T10:40:52.147Z
This is indeed a whole other question.
benn
CC BY-SA 3.0
2018-02-10T10:51:36.577Z
This is my actual question I miswrote it. Ok I will open a new question.
Mariam
CC BY-SA 3.0
2018-02-09T19:53:46.443Z
2018-02-09T20:05:30.587Z
2018-02-09T20:05:30.587Z
benn
<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>

<phylogenetics><bwa>
Generating burrows-wheeler-transform and a suffix array of a DNA sequence with less memory
# 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
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:
  

Create all rotations of T
Sort the rotations lexicographically  
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.  

---

