-
Notifications
You must be signed in to change notification settings - Fork 13
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
RuntimeWarning: Mean of empty slice #17
Comments
Hmm, there seems to be a problem earlier, "collating 0 samples" feels like
an item of concern. I'm not sure if it is a potential mismatch in column
headings for the sgRNA in Count_Matrix.tab vs sgrna [all lower case] in
sgRNA_Mapping_File , or ability to identify the sample from sample file.
The way in which the replicate and sample are specified has been improved
over the years, so I am not completely sure what the right encoding is, but
I would think it to potentially be the main culprit. Let me know if this
does not help rapidly resolve,
Leo
…On Tue, Nov 9, 2021 at 11:24 PM sum732 ***@***.***> wrote:
Hello,
I am trying to use JACKS and running into following issues:
python ~/Research/Programs/Jacks/JACKS/jacks/run_JACKS.py Count_Matrix.tab Exp_Summary_JACKS.tab sgRNA_Mapping_File.tab --sgrna_hdr=sgrna --gene
_hdr=Gene --ctrl_sample_hdr=Sample --outprefix JACKS
[2021-11-09 18:05:01,363] jacks: INFO Loading sample specification
[2021-11-09 18:05:01,363] jacks: INFO Loading gene mappings
[2021-11-09 18:05:01,365] jacks: INFO Loading data and pre-processing
[2021-11-09 18:05:01,424] jacks: INFO Applying median normalisation
[2021-11-09 18:05:01,471] jacks: INFO Collating 0 samples
[2021-11-09 18:05:01,487] jacks: INFO Running JACKS inference
/home/.conda/envs/jacksenv/lib/python3.10/site-packages/scipy/_lib/deprecation.py:20: RuntimeWarning: Mean of empty slice
return fun(*args, **kwargs)
/home/Research/Programs/Jacks/JACKS/jacks/jacks/infer.py:88: RuntimeWarning: Mean of empty slice.
LOG.debug("After init, mean absolute error=%.3f, <x>=%.1f <w>=%.1f lower bound=%.1f"%(SP.nanmean(abs(y.T-SP.outer(w1,x1))).mean(), x1.mean(), w1.mean(), bound))
/home/.conda/envs/jacksenv/lib/python3.10/site-packages/numpy/core/_methods.py:189: RuntimeWarning: invalid value encountered in double_scalars
ret = ret.dtype.type(ret / rcount)
/home/Research/Programs/Jacks/JACKS/jacks/jacks/infer.py:115: RuntimeWarning: Mean of empty slice.
LOG.debug("After W update, <w>=%.1f, mean absolute error=%.3f"%(w1.mean(), SP.nanmean(abs(y.T-SP.outer(w1,x1))).mean()))
/home/Research/Programs/Jacks/JACKS/jacks/jacks/infer.py:96: RuntimeWarning: Mean of empty slice.
LOG.debug("Iter %d/%d. lb: %.1f err: %.3f x:%.2f+-%.2f w:%.2f+-%.2f xw:%.2f"%(i+1, n_iter, bound, SP.nanmean(abs(y.T-SP.outer(w1,x1))).mean(), x1.mean(), SP.median((x2-x1**2)**0.5), w1.mean(), SP.median((w2-w1**2)**0.5), x1.mean()*w1.mean()))
/home/.conda/envs/jacksenv/lib/python3.10/site-packages/numpy/core/fromnumeric.py:3440: RuntimeWarning: Mean of empty slice.
return _methods._mean(a, axis=axis, dtype=dtype,
[2021-11-09 18:05:01,801] jacks: INFO Writing JACKS results
/gpfs/fs1/home/Research/Programs/Jacks/JACKS/jacks/jacks/jacks_io.py:28: RuntimeWarning: Mean of empty slice
ordered_genes = [(np.nanmean(jacks_results[gene][4]),gene) for gene in jacks_results]
/home/Research/Programs/Jacks/JACKS/jacks/jacks/jacks_io.py:137: RuntimeWarning: Mean of empty slice
ordered_genes = [(np.nanmean(jacks_results[gene][4]),gene) for gene in jacks_results]
Here are snippets of how various files look:
head -n +4 Count_Matrix.tab
sgRNA P23H1 P23H2 Control1 Control2 Control3
Amfr_sgRNA1 150 44 602 530 302
Amfr_sgRNA2 141 24 380 350 162
Amfr_sgRNA3 203 21 443 435 303
head Exp_Summary_JACKS.tab
Replicate Sample
P23H1 P23H
P23H2 P23H
Control1 CTRL
Control2 CTRL
Control3 CTRL
head -n +3 sgRNA_Mapping_File.tab
sgrna Gene
Sec24d_sgRNA2 Sec24d
Gm30534_sgRNA3 Gm30534
Not exactly why any array slice will produce a mean of <0( assuming that
is the error). The counts is tab separated and so are the other files as
well.
Any help will be much appreciated.
Thanks,
D
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#17>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADIQI6XOACLLJVE747LUE3ULGUQ7ANCNFSM5HWQIMGA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Hi Leo,
Got this error
Changed to Match
Error
Here is Expsummary
These all are tab separated, I reconfirmed this. |
Just to triple check - did you use the latest version, and have you tried
explicitly setting
--rep_hdr=Replicate --sample_hdr=Sample
? The --ctrl-sample-hdr is for the third header, I worry if the defaults
for first two match what you use.
https://github.com/felicityallen/JACKS/tree/master/jacks has the example
…On Thu, Nov 11, 2021 at 10:50 PM sum732 ***@***.***> wrote:
Hi Leo,
Thank you for responding and for the suggestion.
I had tried setting things correctly
head -n +1 Count_Matrix-Fixed.tab sgRNA_Mapping_File-Fixed.tab
==> Count_Matrix-Fixed.tab <==
sgrna Gene P23H_rep1 P23H_rep2 Control_rep1 Control_rep2 Control_rep3
==> sgRNA_Mapping_File-Fixed.tab <==
sgrna Gene
Got this error
python ~/Research/Programs/Jacks/JACKS/jacks/run_JACKS.py Count_Matrix-Fixed.tab Exp_Summary_JACKS.tab sgRNA_Mapping_File-Fixed.tab --sgrna_hdr=sgrna --gene_h
dr=Gene --ctrl_sample_hdr=Sample --outprefix JACKS
[2021-11-11 17:39:54,074] jacks: INFO Loading sample specification
[2021-11-11 17:39:54,075] jacks: INFO Loading gene mappings
[2021-11-11 17:39:54,078] jacks: INFO Loading data and pre-processing
[2021-11-11 17:39:54,136] jacks: INFO Applying median normalisation
[2021-11-11 17:39:54,184] jacks: INFO Collating 0 samples
[2021-11-11 17:39:54,200] jacks: INFO Running JACKS inference
/home/.conda/envs/jacksenv/lib/python3.10/site-packages/scipy/_lib/deprecation.py:20: RuntimeWarning: Mean of empty slice
return fun(*args, **kwargs)
/homes/Research/Programs/Jacks/JACKS/jacks/jacks/infer.py:88: RuntimeWarning: Mean of empty slice.
LOG.debug("After init, mean absolute error=%.3f, <x>=%.1f <w>=%.1f lower bound=%.1f"%(SP.nanmean(abs(y.T-SP.outer(w1,x1))).mean(), x1.mean(), w1.mean(), bound))
/gpfs/fs1/home/mehrotras/.conda/envs/jacksenv/lib/python3.10/site-packages/numpy/core/_methods.py:189: RuntimeWarning: invalid value encountered in double_scalars
ret = ret.dtype.type(ret / rcount)
/home/Research/Programs/Jacks/JACKS/jacks/jacks/infer.py:115: RuntimeWarning: Mean of empty slice.
LOG.debug("After W update, <w>=%.1f, mean absolute error=%.3f"%(w1.mean(), SP.nanmean(abs(y.T-SP.outer(w1,x1))).mean()))
/home/Research/Programs/Jacks/JACKS/jacks/jacks/infer.py:96: RuntimeWarning: Mean of empty slice.
LOG.debug("Iter %d/%d. lb: %.1f err: %.3f x:%.2f+-%.2f w:%.2f+-%.2f xw:%.2f"%(i+1, n_iter, bound, SP.nanmean(abs(y.T-SP.outer(w1,x1))).mean(), x1.mean(), SP.median((x2-x1**2)**0.5), w1.mean(), SP.median((w2-w1**2)**0.5), x1.mean()*w1.mean()))
/home/.conda/envs/jacksenv/lib/python3.10/site-packages/numpy/core/fromnumeric.py:3440: RuntimeWarning: Mean of empty slice.
return _methods._mean(a, axis=axis, dtype=dtype,
[2021-11-11 17:39:54,511] jacks: INFO Writing JACKS results
/home/Research/Programs/Jacks/JACKS/jacks/jacks/jacks_io.py:28: RuntimeWarning: Mean of empty slice
ordered_genes = [(np.nanmean(jacks_results[gene][4]),gene) for gene in jacks_results]
/home/Research/Programs/Jacks/JACKS/jacks/jacks/jacks_io.py:137: RuntimeWarning: Mean of empty slice
ordered_genes = [(np.nanmean(jacks_results[gene][4]),gene) for gene in jacks_results]
(jacksenv) ***@***.***:$/JACKS>head -n +1 Count_Matrix-Fixed.tab sgRNA_Mapping_File-Fixed.tab
Changed to Match
head -n +1 Count_Matrix-Fixed.tab sgRNA_Mapping_File-Fixed.tab
==> Count_Matrix-Fixed.tab <==
sgRNA Gene P23H_rep1 P23H_rep2 Control_rep1 Control_rep2 Control_rep3
==> sgRNA_Mapping_File-Fixed.tab <==
sgRNA Gene
Error
python ~/Research/Programs/Jacks/JACKS/jacks/run_JACKS.py Count_Matrix-Fixed.tab Exp_Summary_JACKS.tab sgRNA_Mapping_File-Fixed.tab --sgrna_hdr=sgRNA --gene_hdr=Gene --ctrl_sample_hdr=Sample --outprefix JACKS
[2021-11-11 17:42:37,162] jacks: INFO Loading sample specification
[2021-11-11 17:42:37,162] jacks: INFO Loading gene mappings
[2021-11-11 17:42:37,164] jacks: INFO Loading data and pre-processing
[2021-11-11 17:42:37,223] jacks: INFO Applying median normalisation
[2021-11-11 17:42:37,272] jacks: INFO Collating 0 samples
[2021-11-11 17:42:37,288] jacks: INFO Running JACKS inference
/home/.conda/envs/jacksenv/lib/python3.10/site-packages/scipy/_lib/deprecation.py:20: RuntimeWarning: Mean of empty slice
return fun(*args, **kwargs)
/home/Research/Programs/Jacks/JACKS/jacks/jacks/infer.py:88: RuntimeWarning: Mean of empty slice.
LOG.debug("After init, mean absolute error=%.3f, <x>=%.1f <w>=%.1f lower bound=%.1f"%(SP.nanmean(abs(y.T-SP.outer(w1,x1))).mean(), x1.mean(), w1.mean(), bound))
/home/.conda/envs/jacksenv/lib/python3.10/site-packages/numpy/core/_methods.py:189: RuntimeWarning: invalid value encountered in double_scalars
ret = ret.dtype.type(ret / rcount)
/home/Research/Programs/Jacks/JACKS/jacks/jacks/infer.py:115: RuntimeWarning: Mean of empty slice.
LOG.debug("After W update, <w>=%.1f, mean absolute error=%.3f"%(w1.mean(), SP.nanmean(abs(y.T-SP.outer(w1,x1))).mean()))
/home/Research/Programs/Jacks/JACKS/jacks/jacks/infer.py:96: RuntimeWarning: Mean of empty slice.
LOG.debug("Iter %d/%d. lb: %.1f err: %.3f x:%.2f+-%.2f w:%.2f+-%.2f xw:%.2f"%(i+1, n_iter, bound, SP.nanmean(abs(y.T-SP.outer(w1,x1))).mean(), x1.mean(), SP.median((x2-x1**2)**0.5), w1.mean(), SP.median((w2-w1**2)**0.5), x1.mean()*w1.mean()))
/home/.conda/envs/jacksenv/lib/python3.10/site-packages/numpy/core/fromnumeric.py:3440: RuntimeWarning: Mean of empty slice.
return _methods._mean(a, axis=axis, dtype=dtype,
[2021-11-11 17:42:37,602] jacks: INFO Writing JACKS results
/home/Research/Programs/Jacks/JACKS/jacks/jacks/jacks_io.py:28: RuntimeWarning: Mean of empty slice
ordered_genes = [(np.nanmean(jacks_results[gene][4]),gene) for gene in jacks_results]
/home/Research/Programs/Jacks/JACKS/jacks/jacks/jacks_io.py:137: RuntimeWarning: Mean of empty slice
ordered_genes = [(np.nanmean(jacks_results[gene][4]),gene) for gene in jacks_results]
Here is Expsummary
cat Exp_Summary_JACKS.tab
Replicate Sample
P23H_rep1 P23H
P23H_rep2 P23H
Control_rep1 CTRL
Control_rep2 CTRL
Control_rep3 CTRL
These all are tab separated, I reconfirmed this.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#17 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADIQIZWIGD2XQK7COVA6ILULRCD5ANCNFSM5HWQIMGA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Hi Leo,
I am getting
So it seems that I need the third column. However, I am not sure how set this correctly. I have 3 WT/Controls and 2 muts/treatments. Making this change
shows following error
|
Hello,
I am trying to use JACKS and running into following issues:
Here are snippets of how various files look:
head -n +4 Count_Matrix.tab
head Exp_Summary_JACKS.tab
head -n +3 sgRNA_Mapping_File.tab
Not exactly sure why any array slice will produce a mean of <0( assuming that is the error). The counts is tab separated and so are the other files as well. I do see a
Collating 0 samples
could this be the issue?Any help will be much appreciated.
Thanks,
D
The text was updated successfully, but these errors were encountered: