<p>STAR versions 2.6.0b and 2.6.0a are unstable,  as written <a href="https://bioinformatics.stackexchange.com/questions/4449/issues-performing-variant-calling-with-gatk">Issues performing variant calling with GATK</a> you are using version 2.6.0b. You should switch to version 2.6.0c which is stable.  Also avoid to perform multiple alignments in the same directory. </p>

CC BY-SA 4.0
2018-06-10T13:07:15.620Z
2018-06-10T13:07:15.620Z
bilal malik
<p>Hi am trying to align RNA-seq reads using STAR through following commands,</p>

<pre><code>STAR --runMode alignReads --runThreadN 26  --outSAMtype BAM  SortedByCoordinate Unsorted --sjdbOverhang 100  --genomeDir wheat --readFilesIn G3_cleaned_R1.fastq G3_cleaned_R2.fastq --sjdbGTFtagExonParentTranscript wheat.gff3 
Jun 05 13:53:59 ..... started STAR run
Jun 05 13:53:59 ..... loading genome
Jun 05 14:07:12 ..... started mapping
Jun 05 18:42:47 ..... started sorting BAM

EXITING because of FATAL ERROR: number of bytes expected from the BAM bin   does not agree with the actual size on disk: 509186583   0   45                                                                                        

EXITING because of FATAL ERROR: number of bytes expected from the BAM bin does not agree with the actual size on disk: 648593301   0   47                                                                                        

Jun 05 18:42:47 ...... FATAL ERROR, exiting                                                                                                                                                                                      
Jun 05 18:42:47 ...... FATAL ERROR, exiting                                                                                                                                                                                      
EXITING because of FATAL ERROR: number of bytes expected from the BAM bin does not agree with the actual size on disk: 660412146   0   46                                                                                        
Jun 05 18:42:47 ...... FATAL ERROR, exiting                                                                                                                                                                                      
EXITING because of FATAL ERROR: number of bytes expected from the BAM bin does not agree with the actual size on disk: 470931698   0   44                                                                                        

Jun 05 18:42:47 ...... FATAL ERROR, exiting                                                                                                                                                                                      
EXITING because of FATAL ERROR: number of bytes expected from the BAM bin does not agree with the actual size on disk: 653155717   0   43                                                                                        

Jun 05 18:42:47 ...... FATAL ERROR, exiting                                                                                                                                                                                      
Segmentation fault (core dumped)
</code></pre>

<p>Although there is much free space on my system as shown below:</p>

<pre><code>&gt; df -Th
  Filesystem     Type      Size  Used Avail Use% Mounted on
  devtmpfs       devtmpfs   63G     0   63G   0% /dev
  tmpfs          tmpfs      63G  136K   63G   1% /dev/shm
  tmpfs          tmpfs      63G  1.9M   63G   1% /run
  tmpfs          tmpfs      63G     0   63G   0% /sys/fs/cgroup
  /dev/sda3      ext4      3.6T  1.4T  2.2T  39% /
  /dev/sda2      ext4      9.8G   57M  9.2G   1% /boot
  tmpfs          tmpfs      13G     0   13G   0% /run/user/480
  tmpfs          tmpfs      13G   16K   13G   1% /run/user/1000
</code></pre>

<p>How this problem can be solved?</p>

CC BY-SA 4.0
2018-06-06T08:07:07.177Z
Are you an older version of the STAR aligner? A similar error has been discussed here: https://groups.google.com/forum/#!topic/rna-star/OTUG26gKKmo
Kasper Thystrup Karstensen
CC BY-SA 4.0
2018-06-06T08:15:29.050Z
You are using 26 threads, while you have 125GB of RAM, this means per thread you have 4.8 GB RAM. Your genome size is 13 GB (according to your previous [post](https://bioinformatics.stackexchange.com/questions/4340/error-creating-indices-using-star)). An answer to your previous post suggested to reduce the number of threads. Did you try to run with lower number of threads?
benn
CC BY-SA 4.0
2018-06-06T08:30:46.223Z
@b.nota I ran the job discussed in previous post with same number of threads.
Ammar Sabir Cheema
CC BY-SA 4.0
2018-06-06T08:33:01.977Z
@Kasper I am using latest version of STAR
Ammar Sabir Cheema
CC BY-SA 4.0
2018-06-06T09:04:33.213Z
Report the bug on github and sort with samtools.
Devon Ryan
CC BY-SA 4.0
2018-06-06T18:54:10.667Z
@DevonRyan ok I will post it there. Can I use --limitBAMsortRAM to solve this problem?
Ammar Sabir Cheema
CC BY-SA 4.0
2018-06-06T21:16:36.303Z
@AmmarSabirCheema I don't think so, since any time you need to increase that there's an error message saying so. I think this is just a bug somewhere. Just sort the unsorted output with samtools or sambamba.
Devon Ryan
<sam><rna-alignment><star>
Disk space error while aligning reads using STAR
# Disk space error while aligning reads using STAR

(Asked by: username_0 on 2018-06-06)

Hi am trying to align RNA-seq reads using STAR through following commands,
STAR --runMode alignReads --runThreadN 26  --outSAMtype BAM  SortedByCoordinate Unsorted --sjdbOverhang 100  --genomeDir wheat --readFilesIn G3_cleaned_R1.fastq G3_cleaned_R2.fastq --sjdbGTFtagExonParentTranscript wheat.gff3 
Jun 05 13:53:59 ..... started STAR run
Jun 05 13:53:59 ..... loading genome
Jun 05 14:07:12 ..... started mapping
Jun 05 18:42:47 ..... started sorting BAM

EXITING because of FATAL ERROR: number of bytes expected from the BAM bin   does not agree with the actual size on disk: 509186583   0   45                                                                                        

EXITING because of FATAL ERROR: number of bytes expected from the BAM bin does not agree with the actual size on disk: 648593301   0   47                                                                                        

Jun 05 18:42:47 ...... FATAL ERROR, exiting                                                                                                                                                                                      
Jun 05 18:42:47 ...... FATAL ERROR, exiting                                                                                                                                                                                      
EXITING because of FATAL ERROR: number of bytes expected from the BAM bin does not agree with the actual size on disk: 660412146   0   46                                                                                        
Jun 05 18:42:47 ...... FATAL ERROR, exiting                                                                                                                                                                                      
EXITING because of FATAL ERROR: number of bytes expected from the BAM bin does not agree with the actual size on disk: 470931698   0   44                                                                                        

Jun 05 18:42:47 ...... FATAL ERROR, exiting                                                                                                                                                                                      
EXITING because of FATAL ERROR: number of bytes expected from the BAM bin does not agree with the actual size on disk: 653155717   0   43                                                                                        

Jun 05 18:42:47 ...... FATAL ERROR, exiting                                                                                                                                                                                      
Segmentation fault (core dumped)

Although there is much free space on my system as shown below:
> df -Th
  Filesystem     Type      Size  Used Avail Use% Mounted on
  devtmpfs       devtmpfs   63G     0   63G   0% /dev
  tmpfs          tmpfs      63G  136K   63G   1% /dev/shm
  tmpfs          tmpfs      63G  1.9M   63G   1% /run
  tmpfs          tmpfs      63G     0   63G   0% /sys/fs/cgroup
  /dev/sda3      ext4      3.6T  1.4T  2.2T  39% /
  /dev/sda2      ext4      9.8G   57M  9.2G   1% /boot
  tmpfs          tmpfs      13G     0   13G   0% /run/user/480
  tmpfs          tmpfs      13G   16K   13G   1% /run/user/1000

How this problem can be solved?

**Tags:** sam, rna-alignment, star
> **Comments:**
> **username_1**: Are you an older version of the STAR aligner? A similar error has been discussed here: https://groups.google.com/forum/#!topic/rna-star/OTUG26gKKmo  
> **username_2**: You are using 26 threads, while you have 125GB of RAM, this means per thread you have 4.8 GB RAM. Your genome size is 13 GB (according to your previous [post](https://bioinformatics.stackexchange.com/questions/4340/error-creating-indices-using-star)). An answer to your previous post suggested to reduce the number of threads. Did you try to run with lower number of threads?  
> **username_0**: @b.nota I ran the job discussed in previous post with same number of threads.  
> **username_0**: @Kasper I am using latest version of STAR  
> **username_3**: Report the bug on github and sort with samtools.  
> **username_0**: @DevonRyan ok I will post it there. Can I use --limitBAMsortRAM to solve this problem?  
> **username_3**: @AmmarSabirCheema I don't think so, since any time you need to increase that there's an error message saying so. I think this is just a bug somewhere. Just sort the unsorted output with samtools or sambamba.  

---

## 1 answers

### Answer by username_4 on 2018-06-10. Score: 4 | Accepted answer

STAR versions 2.6.0b and 2.6.0a are unstable, as written [Issues performing variant calling with GATK](https://bioinformatics.stackexchange.com/questions/4449/issues-performing-variant-calling-with-gatk) you are using version 2.6.0b. You should switch to version 2.6.0c which is stable. Also avoid to perform multiple alignments in the same directory.


---

