10XGenomics / loupeR

Convert Seurat objects to 10x Genomics Loupe files.
https://10xgen.com/louper
Other
94 stars 14 forks source link

Formatting errors #44

Closed joebielanski closed 2 months ago

joebielanski commented 5 months ago

Hello! I'm trying to take a Seurat object made up of 15 samples and explore it in Loupe after I processed, filtered and integrated it in R. Upon running create_loupe() or create_loupe_from_seurat() I get the following errors:

2024/04/15 15:05:07 validating count matrix
Error in create_loupe(count_mat = count_mat, clusters = clusters, projections = projections,  : 

It looks like the formatting of your count matrix does not match the required formatting for LoupeR. For further information, please see the documentation: 10xgen.com/louper

There is an issue with the formatting of your barcodes. Barcodes should begin with base pairs and end with an optional hyphen and suffix. For further information, please see the documentation: 10xgen.com/louper

I've explored the documentation and there really isn't anything explaining this error/what the required format is even supposed to be, so I'm quite lost.

could it be that my barcodes, each coming from 1 of 15 samples have the name attached to them at the front of the barcode? eg// 'Fox12-21_AAACCCACAACGCACAG-1' is my first. That's just the default though. I haven't done anything to mess with them. Any advice on how to proceed is much appreicated.

esiegel commented 5 months ago

You can try modifying the barcodes to have the ACTGs first and then a hyphen and whatever suffix you like. Do note that the data must come from a 10x experiment

joebielanski commented 5 months ago

Thanks! I'll give that a go and try swapping the IDs and the sequences itself. All the data is from 15 separate 10x experiments we did ourselves so there's no worry there. Something in our analysis pipeline, built for older versions of Seurat may have changed stuff up a bit.

josegarciamanteiga commented 4 months ago

Hi, Did you manage to solve the issue? I have I think the same, but I already have the correct barcode formats and the error is always the same. Thanks!

brigidar commented 3 months ago

Same here. I fixed the barcode from an underscore to a suffix, but I still have the same issue. Also if I check my barcodes with the function are_barcodes_valid it passes it. It must be something when they are imported from the seurat object that gets messed up. Even tried to add the counts with the create_loupe and still get the same issue.

dylanwebster commented 3 months ago

Hi @joebielanski and @brigidar, so the team at 10x can dig in further, can you email support@10xgenomics.com? Over our support channel we'll be better able to exchange data and get to the root cause. We could take a look at your seurat objects to see what is going on directly.

brigidar commented 3 months ago

Ok will do

Rubbert commented 3 months ago

I had the same error, and it took me a while to find out I needed to transpose the matrix.

I had loaded an h5ad file with anndata, and the default adata$layers['counts'] was transposed compared to what was expected by the create_loupe function.

Would it make sense to generally expand the help/argument section? I also struggled for a while trying to change my barcodes (without clear guidelines), though this did not end up being the issue.

esiegel commented 2 months ago

I'm going to respond to the original issue with regards to the barcodes.

@Rubbert I think it is a good idea to improve the docstrings to describe the rows and cols for the matrix. I will add a ticket for that.

We've seen other issues in the past where the barcodes look valid. However, within the set, there are sometimes potentially some that sneak in that are not valid 10x barcodes. This can happen when using custom pipelines that may create artificial barcodes to avoid collisions when integrating data.

If you can't easily identify barcodes that may fall into this pattern, then please wait for our next update (1.1.2) which should include better messaging. Please note that if the barcodes come from non-10x assays, this is not supported by LoupeR, since its license is only for use with 10x Genomics experiments.

Thank you