Skip to content
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

Did not find any barcode-spots of the specified object in input for 'feature_df'. #57

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

sciencepeak
Copy link

Hi,

When I run the function runCnvAnalysis(), I got this error:
Error in addFeatures(object = object, feature_df = ordered_cnv_df2, overwrite = TRUE) : Did not find any barcode-spots of the specified object in input for 'feature_df'.
After careful debugging, I found that the problem arises from the barcode name processing in the runCnvAnalysis() function. The function changes the barcode names, whereas the barcode in the spata2 objects are not changed. Thereby, the barcode name discrepancy appears.

Specifically, after testing the source code in the runCnvAnalysis() function, I found that the barcodes’ dot symbols are all changed to hyphen symbols by using stringr::str_replace_all(string = barcodes, pattern = "\\.", replacement = "-"). I see the replacement is meaningful, because the statement results <- utils::read.table(result_dir) reads the file from disk and make all the hyphen changed to dot in the column names, which is a default behavior of R language. So there is a need to replace all dot back to hyphen.

However, changing the barcode names in the function might not be the best way to handle the custom barcode naming conventions from different users. In our case, our barcode names have dot as well as hyphen to designate the hierarchical structure of the naming levels. So, here I propose a way to keep the barcode unchanged while keep the code running and to make the barcode name consistent with the one in the spata2 object. My solution is to read the file with the parameter check.names = FALSE, like this utils::read.table(result_dir, check.names = FALSE). This way all the hyphens are kept and not changed to dot. Then the dot to hyphen conversion statements are all deleted. After testing the barcode names in different R object produced thereafter, I found the barcode name without any change works well throughout the rest of the function runCnvAnalysis() as well as addFeatures() called by runCnvAnalysis().

Thanks for your contribution to the field and help to our research.

Best,

@sciencepeak
Copy link
Author

sciencepeak commented Mar 1, 2023

the gene_pos_df issue fixed.

The old CONICSmat::getGenePositions() is no longer working. I fix the getGenePositions() and included the function in the SPATA2 package before the maintainer of CONICSmat approve my pull request

The gene position information is updated to ensembl v109.

Add a default option of removing chr0, chr23, and chr24 so people will not get confused, and then study, and then make their own gene_pos_df.

The runCnvAnalysis parameter list is mostly unchanged to make the dependent code working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants