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

Requires

bam-file contig-rename-report-txt

Provides

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.

Command line interface

The following is the list of parameters and their descriptions in the latest version of anvi-script-reformat-bam.

The code that generates this web page ensures that this information is the latest available in 9-dev (eunice). Which means, in some cases the information in this section (generated automatically) might be more comprehensive or up-to-date compared to the descriptions above (written by humans).


Command line usage

anvi-script-reformat-bam [-h] -r TXT FILE [-o FORMATTED BAM] BAM FILE

Parameters and their descriptions

INPUT The input file you wish to work with.
BAM FILE required
-r, --report-file TXT FILE required
A TAB-delimited file produced by `anvi-script-reformat-fasta` to report sequence name changes due to `--simplify-names` flag.
OUTPUT Dealing with the output.
-o, --output-bam FORMATTED BAM
The output BAM file name. If you don't specify an output file name, the new BAM file will be reported with the suffix `.reformatted.bam`.

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.