Skip to content

Commit

Permalink
plot for MBQ
Browse files Browse the repository at this point in the history
  • Loading branch information
juanjo255 committed Oct 31, 2024
1 parent 18b1a03 commit f2c55bb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions scripts/custom_macro.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ def POS(variant):
def AF(variant):
"""Get allele fractions of alternate alleles as a numpy array."""
return np.concatenate([variant.format("AF").flatten()])

@continuous
def MBQ(variant):
"""Get median base quality by allele as a numpy array."""
return [i for i in variant.INFO["MBQ"]]
8 changes: 7 additions & 1 deletion scripts/plots_vcf.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,10 @@ figtype = 'bar'
formula = 'DEPTHs ~ 1'
title = 'Number of positions per depth'
ggs = 'stat_bin(bins=5);theme_light(); ylab("# Positions");xlab("Read-depth")'
figtype = 'histogram'
figtype = 'histogram'

[[instance]]
formula = 'MBQ ~ CHROM'
title = 'Median base quality by allele'
ggs = 'theme_light(); ylab("MBQ");xlab("CHROM")'
figtype = 'boxplot'

0 comments on commit f2c55bb

Please sign in to comment.