Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for reference sequences with lowercase characters (a, c, g, t) #19

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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