---
name: "bamgroupreads.py"
section: "1"
platform: "linux"
package: "bamkit"
version: "0.0.1+git20170413.ccd079d-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/bamgroupreads.py"
---

# bamgroupreads.py(1)

Group BAM file by read IDs without sorting

## NAME

bamgroupreads.py - Group BAM file by read IDs without sorting

## SYNOPSIS

**bamgroupreads.py** \[-h\] \[-i BAM\] \[-r STR\] \[-d\] \[-f\] \[-S\] \[-b\] \[-u\] \[-M\]

## DESCRIPTION

Group BAM file by read IDs without sorting

## OPTIONS

### optional arguments:

- **-h**, **--help**

  show this help message and exit

- **-i** BAM, **--input** BAM

  Input BAM file

- **-r** STR, **--readgroup** STR

  Read group(s) to extract (comma separated)

- **-d**, **--reset\_dups**

  Reset duplicate flags

- **-f**, **--fix\_flags**

  Fix mate flags for secondary reads

- **-S**

  Input is SAM format

- **-b**

  Output BAM format

- **-u**

  Output uncompressed BAM format (implies **-b**)

- **-M**

  split reads are flagged as secondary, not supplementary. For compatibility with legacy BWA-MEM "-M" flag

## AUTHOR

 This manpage was written by Andreas Tille for the Debian distribution and\
  can be used for any other usage of the program.
