-
Notifications
You must be signed in to change notification settings - Fork 103
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 quadprog::solve.QP(D, d, A, bzero) : matrix D in quadratic function is not positive definite! #121
Comments
Received another error related to Call to Thank you and sorry for the trouble! |
Hi, If this is a general question re positive definitive, you could try to use the following tip to see if this solves the problem. Alternatively, we could help you troubleshoot if you could send us the data in some way (for example, removing the gene and cell-type names so that the data remain private). https://stackoverflow.com/questions/39129253/error-in-solve-qp |
Thanks for getting back to me. My question is less about positive definite matrices in general and more about why it is occurring in To this post I have added a gzipped file of the Both files have worked in conjunction with other enrich files or gioobjects, respectively, but here when used together The command I have been using is:
If you have any insight into why a non-positive definite matrix is being generated using this combination of normalized ST counts and enrich matrix I would greatly appreciate it! Thank you |
Hi @bmill3r - I wasn't able to download the data you posted. (Edited) I noticed above you were using a binary matrix (for more information on expected input for Can you give this a try and let us know if you are still having any problems? |
Thanks for getting back to me, I actually tried running In either case, I still receive the same error. Note that this error occurs when I use a signature matrix of 135 genes and 76 cell-types on a larger spatial dataset but not when I use a smaller spatial dataset. For instance, my smaller spatial dataset is 135 genes x 3072 pixels whereas my larger one is 135 genes x 13477 pixels. Conversely, if I use the larger spatial dataset (or the smaller one) but a smaller signature matrix of 135 genes and 9 cell-types, it works. So I don't think it is the spatial dataset or the signature matrix specifically but it is the combination of both the larger signature matrix and the larger spatial dataset. If I use an even bigger spatial dataset, I get a different error: I am using Giotto version 1.0.4 if that helps. I can try to send you the data another way if you are having trouble downloading from GitHub directly. Thanks again |
Hi @bmill3r, thanks for clarifying! Our Giotto suite branch includes the latest updates for the DWLS functions. From there, you can create your signature matrix either from data pre-processed with Giotto ( Below, I have written an explanation for each parameter used in both of the above functions mentioned. makeSignMatrixDWLS(gobject = Giotto Object,
expression_values = expression values to use,
reverse_log = default is set to TRUE,
log_base = default is set to 2,
sign_gene = marker genes to use,
cell_type_vector = vector of cell type for each cell in your dataset (length = ncol(matrix))) makeSignMatrixDWLSfromMatrix(matrix = scRNA-seq matrix,
sign_gene = marker genes to use,
cell_type_vector = vector of cell type for each cell in your dataset (length = ncol(matrix))) Let me know how this goes or if you have any further questions. Thank you for the feedback, we are working on improving our documentation to be the clearest possible and we are making this a priority. |
Hi again, Unfortunately installation of the Giotto suite branch, generation of a signature matrix via Some minor comments: |
Hi, thanks for trying that out! If you would like, I would be happy to take a closer look with your specific data. Perhaps you can either share a Google drive link or email me the files at natalie.delrossi@mssm.edu. Regarding the slots, these changes reflect the development of the suite branch to accommodate multiple modalities (such as protein expression). You can access the data using |
I have sent the data via google drive and also a separate email with some information about the files just in case. Any help would be appreciated. Thank you for all of your assistance! |
Hello,
I am trying to perform deconvolution on some spatial data. I have had success running
Giotto::runDWLSDeconv()
previosuly but now I am using a larger signature matrix and it appears thatquadprog::solve.QP()
is complaining about a matrix not being positive definite, which is something I don't have much experience nor understand what it means exactly.The full error message is:
The command I am running is:
Here, I'm selecting the log2 transformed and normalized expression matrix (
giottoobj@norm_expr
), which is 135 genes x 3072 pixels. I previously clustered these pixels into 9 clusters, which are being selected viacluster_column = 'cluster_9'
(giottoobj@cell_metadata$cluster_9
).The
enrich_matrix
is currently a 135 gene (same genes ingiottoobj@norm_expr
) by 76 cell-type binary (0/1) gene enrichment matrix. I have also used a gene expression matrix for these same 135 genes and 76 cell-types but receive the same error. All cell-types are enriched in at least two of the genes. Most of the genes are specifically enriched in one cell-type.Do you know what might be going on? I've gone through the Giotto source code but it's pretty dense to keep track of the variables as they are passed to internal functions, and I cannot execute the internal functions themselves to investigate as many are not exported and thus not callable independently.
Thanks in advance
The text was updated successfully, but these errors were encountered: