STAR aligner problem on local laptop
1
0
Entering edit mode
4 weeks ago
Morris_Chair ▴ 370

Hello everyone,

I'm facing an issue with the STAR aligner on my personal computer.

I have a MacBook Pro with an M3 chip and 40GB of RAM, which I believe should be more than sufficient to run this tool. I don't encounter any errors during genome indexing or mapping. However, the BAM or SAM file I get at the end is empty.

I've tried changing many settings, but I'm starting to suspect that there may be some compatibility issues between STAR and my MacBook.

Has anyone successfully run STAR locally on a similar setup? Do you have any idea why the output BAM files might be empty?

Thank you!

RNA-sequencing • 1.5k views
ADD COMMENT
1
Entering edit mode

Please show a command line and log output. 40GB is ok probably, depending on settings.

ADD REPLY
1
Entering edit mode

The STAR command line you are running is needed to help you here. Please add it to your post.

ADD REPLY
1
Entering edit mode

I don't encounter any errors during genome indexing or mapping

Can you show us a listing of the index files (along with their sizes) that are produced. Is this human genome? If not what size is the genome?

40G of RAM is likely sufficient for one thread with human genome (or similar size). You are trying to use 10 and 5.

https://pastebin.com is a good location to upload logs for future reference.

ADD REPLY
0
Entering edit mode

enter image description here

Here it is, and yes it's a human genome. I have also tried to reduce the number of Threads up to 1 for the mapping but nothing changes :/

thanks

ADD REPLY
0
Entering edit mode

Here is the code that I have used to generate the indexed genome

STAR --runThreadN 10 --runMode genomeGenerate --genomeDir ./ --genomeFastaFiles GRCh38.primary_assembly.genome.fa --sjdbGTFfile gencode.v48.annotation.gtf  --sjdbOverhang 74

Here is the code that I run for the mapping

STAR --runMode alignReads --runThreadN 5 --genomeDir /star_indexed_genome/index/ --sjdbGTFfile GTF/gencode.v48.annotation.gtf --sjdbOverhang 74 --readFilesIn SRR21639803.fastq --outFileNamePrefix SRR21639803

thanks for the support

I'm trying to attach the log file

wetransfer should be good

https://we.tl/t-vCKiJoMcye

ADD REPLY
1
Entering edit mode

In the log I only see logs of the genome indexing process, not of the actual alignment. You also seem to do GTF-guided alignment, but this is ChIP-seq where this does not apply.

ADD REPLY
0
Entering edit mode

I don't know, this is what I get from the mapping... I don't think it's aligning. I have removed the GTF command from the mapping but nothing changes..

ADD REPLY
0
Entering edit mode
4 weeks ago
dsull ★ 7.6k

However, the BAM or SAM file I get at the end is empty

If you get a SAM file in the end but it's empty, that could mean that there aren't any reads in your FASTQ file. Trying displaying the first few lines of your FASTQ file (using the unix less or cat command) to ensure that your FASTQ file actually contains read sequences.

ADD COMMENT
0
Entering edit mode

Hello dsull and thank you for your answer.

The fastq file comes from SRA repository and it was used for previous studies. It is ok because using the cluster of the faculty I can map with STAR and get everything ok, the problem is with my laptop which I believe there is an incompatibility with the M3 chip

here is the fastq header

enter image description here

ADD REPLY
1
Entering edit mode

Ah ok! Yeah, sounds like STAR is incompatible with your M3 chip. How are you installing STAR? Maybe try compiling it from source.

ADD REPLY
1
Entering edit mode

Since it created the indexes STAR does seem to work on this machine. conda contains STAR binary for osx-arm64 so that would be the way to go.

Morris_Chair : Do you end up with an empty BAM file (zero bytes) or does the file have a header, just no alignments? Just tried aligning 100 reads from this SRR accession with STAR and was able to do so without any issues (Note: not on a M* mac but the data should align to human genome with STAR).

ADD REPLY
1
Entering edit mode

STAR's index generation step might work but the code for the alignment part of STAR might be buggy on M3. There are certain optimizations that STAR uses to process FASTQ reads super fast that could break down on newer architectures, even though the main binary itself seems compatible. Not saying that's the case here but it's a possibility.

ADD REPLY
0
Entering edit mode

Thanks for advice

here is the bam that I get

https://we.tl/t-nTZhKXezQ1

ADD REPLY
0
Entering edit mode

With conda there is no problem but if I compile it from source it shows errors like this:

g++-14: error: unrecognized command-line option '-mavx2'

from chatgpt

means that your g++-14 compiler (installed via Homebrew on an Apple Silicon Mac, likely an M1 or M2 chip) does not support the -mavx2 flag — this flag is for enabling AVX2 instructions, which are Intel x86_64-specific SIMD instructions. However, Apple Silicon (ARM64 architecture) does not support AVX2.
ADD REPLY
1
Entering edit mode

Hmm, one more suggestion: Add --readFilesCommand cat to your STAR command.

Also, show us how you're compiling from source (what commands are you using).

ADD REPLY
0
Entering edit mode

No alignment if I add --readFilesCommand cat in STAR. The coding source comes from GitHUB

# 1. Install brew (http://brew.sh/)
# 2. Install gcc with brew:
$ brew install gcc
# 3. Build STAR:
# run 'make' in the source directory
# note that the path to c++ executable has to be adjusted to its current version
$cd source
$make STARforMacStatic CXX=/usr/local/Cellar/gcc/8.2.0/bin/g++-8
# 4. Make it availible through the terminal
$cp STAR /usr/local/bin

I think I will give up and use the cluster from the faculty, it seems it goes way beyond my knowledge :/

I will wait till STAR compiler will adapt it to new machines

ADD REPLY
0
Entering edit mode

OK, you need to compile add CXXFLAGS_SIMD="-march=native" at the end of your make command.

ADD REPLY
1
Entering edit mode

In case this suggestion does not work try the solution posted here: https://github.com/alexdobin/STAR/issues/1265#issuecomment-1595135934

ADD REPLY
0
Entering edit mode

With conda there is no problem

Then why are you trying to compile locally. Are you expecting to get more (performance) out of a locally compiled binary?

ADD REPLY
0
Entering edit mode

With conda I have no problem installing STAR but I have the problem of the empty BAM files.

Then I have decided to compile it from sources with the idea that this could help to pass the empty file problem, but I've had problem during the compiling

ADD REPLY
1
Entering edit mode

Confirmed that the STAR executable provided by conda (as of today) is not able to align the data on a M3 Mac though it seems to produce indexes without any issue. SAM file produced has SAM header but no alignments. No other error message produced. Will report this to one of the conda maintainers.

ADD REPLY
0
Entering edit mode

Thanks to everyone, I appreciate the support :)

ADD REPLY

Login before adding your answer.

Traffic: 2938 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6