Filter SAM or BAM, output SAM or BAM files

I aligned my files fastq files with bowtie2 in galaxy (for CHIP-seq experiments) and then Im filtering with Filter SAM or BAM, output SAM or BAM files.

For some reason when I ran the Filter SAM or BAM tools, Im getting this error:

Fatal error: Exit code 127 ()
Could not display BAM file, error was:
file has no sequences defined (mode=‘rb’) - is it SAM/BAM format? Consider opening with check_sq=False

I hope someone can help me.

Thanks
Carlos

1 Like

Hi @CARLOS_LIZAMA

Check your input bam – are the results nearly empty (very small size)?

My guess is that the bam dataset contains only headers and no actual sequence alignments. Bowtie2 reports alignment statistics or you can generate these after (Samtools, etc). Or, you can click on the “eye” icon for the dataset and just scroll down past the header to see if any alignments are present.

Perhaps the wrong genome was mapped against? Or the alignment parameters were too strict, resulting in no hits retained?

If the bam dataset is intact, are you really using a local Galaxy server (your own)?

  • Are you using the most current version of Galaxy and the most current version of this tool? Did you install it from the Main ToolShed (https://usegalaxy.org/toolshed) using default conda dependency resolution? Or is there something else special about your configuration/dependency resolution choices? If this was the first time executing the tool, there could be a server or tool installation problem (or cluster, …).

  • Did you create the genome indexes for the tool and map against those? Were they created using a Data Manager (also sourced from the ToolShed)? Or did you create/install these using a different method? Is this your first time mapping data against those indexes? It is important to install and index a genome with a set of minimum indexes. This prior Q&A explains, plus has links to related resources: Indexing reference genomes with Data Managers: Resources, tutorials, troubleshooting

  • Or, are you using a Custom genome (fasta file from the history)? If so, and the genome is larger, the job may be too large to execute at your server. That would normally result in a bam result in an error state (and unavailable to downstream tools as an input). But many odd situations can come up due to server configuration/resource issues.

  • To troubleshoot any, you could try replicating the mapping job at a public Galaxy server and compare the results.

Please review and we can troubleshoot more from there. To allow that, please share more details about your server and other above topics.

Thanks!