Is there a way to edit all headers in a BAM file?

Welcome, @elpren

While yes, you could edit a BAM file directly with text manipulation tools if you convert it to plain text first (SAM format), that is usually a really bad idea!

Those lines in your BAM file are the sequence identifiers from the reference genome you mapped against. Those map to the fasta sequences in your reference genome – and those labels for specific nucleotide strings matter!

Then the GTF reference annotation is where other features have been placed along those same nucleotide strings: genes, transcripts, other features.

Featurecounts is counting up hits against coordinates on those sequences where the features in the annotation are. Mixing this up means that all your counts will be wrong (if they even process, this tends to fail!).

In short, you have a Reference data mismatch problem. You may have mapped against the wrong genome for a few runs. You can double check what you used for parameters per job on the Job Details view (using the i-icon) and make changes when you run the job again (using the rerun-icon).

This FAQ has more details but I’m guessing a rerun with a different target database choice for your case is enough. Use the genome that is a match with the GTF for all steps.

If you need more help with confirming the problem, you are welcome to share back your history for more exact feedback. If you are working through a tutorial, please link that back too for context. See → How to get faster help with your question

Let’s start there, and let us know if you solve this! :slight_smile: