title: Biobambam:将BAM转成FASQ tags: [] id: '1929' categories:
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