在运行bwa+samtools时报错,
cmd:bwa mem -t 50 -k 32 -M -R '@RG\tID:1\tSM:1' ~/reference/bwa_index 1_1.clean.fastq.gz 1_2.clean.fastq.gz | samtools sort -@ 20 -O BAM -o 1.sort.bam
查看samtools中sort命令的帮助信息:
Usage: samtools sort [options...] [in.bam]
Options:
-l INT Set compression level, from 0 (uncompressed) to 9 (best)
-m INT Set maximum memory per thread; suffix K/M/G recognized [768M]
-n Sort by read name
-t TAG Sort by value of TAG. Uses position as secondary index (or read name if -n is set)
-o FILE Write final output to FILE rather than standard output
-T PREFIX Write temporary files to PREFIX.nnnn.bam
--input-fmt-option OPT[=VAL]
Specify a single input file format option in the form
of OPTION or OPTION=VALUE
-O, --output-fmt FORMAT[,OPT[=VAL]]...
Specify output format (SAM, BAM, CRAM)
--output-fmt-option OPT[=VAL]
Specify a single output file format option in the form
of OPTION or OPTION=VALUE
--reference FILE
Reference sequence FASTA FILE [null]
-@, --threads INT
Number of additional threads to use [0]
单个线程需要768M内存,需要设置合适的-m参数或-@参数。同时,bwa的线程数也要合理设置。