-
Notifications
You must be signed in to change notification settings - Fork 30
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
ac.tl.nucleosome_signal bug #105
Comments
I also ran into this issue. I did some digging and it turns out that the problem is stemming from this line combined with the So, the code is just skipping every single fragment in the file since every call to The simplest way to fix this function is to copy the function to your code and just change this line: f = fr.next() to this: f = next(fr) A safer solution would be to change the for _ in tqdm(range(n), desc="Reading Fragments"):
try:
f = next(fr) # changed from fr.next()
length = f.end - f.start
row_ind = d[f.name]
if length < nucleosome_free_upper_bound:
mat[row_ind, 0] += 1
elif length < mononuleosomal_upper_bound:
mat[row_ind, 1] += 1
except KeyError: # changed to only catch KeyError (safer for debugging)
pass |
Thanks a lot for noticing and debugging this, @ad7115 and @russellgould! I've updated the function in the suggested changes, and it should be out in |
Great! Thanks for making that change! I'm on a Mac so should also give an error on other flavors of Unix. Possibly we have a different version of |
Describe the bug
I am running the muon tutorials for Single-cell RNA-seq and ATAC-seq integration on 10k PBMCs.
After running atac.tl.nucleosome_signal on the tutorial dataset, when plotting the histogram, I only get a square histogram, with a nucleosome_signal of 1.0 for every fragment. I tried the command without the barcode option (ac.tl.nucleosome_signal(atac, n=1e6)) and with it (ac.tl.nucleosome_signal(atac, n=1e6, barcodes="orig_barcode")) but nothing changed.
To Reproduce
I basically reproduced every step of the muon tutorial on this link : https://muon-tutorials.readthedocs.io/en/latest/single-cell-rna-atac/pbmc10k/1-Gene-Expression-Processing.html, until the ATAC-seq specific QC. Plot the histogramme with the command: mu.pl.histogram(atac, "nucleosome_signal", kde=False).
Expected behaviour
The expected histogram shown in the tutorial has a range of values between 0 and 2.5 approximately.
System
The text was updated successfully, but these errors were encountered: