MetaPhlAn 4.1.0: SAM not generated when using --samout with --input_type bowtie2out

Issue

I’m trying to regenerate a SAM file from a previously generated --bowtie2out file in MetaPhlAn.

Command

```
metaphlan A4.bowtie2.bz2
–input_type bowtie2out
–index mpa_vJun23_CHOCOPhlAnSGB_202307
–bowtie2db /metaphlan_analysis/bt2db/
–nproc 8
–samout A4_metaphlan.sam
-o A4_profile_abs.txt
```

Observation

No SAM file is created when I run this command.

Question

Is this expected behaviour when --input_type bowtie2out is used?
Does MetaPhlAn need raw reads as input in order to generate a SAM file with --samout?

Any clarification on whether this is possible without re‑running MetaPhlAn on the raw reads would be appreciated.

Hi @jihen

Yes, this is expected. The bowtie2out file is a summary of the sam file and contains a subset of the mapping information, it is a simple tab separated file with reads and markers that mapped against it. For this reason if you require the full sam file you should rerun the mapping from the raw reads.