snap-stanford / SATURN

MIT License
108 stars 17 forks source link

issue with barcodes if species in the run.csv are provided in a non-alphabetic order #47

Closed matejasoretic closed 7 months ago

matejasoretic commented 7 months ago

I have discovered what I believe to be a bug/slight inconvenience. All the barcodes from my original .h5ad objects were present in the integrated SATURN object. However, they did not correspond to the correct species. I have found this is because in my equivalent of the "frog_zebrafish_run.csv" file, my species and their corresponding paths were ordered in a phylogenetic order, rather than an alphabetic one. In the .h5ad object output by SATURN, when I looked at .obs.species, I saw that the first barcodes were those of the first species in my .csv, but the species label they had was that of the species whose name came first alphabetically. Similarly, the last barcodes were from the last species in my .csv, but the species was that which came last alphabetically

I am rerunning my SATURN integration now with the .csv altered so that the species and their corresponding files are in alphabetical order rather than a phylogenetic one, I assume this will solve this issue and that the original barcodes will continue to be used for the same cells of the same species.

Yanay1 commented 7 months ago

We order the species alphabetically when we create the anndatas. You can change the order of the anndata after the final one is created.