bam2fq 发表于 2017-04-06 | 分类于 Cheetsheets samtools bam2fq1samtools.1.3.1 bam2fq input.bam |gzip -c > output.fq.gz picard SamToFastq1java -jar picard-tools-2.5.0/picard.jar SamToFastq I=input.bam F=out.1.fq.gz F2=out.2.fq.gz 提取 unmapped reads12# 提取unmapped reads比对到另一个ref(比如线粒体)上samtools.1.3.1 bam2fq -f 4 input.bam | bwa mem -t 30 -M -R '@RG\tID:Sample01\tLB:Sample01\tSM:Sample01\tPL:Illumina\tPU:Illumina\tSM:Sample01\t' mt.fa - | samtools.1.3.1 sort -O bam -T /dir/tmp -o mapMt.sort.bam 提取 unique reads123# unique reads (a single read mapping at one best position)# -q INT Skip alignments with MAPQ smaller than INT [0]samtools view -bq 1 file.bam > unique.bam