-
Notifications
You must be signed in to change notification settings - Fork 8
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
Error in the assign_grnas() step #162
Comments
It appears that the gRNA assignment to cells worked, and that that error occurred only in trying to visualize the results. Therefore, if what you want are just the gRNA assignments, you can export those via get_grna_assignments() and proceed with your analysis. To help us better understand what happened with the visualization function, could you please run the following code on your
|
Hi Hyunsoo, Thanks for following up. I now know what caused the error in the plotting code, and this is something we can fix fairly easily. However, as you suggest, there seem to be some other strange things going on with you data and/or our software: your targeting gRNA was detected in only 20 cells, and your non-targeting gRNA was detected in no cells. This is quite unusual. (Incidentally, the fact that you have a gRNA not detected in any cells is what caused the error in our plotting code.) At this stage, for me to determine whether this is caused by your data or our software, I would need to actually look at your data. Would you mind sharing your data with me, either via email ([email protected]) if it is under 20MB or so, or via a service like Google Drive if it is larger than that? I would keep your data confidential and delete it on my end after I finished diagnosing your issue. Best, |
Hi Gene, Thanks again for your efforts to help me! For your information, the data I'm using to learn about sceptre is from 10x Genomics. (For your information again, the estimated cell count of my data is 11686 whereas that by 10x Genomics is 11791. This is because I downloaded fastq files from 10x Genomics and ran cellranger by myself!) If you need any other information, please feel free to ask me anytime! Thanks! Hyunsoo |
Hi Hyunsoo, I've looked at the data, and I've reproduced what you are seeing: very few cells are having gRNAs assigned to them. My current theory is that something about the gRNA assignment method (the default, which is the mixture method) is going wrong for your data, because you have so few gRNAs. We will dig into this more when we have a chance. In the meantime, I recommend you use an alternative gRNA assignment method, the thresholding method. You can eyeball the gRNA count histograms produced by
With this method, nearly all cells have one or more assigned gRNAs. You can then proceed with your analysis. If and when we figure out why the mixture gRNA assignment method failed in this case, we will get back to you. Best, |
Hi Gene, Thank you so much for your super quick check and advice! I haven't done the threshold method yet but will do quite soon. As you suggested, I'll use the method, waiting for you and your development team to solve the initial issue. Again, thank you very much for your help with professional manners! Hyunsoo |
Dear awesome sceptre team,
First of all, thank you so much for developing this amazing tool.
Second, recently, I've been working on learning and testing this tool, sceptre to analyze my single-cell CRISPR screen data from the 10x Genomics platform.
I read and followed the sceptre tutorial, which went very well with the sample data provided by sceptredata.
After that, I tried to test the sceptre workflow with my 10x Genomics data, but I got stuck at the step of
assign_grnas()
, which is the step that exactly I need!My goal of using sceptre is to only categorize my cells into cells with targeting sgRNAs (perturbed cells) and cells with non-targeting sgRNAs (NT cells).
With the information, I can proceed to Seurat and do whatever analysis I need.
So, let me share what I did and what error I faced below.
1. Import data
grna_target_df <- read.csv("grna_target_df.csv")
sceptre_object <- import_data_from_cellranger(
directories = "filtered_feature_bc_matrix",
moi = "high",
grna_target_data_frame = grna_target_df
)
sceptre_object
discovery_pairs <- construct_trans_pairs(
sceptre_object = sceptre_object,
pairs_to_exclude = "none"
)
head(discovery_pairs)
dim(discovery_pairs) # 77212 2
side <- "both"
sceptre_object <- set_analysis_parameters(
sceptre_object = sceptre_object,
discovery_pairs = discovery_pairs,
side = side
)
2. Assign gRNAs to cells
a <- plot_grna_count_distributions(sceptre_object)
jpeg("1_gRNA_CountDistributions.jpg", width = 12, height = 6, units = "in", res=200)
a
dev.off()
sceptre_object <- assign_grnas(sceptre_object = sceptre_object, parallel = TRUE)
print(sceptre_object)
a <- plot(sceptre_object)
jpeg("2_gRNA_assignment.jpg", width = 12, height = 6, units = "in", res=200)
a
dev.off()
The code where the error occurs is the

a <- plot(sceptre_object)
part.R returned
"Error in sample.int(length(x), size, replace, prob) :
cannot take a sample larger than the population when 'replace = FALSE'".
I don't really understand what it means and what process I did wrong, so I wish to ask you for some advice on this.
For your information, let me also share what my data look like.

Really really wish I could have some help from you~~~
Thanks!
The text was updated successfully, but these errors were encountered: