bamrefine(1)

NAME
bamrefine - Mask SNPs from a BAM file

SYNOPSIS
bamrefine [OPTIONS][-vtkh] <in.bam> <out.bam>

DESCRIPTION
bamrefine processes a BAM file to mask the positions from an alignment if that read carries a variant position that could be affected by post-mortem damage (PMD). e.g. If a read carries a C/* position at its 5' end or it carries a G/* position at its 3' end. The regions treated as 5' or 3' "end" is not pre-defined and should be provided to the program with its argument (see -l)

  OPTIONS

-s, --snps
    Path to BED or SNP formatted file for SNP positions and minor and major alleles. This can be either 4/5 column BED (genomic position [with or without the `start` position column] + Minor and Major allele) or SNP (that is used by EIGENSTRAT) formatted files. Format distinction is done by checking the file extension so it is important that the input file follows the format of the extension it has. See the sample_data data directory in the installation path for examples of each of the three supported file types. You can find the installation directory by running: pip3 show bamrefine or pip show bamrefine

-p, --threads
    Number of threads to run the program in parallel.

-l, --pmd-length-threshold
    PMD length threshold. Either a single integer (e.g -l 10) or two integers separated by a comma (e.g -l 2,0) representing different length values corresponding 5' and 3' ends, respectively. Positions that are up to and including this far in any read will be evaluated and masked. There is no one-for-all default value that can be set, so it is highly recommended that you have a prior information about the PMD profiles of your libraries before you run bamrefine

  FLAGS

-v, --verbose
    Verbose output of progress

-t, --add-tags
    Add tags to output BAM file related to masking statistics using optional fields in alignment records. e.g. ZC:Z:2,1 ZP:Z:0,5;-3 would mean that the program masked n=2 5' and n=1 3' positions and they were at index 0,5 and -3 in the sequence. 3' masking positions are represented with negative indices that start counting from the 3' end of the read and is compatible with python list indices.

-k, --keep-tmp
    Don't remove the temporary run directory. It will include intermediate BAM files, cached SNPs, etc. This directory is under the same directory with specified output BAM, named as .YYYY-MM-DD_HH-MM-SS_<out.bam>_tmp_bamrefine

-h, --help
    display a short help message inplace

AUTHOR
Etka Yapar <etka.yapar@gmail.com>