Skip to content

Commit

Permalink
Merge pull request #19 from tkonopka/lowercase
Browse files Browse the repository at this point in the history
support for reference sequences with lowercase characters (a, c, g, t)
  • Loading branch information
danielmsk authored Nov 8, 2024
2 parents a9c219d + b09fa76 commit b95f02d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/bamsnap.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
MANIFEST.in
README.md
setup.cfg
setup.py
src/bamsnap/__init__.py
src/bamsnap/_logging.py
Expand Down
12 changes: 12 additions & 0 deletions src/bamsnap/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,31 @@
COLOR = {}
COLOR['cov'] = ImageColor.getrgb("#AAAAAA")
COLOR['A'] = ImageColor.getrgb("#00ff00")
COLOR['a'] = ImageColor.getrgb("#00ff00")
COLOR['T'] = ImageColor.getrgb("#ff0000")
COLOR['t'] = ImageColor.getrgb("#ff0000")
COLOR['G'] = ImageColor.getrgb("#d17105")
COLOR['g'] = ImageColor.getrgb("#d17105")
COLOR['C'] = ImageColor.getrgb("#0000ff")
COLOR['c'] = ImageColor.getrgb("#0000ff")
COLOR['N'] = ImageColor.getrgb("#AAAAAA")
COLOR['wA'] = ImageColor.getrgb("#64E464")
COLOR['wa'] = ImageColor.getrgb("#64E464")
COLOR['wG'] = ImageColor.getrgb("#CAB7A1")
COLOR['wg'] = ImageColor.getrgb("#CAB7A1")
COLOR['wC'] = ImageColor.getrgb("#8C8CD9")
COLOR['wc'] = ImageColor.getrgb("#8C8CD9")
COLOR['wT'] = ImageColor.getrgb("#DE7878")
COLOR['wt'] = ImageColor.getrgb("#DE7878")
COLOR['wN'] = ImageColor.getrgb("#AAAAAA")
COLOR['dA'] = ImageColor.getrgb("#078c07")
COLOR['da'] = ImageColor.getrgb("#078c07")
COLOR['dT'] = ImageColor.getrgb("#9c0808")
COLOR['dt'] = ImageColor.getrgb("#9c0808")
COLOR['dG'] = ImageColor.getrgb("#995508")
COLOR['dg'] = ImageColor.getrgb("#995508")
COLOR['dC'] = ImageColor.getrgb("#060680")
COLOR['dc'] = ImageColor.getrgb("#060680")
COLOR['dN'] = ImageColor.getrgb("#5c5959")
COLOR['MAPQ_0'] = ImageColor.getrgb("#EFEFEF")
COLOR['READ'] = ImageColor.getrgb("#c8c8c8")
Expand Down
9 changes: 5 additions & 4 deletions src/bamsnap/drawreadset.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ def get_image(self, w, h, bgcolor="FFFFFF"):

def get_vaf(self, base_composition, dp, posi, refseq):
aflist = []
for b1 in base_composition.keys():
if refseq[posi] != b1:
aflist.append(base_composition[b1]/dp)
return max(aflist)
ref_base = str(refseq[posi]).upper()
for b1, v1 in base_composition.items():
if ref_base != b1:
aflist.append(v1/dp)
return max(aflist, default=0.0)

def draw_coverage(self, dr, w, h):
try:
Expand Down

0 comments on commit b95f02d

Please sign in to comment.