---
name: "bamtofastq.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/bamtofastq.py"
---

# bamtofastq.py(1)

Convert a coordinate sorted BAM file to FASTQ

## NAME

bamtofastq.py - Convert a coordinate sorted BAM file to FASTQ

## SYNOPSIS

**bamtofastq.py** \[-h\] \[-r STR\] \[-n\] \[-S\] \[-H FILE\] \[BAM \[BAM ...\]\]

## DESCRIPTION

Convert a coordinate sorted BAM file to FASTQ (ignores unpaired reads)

## OPTIONS

### positional arguments:

- BAM

  Input BAM file(s). If absent then defaults to stdin.

### optional arguments:

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

  show this help message and exit

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

  Read group(s) to extract (comma separated)

- **-n**, **--rename**

  Rename reads

- **-S**, **--is\_sam**

  Input is SAM format

- **-H** FILE, **--header** FILE

  Write BAM header to file

## AUTHOR

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