Skip to content

Commit

Permalink
Merge pull request #86 from tleonardi/fix_issue_85
Browse files Browse the repository at this point in the history
Fixed issue #85
  • Loading branch information
a-slide authored Apr 18, 2019
2 parents bd33e03 + 3a56e0a commit 6f7a577
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions nanocompore/SampCompDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def __init__(self,
# Try to get ref_id list and metadata from shelve db
try:
db_fn = db_prefix+"SampComp.db"
print(db_fn)
with shelve.open(db_fn, flag='r') as db:
# Try to get metadata from db
try:
Expand Down Expand Up @@ -842,8 +843,10 @@ def plot_position(self,
"color":next(col_gen)}

# Add GMM model if required and available
if model and 'txComp' in ref_data[pos] and 'GMM_model' in ref_data[pos]['txComp'] and isinstance(model, GaussianMixture):
model = ref_data[pos]['txComp']['GMM_model'][4]
if model and 'txComp' in ref_data[pos] and 'GMM_model' in ref_data[pos]['txComp']:
model = ref_data[pos]['txComp']['GMM_model']['model']
if not isinstance(model, GaussianMixture):
raise NanocomporeError("The GMM_model slot for this position is not an instance of the GaussianMixture class")
condition_labels = tuple(data.keys())
global_intensity = scale(np.concatenate(([v['intensity'] for v in data[condition_labels[0]].values()]+[v['intensity'] for v in data[condition_labels[1]].values()]), axis=None))
global_dwell = scale(np.log10(np.concatenate(([v['dwell'] for v in data[condition_labels[0]].values()]+[v['dwell'] for v in data[condition_labels[1]].values()]), axis=None)))
Expand Down

0 comments on commit 6f7a577

Please sign in to comment.