# Biobambam：将BAM转成FASQ

## 来源

https://docs.gdc.cancer.gov/Data/Bioinformatics_Pipelines/DNA_Seq_Variant_Calling_Pipeline/#step-1-converting-bams-to-fastqs-with-biobambam-biobambam2-2054

https://j11.fun/biobambam2

## 步骤

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31

    for _ in `ls ~/STAR/liver/input.XL{1,2,3,7,8,9}.bam.gz`;do mv $_ ${_##*input.} ;done
    conda create -n biobambam -c bioconda biobambam=2.0.87 -y
    conda activate biobambam
    gunzip *.gz
    for _ in *.bam; do echo ${_%.bam} ; done
    nano 1.sh
    chmod +x 1.sh

    #!/bin/sh
    for _ in *.bam
    do

    mkdir ${_%.bam}

    bamtofastq \
    collate=1 \
    exclude=QCFAIL,SECONDARY,SUPPLEMENTARY \
    filename=$_ \
    gz=1 \
    inputformat=bam \
    level=5 \
    outputdir=${_%.bam} \
    outputperreadgroup=1 \
    outputperreadgroupsuffixF=_1.fq.gz \
    outputperreadgroupsuffixF2=_2.fq.gz \
    outputperreadgroupsuffixO=_o1.fq.gz \
    outputperreadgroupsuffixO2=_o2.fq.gz \
    outputperreadgroupsuffixS=_s.fq.gz \
    tryoq=1 \

    done

- biobambam高版本可能有 libmaus2相关错误尚未修复
- filename、outputdir等参数等于号后不能有空格
- 单端测序，outputdir里只有 default_s.fq.gz 的输出

组织测序
Biobambam：将BAM转成FASQ
https://occdn.limour.top/1929.html
Author
Limour
Posted on
July 2, 2022
Licensed under
STAR：构建小鼠的基因组索引 Previous
树莓派：Docker安装dokuwiki Next

#### Search

Keyword