5 Comments
Jan 11Liked by Evan Peikon

nice! "-uf" throws error though?

Expand full comment
author

Thank you Ani!

The -uf flag shouldn't cause an error. The -u flag is to specific the output type (uncompressed BAM) and the -f flag specifies that the reference sequence is in the FASTA format. If this flag is throwing an error it could often be due to the input and output files names being flip-flopped. It's also possible that the version of samtools you're using is not compatible w/ these flags.

Expand full comment

thx Evan for re-comment, i should've share the error with samtools 1.17:

mpileup: invalid option -- 'u'

Usage: samtools mpileup [options] in1.bam [in2.bam [...]]

Input options:

-6, --illumina1.3+ quality is in the Illumina-1.3+ encoding

-A, --count-orphans do not discard anomalous read pairs

-b, --bam-list FILE list of input BAM filenames, one per line

-B, --no-BAQ disable BAQ (per-Base Alignment Quality)

-C, --adjust-MQ INT adjust mapping quality; recommended:50, disable:0 [0]

-d, --max-depth INT max per-file depth; avoids excessive memory usage [8000]

-E, --redo-BAQ recalculate BAQ on the fly, ignore existing BQs

-f, --fasta-ref FILE faidx indexed reference sequence file

-G, --exclude-RG FILE exclude read groups listed in FILE

-l, --positions FILE skip unlisted positions (chr pos) or regions (BED)

-q, --min-MQ INT skip alignments with mapQ smaller than INT [0]

-Q, --min-BQ INT skip bases with baseQ/BAQ smaller than INT [13]

-r, --region REG region in which pileup is generated

-R, --ignore-RG ignore RG tags (one BAM = one sample)

--rf, --incl-flags STR|INT

required flags: only include reads with any of

the mask bits set []

--ff, --excl-flags STR|INT

filter flags: skip reads with any of the mask bits set

[UNMAP,SECONDARY,QCFAIL,DUP]

-x, --ignore-overlaps-removal, --disable-overlap-removal

disable read-pair overlap detection and removal

-X, --customized-index use customized index files

Output options:

-o, --output FILE write output to FILE [standard output]

-O, --output-BP output base positions on reads, current orientation

--output-BP-5 output base positions on reads, 5' to 3' orientation

-M, --output-mods output base modifications

-s, --output-MQ output mapping quality

--output-QNAME output read names

--output-extra STR output extra read fields and read tag values

--output-sep CHAR set the separator character for tag lists [,]

--output-empty CHAR set the no value character for tag lists [*]

--no-output-ins skip insertion sequence after +NUM

Use twice for complete insertion removal

--no-output-ins-mods don't display base modifications within insertions

--no-output-del skip deletion sequence after -NUM

Use twice for complete deletion removal

--no-output-ends remove ^MQUAL and $ markup in sequence column

--reverse-del use '#' character for deletions on the reverse strand

-a output all positions (including zero depth)

-a -a (or -aa) output absolutely all positions, including unused ref. sequences

Generic options:

--input-fmt-option OPT[=VAL]

Specify a single input file format option in the form

of OPTION or OPTION=VALUE

--reference FILE

Reference sequence FASTA FILE [null]

--verbosity INT

Set level of verbosity

Note that using "samtools mpileup" to generate BCF or VCF files has been

removed. To output these formats, please use "bcftools mpileup" instead.

Expand full comment
author

Hi Ani, if you're receiving the above error after typing the following command "samtools mpileup -uf reference_genome.fa sorted_reads.bam > output.pileup" it's likely due to the -u option being incompatible with the version of samtools you're using (assuming you've saved a property formed reference genome as a FASTA file titled reference_genome.fa and have a sorted_reads.bam file already). You can also try using bcftools mpileup as an alternative.

Expand full comment

following command also failed for me but it looks like one can pipe the commands and bypass the pileup file creation?

bcftools mpileup -f genome.fa sort.bam | bcftools call -mv -Ov -o TK16_R1_.sort.bam.vcf

Expand full comment