MEGADEPTH(1)
π MEGADEPTH(1) π
okay so bestie, pull up a chair, because megadepth is one of those tools that looks scary and is actually just a very good friend. it lives in the User Commands part of the manual, and it's about to be your whole personality. no cap. π
πΈ NAME πΈ
megadepth β quantification of genome coverage by DNA/RNA seqencing π§¬β¨
π DESCRIPTION π
so this is megadepth 1.2.0, and it's a BAM and BigWig utility. that's the whole vibe. π¦
π Usage:
megadepth <bam|bw|-> [options]
like. that's it. you hand it a BAM or a BigWig (or a -), you add options, it does the thing. main character energy fr fr.
β¨ OPTIONS β¨
π the basics (everyone's faves)
-h --helpβ shows this screen. your emotional support flag. π«Ά--versionβ shows the version. that's it, that's the flag.--threadsβ the number of threads to do BAM decompression OR to compute sums over multiple BigWigs in parallel. if it's the second one you want, then a TXT file listing the paths to the BigWigs to process in parallel should be passed in as the main input file instead of a single BigWig file (EXPERIMENTAL). π--prefixβ the string used to prefix all your output files. yes bestie, name your babies. πΌ--no-auc-stdoutβ forces all AUC(s) to be written to<prefix>.auc.tsvinstead of STDOUT.--no-annotation-stdoutβ forces summarized annotation regions to be written to<prefix>.annotation.tsvinstead of STDOUT.--no-coverage-stdoutβ forces covered regions to be written to<prefix>.coverage.tsvinstead of STDOUT.--keep-orderβ outputs annotation coverage in the order chromosomes appear in the BAM/BigWig file. the default is to output annotation coverage in the order chromosomes appear in the annotation BED file. this only applies if--annotationis used for either BAM or BigWig input. π
π¦ BigWig Input π¦
extracts regions and their counts from a BigWig, outputting BED format, if a BigWig file is detected as input (this is exclusive of the other BAM modes, so no mixing, bestie):
extracts all reads from the passed-in BigWig and outputs as BED format. this will also report the AUC over the annotated regions to STDOUT. and if only the name of the BigWig file is passed in with no other args, it will *only* report total AUC to STDOUT. iconic behaviour honestly. π
--annotation <bed>β only outputs the regions in this BED, applying the argument you gave to--opto them.--op <sum[default], mean, min, max>β the statistic to run on the intervals provided by--annotation.sumis the default, no cap.--sums-onlyβ discards the coordinates from the output of the summarized regions. just the numbers, ma'am. π--distance (2200[default])β the number of base pairs between the end of the last annotation and the start of a new one to consider in the same BigWig query window (a form of binning) for performance. this is literally what determines how many times the BigWig index gets queried.--unsorted (off[default])β there's a performance improvement *if* the BED file passed to--annotationis 1) sorted bysort -k1,1 -k2,2n. the default is to assume it's sorted and check for unsorted positions; if unsorted positions are found, it'll fall back to the slower version. so it's giving "we'll find out" energy. π΅οΈ--bwbuffer <1GB[default]>β the size of the buffer for reading BigWig files. critical to use a large value (~1GB) for remote BigWigs. the default setting should be fine for most uses, but raise it if things are very slow on a remote BigWig. πβ‘οΈπ
𧬠BAM Input π§¬
extracts basic junction information from the BAM, including co-occurrence. and if only the name of the BAM file is passed in with no other args, it will *only* report total AUC to STDOUT.
--fastaβ path to the reference FASTA file if a CRAM file is passed as the input file (ignored otherwise). if you don't pass it, references will be downloaded using the CRAM header. π--junctionsβ extracts co-occurring jx coordinates, strand, and anchor length, per read. writes to a TSV file<prefix>.jxs.tsv.--all-junctionsβ extracts all jx coordinates, strand, and anchor length, per read, for any jx. writes to a TSV file<prefix>.all_jxs.tsv.--longreadsβ modifies certain buffer sizes to accommodate longer reads such as PB/Oxford. long queen behaviour. π--filter-inβ integer bitmask; any bits of which alignments need to have in order to be kept (similar tosamtools view -f).--filter-outβ integer bitmask; any bits of which alignments need to have in order to be skipped (similar tosamtools view -F).--add-chr-prefixβ adds the"chr"prefix to relevant chromosomes for BAMs w/o it; pass"human"or"mouse". only works for human/mouse references (default: off).
π Non-reference summaries π
--altsβ print differing-from-ref per-base coverages. writes to a CSV file<prefix>.alts.tsv.--include-softclipβ print a record to the alts CSV for soft-clipped bases. writes total counts to a separate TSV file<prefix>.softclip.tsv.--only-polyaβ if--include-softclipis on, only print softclips which are mostly A's or T's. π °οΈπ--include-nβ print mismatch records when the mismatched read base isN.--print-qualβ print quality values for mismatched bases.--deltaβ print the POS field as +/- delta from the previous one.--require-mdzβ quit with an error unless theMD:Zfield exists everywhere it's expected. > bestie this one is strict. it will not vibe with missingMD:Z. it exits. periodt. π--headβ print sequence names and lengths in the SAM/BAM header.
π Coverage and quantification π
--coverageβ print per-base coverage (slow but totally worth it). the original said it, and honestly? correct.--aucβ print per-base area-under-coverage. it'll generate it for the genome and for the annotation if--annotationis also passed in. defaults to STDOUT, unless other params are passed in as well, and then it writes to a TSV file<prefix>.auc.tsv.--bigwigβ output coverage as BigWig file(s). writes to<prefix>.bw(and also<prefix>.unique.bwwhen--min-unique-qualis specified). requires libBigWig. π¦--annotation <BED|window_size>β path to a BED file containing the list of regions to sum coverage over (tab-delimited:chrm,start,end). or this can specify a contiguous region size in bp. (yep, this flag shows up in two sections β it's that girl.)--op <sum[default], mean>β the statistic to run on the intervals provided by--annotation. default issum. (also a repeat visitor, and here the menu is shorter: justsumandmean.)--no-indexβ if using--annotation, skip the use of the BAM index (BAI) for pulling out regions. setting this can be faster if you're doing windows across the whole genome. this will be turned on automatically if a window size is passed to--annotation.--min-unique-qual <int>β output a second bigWig consisting only of alignments with at least this mapping quality.--bigwigmust be specified. also produces a second set of annotation sums based on this coverage if--annotationis enabled.--double-countβ allow overlapping ends of a PE read to count twice toward coverage. yes, twice. it said what it said. π―--num-basesβ report the total sum of bases in the alignments processed (the ones that pass filters).--gzipβ turns on gzipping of coverage output (no effect if--bigwigis passed), and this will also enable--no-coverage-stdout. ποΈ
π Other outputs π
--read-endsβ print counts of read starts/ends; if--min-unique-qualis set, then only the alignments that pass that filter will be counted here. writes to 2 TSV files:<prefix>.starts.tsv,<prefix>.ends.tsv.--frag-distβ print the fragment length distribution across the genome. writes to a TSV file<prefix>.frags.tsv.--echo-samβ print a SAM record for each aligned read.--endsβ report the end coordinate for each read (useful for debugging). π--test-polyaβ lower the Poly-A filter minimums for testing (only useful for debugging/testing). > bestie this is a testing-only flag. it is not for production. do not make it your main character. π
and that's the whole page!! π this was megadepth 1.2.0, from July 2022, and it lives in section 1 of the manual β go forth and quantify, bestie, you're gonna slay π«Άβ¨π
π¦ where this page comes from
- debian bookworm: megadepth 1.2.0-4 Β· MIT
- debian trixie: megadepth 1.2.0-4+b1 Β· MIT
- ubuntu noble: megadepth 1.2.0-4build2 Β· MIT
- ubuntu questing: megadepth 1.2.0-4build2
- ubuntu resolute: megadepth 1.2.0-5build2 Β· MIT
- ubuntu stonking: megadepth 1.2.0-5build2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms