anvi-script-reformat-bam

Reformat a BAM file to match the updated sequence names after running anvi-script-reformat-fasta. You will need this script to fix your BAM file if you run anvi-script-reformat-fasta on a FASTA file of sequences after you already used the previous version of the FASTA file for read recruitment..

🔙 To the main page of anvi’o programs and artifacts.

Authors

Can consume

bam-file contig-rename-report-txt

Can provide

bam-file

Usage

This program reformats a bam-file file using a contig-rename-report-txt to a bam-file compatible with a re-formatted contigs-fasta. If you had to run anvi-script-reformat-fasta to convert the contigs name of your FASTA file to make it compatible with anvi’o, and you already had some BAM files mapped to the original FASTA file, you will need to reformat those BAM files to make them compatible with the new FASTA file. This program will use the report file from anvi-script-reformat-fasta to do that for you.

anvi-script-reformat-bam bam-file \ -l contig-rename-report-txt \ -o bam-file

This program is required only if you ran anvi-script-reformat-fasta with the --simplify-names flag, and will require the output file generated with the flag --report-file.

Example output

anvi-script-reformat-bam SAMPLE.bam \
                         --list REPORT.txt \
                         --output SAMPLE-REFORMATTED.bam
Input BAM file ...............................: SAMPLE.bam
Rename list ..................................: REPORT.txt
Overwrite output? ............................: True

WHAT WAS THERE
===============================================
Loaded REPORT.txt ............................: 3

WHAT WAS DONE
===============================================
Sequences in BAM file ........................: 3
Output BAM file created ......................: SAMPLE-REFORMATTED.bam

Edit this file to update this information.

Additional Resources

Are you aware of resources that may help users better understand the utility of this program? Please feel free to edit this file on GitHub. If you are not sure how to do that, find the __resources__ tag in this file to see an example.