sstadick / perbase

Per-base per-nucleotide depth analysis
MIT License
115 stars 13 forks source link

Support bedGraph output in only-depth #46

Open ghuls opened 2 years ago

ghuls commented 2 years ago

Support bedGraph output in only-depth:

This is basically perbase -z output without header and chromosomes sorted by lexographically.

This would allow to create bigwig files relatively easily. (naive sorting takes quite a while instead of reading the reads by chromosome in lexographical order).

perbase only-depth -z ${bam} | tail -n +2 | LC_COLLATE=C sort -k 1,1 -k 2,2n -k 3,3n > ${bedgraph}

bedGraphToBigWig ${bedgraph} ${chrom_sizes} ${bigwig}

bedGraph format: http://genome.ucsc.edu/goldenPath/help/bedgraph.html

sstadick commented 2 years ago

I'll looking into making this more natively supported. There is also the --bed-format option which, with -z should make the output more BED like. The output order is currently dictated by the BAM header, if the input BAM is sorted lexographically then so will the output of perbase (not ideal, I'm just noting it).

Options to make this work would be: