You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've had a similar issues with a loom file containing duplicate CellIDs. After help from the authors of the publication (many thanks) it could be resolved by running a Python script on the dataset before using loomR. In this case the cells are unique, but the cell IDs are not unique for some cells due to a string truncation error in their pipeline.
Here is the Python script, it adds a suffix to the end of the second occurence of a duplicated CellIDs.
-------- save this part below in a make_unique_CellID.py file --------
from sys import exit
import loompy
from collections import Counter
d = loompy.connect("l5_all.loom")
cn = Counter(d.ca.CellID)
duplicates = [ cid for cid, n in cn.items() if n > 1 ]
cellids = d.ca.CellID[:]
c = set()
for i in range(len(cellids)):
cellid = cellids[i]
if cellid in c:
cellids[i] += "2"
c.add(cellid)
d.ca.CellID = cellids
d.close()
exit()
-------- end of make_unique_CellID.py file, don't save this line --------
Run the script in the same directory as the loom file, here it was l5_all.loom.
Apparently the loom file I'm trying to work with has duplicated Cell IDs:
Ultimately I would like convert these data into a data frame for further analysis. What can I do?
Session info:
The text was updated successfully, but these errors were encountered: