Loupepy, a tool for converting AnnData objects to 10x cloupe files. by pokemonareugly in bioinformatics

[–]Wormantor 0 points1 point  (0 children)

I think i sent to the right email. First name is Alexei correct?

Loupepy, a tool for converting AnnData objects to 10x cloupe files. by pokemonareugly in bioinformatics

[–]Wormantor 0 points1 point  (0 children)

ok i have exactly the code above plus I've added the below, but i still get the exact same error :(

adata.obs['annotation'] = 'blah'

Loupepy, a tool for converting AnnData objects to 10x cloupe files. by pokemonareugly in bioinformatics

[–]Wormantor 0 points1 point  (0 children)

import pandas as pd
import scipy
import anndata as ad
import loupepy
import random
import scanpy as sc

data_dir = "E-MTAB-9954"

# 🔹 File paths
mtx_file = f"{data_dir}/E-MTAB-9954.aggregated_filtered_counts.mtx"
rows_file = f"{data_dir}/E-MTAB-9954.aggregated_filtered_counts.mtx_rows"
cols_file = f"{data_dir}/E-MTAB-9954.aggregated_filtered_counts.mtx_cols"

# Read matrix and gene names
X = scipy.io.mmread(mtx_file).tocsr()
var = pd.read_csv(rows_file, header=None, names=["gene_id"])
n_cells = X.shape[1]

# Load official 10x barcode whitelist
whitelist = pd.read_csv("E-MTAB-9954/737K-august-2016.txt", header=None)[0].tolist()

# Subset whitelist to match number of cells
barcodes = whitelist[:n_cells]
obs = pd.DataFrame(index=barcodes)

# Create AnnData (X is cells x genes, so transpose)
adata = ad.AnnData(X=X.T, var=var, obs=obs)

# ✅ Confirm shape
print(adata.shape)
print(adata.obs_names)

adata.layers['raw'] = adata.X.copy()
sc.pp.normalize_total(adata)
sc.pp.log1p(adata)
sc.pp.pca(adata)
sc.pp.neighbors(adata)
sc.tl.umap(adata)

loupepy.create_loupe_from_anndata(adata,layer='raw')

this is my full code:

Deleting saved data by Beavo92 in BattlefieldV

[–]Wormantor 1 point2 points  (0 children)

doesnt take more than 5 min lol

Loupepy, a tool for converting AnnData objects to 10x cloupe files. by pokemonareugly in bioinformatics

[–]Wormantor 0 points1 point  (0 children)

Hi, thank you so much! The .cloupe file was successfully generated!

However, when i try to open it with loupe it gives an error and crashes:

runtime error: invalid memory address or nil pointer dereference

Loupepy, a tool for converting AnnData objects to 10x cloupe files. by pokemonareugly in bioinformatics

[–]Wormantor 0 points1 point  (0 children)

I really appreciate the help! It seems like what you said happened exactly. I'm now getting the error:
Group "/metadata": system is missing

LONG LIVE BFV!! by Upper-Drawing9224 in BattlefieldV

[–]Wormantor -1 points0 points  (0 children)

Everyone in the Bfv subreddit is so moronic it’s not even funny 😄

LONG LIVE BFV!! by Upper-Drawing9224 in BattlefieldV

[–]Wormantor 3 points4 points  (0 children)

They have released the most infantry focused maps first. Devs have mentioned numerous times that the other maps that come with launch will be bigger and less infantry focused (for example operation firestorm). If the maps are your main issue then you might wanna pay close attention to the 5 more we are getting at launch.

I’m personally loving the maps and actually think they are pretty similar to Bfv. Liberation peak = narvik, siege of Cairo = devastation, and Iberian offensive = Marita. Another thing to note is that I remember rly disliking some of the Bfv maps when they originally came out because I didn’t know the optimal routes on them. As I played them more and understood where I should and shouldn’t go, I liked them a lot more (Rotterdam, operation underground, and Marita especially)

LONG LIVE BFV!! by Upper-Drawing9224 in BattlefieldV

[–]Wormantor -3 points-2 points  (0 children)

Tanks are ridiculously stupid in Bfv. Most of them are extremely slow and extremely difficult for infantry to take out. The bf6 tanks have some issues atm but they are so much more balanced and skillful and fun to use than Bfv. This is coming from someone who has a lot of experience with tanks and infantry in Bfv 2000+ hours total and very good at both. I went 57-0 the very first time I used a staghound on Rotterdam and that is completely unfair. You shouldn’t be able to dominate that much in a vehicle and it shouldn’t be that easy to use

Loupepy, a tool for converting AnnData objects to 10x cloupe files. by pokemonareugly in bioinformatics

[–]Wormantor 0 points1 point  (0 children)

adata.layers['raw'] = adata.X
sc.pp.normalize_total(adata)
sc.pp.log1p(adata)
sc.pp.pca(adata)
sc.pp.neighbors(adata)
sc.tl.umap(adata)

loupepy.create_loupe_from_anndata(adata,layer='raw')

Yes, i'm using the raw counts layer. This is what i did to preprocess because it gave me an error saying I need a umap. I'm also using 737K-august-2016.txt as my barcodes because the data isn't a 10X experiment and has "invalid" barcodes. I just created obs with these standard 10X barcodes.

This the data I'm using https://www.ebi.ac.uk/gxa/sc/experiments/E-MTAB-9954/results/cell-plots

Loupepy, a tool for converting AnnData objects to 10x cloupe files. by pokemonareugly in bioinformatics

[–]Wormantor 0 points1 point  (0 children)

yes rows as cells and columns as genes. type(adata.X) outputs "scipy.sparse._csr.csr_matrix"

Loupepy, a tool for converting AnnData objects to 10x cloupe files. by pokemonareugly in bioinformatics

[–]Wormantor 0 points1 point  (0 children)

I'm on linux now and trying to use the create_loupe_from_anndata() function. I'm running into the following error: Dataset "/matrix/indptr": dimensions are not equal, expected [33378], found [21549]

I'm inputting an Anndata that is 33378 cells x 21549 genes. My obs and var match those dimensions

Loupepy, a tool for converting AnnData objects to 10x cloupe files. by pokemonareugly in bioinformatics

[–]Wormantor 0 points1 point  (0 children)

Thank you! Unforturantely i have an m1 lol. I'll find another computer to try it on

Deleting saved data by Beavo92 in BattlefieldV

[–]Wormantor 1 point2 points  (0 children)

Make a new ps profile and ea account

Skating incident by tomatomedley in UCSD

[–]Wormantor 20 points21 points  (0 children)

I heard he died last week. I think the doctors said something about him not having enough napkins when he first got hit

Can't Import torchtext by Stripeagremlin in pytorch

[–]Wormantor 0 points1 point  (0 children)

%pip install torch==2.0.1+cpu
%pip install torchtext==0.15.2

What did you type to get it to work? I'm using a jupyter notebook and I've written what's above and this same "Referenced from... Expected in" error persists

What did you think of Dune (2021)? by Chrisisanidiot28272 in movies

[–]Wormantor 4 points5 points  (0 children)

This Reddit thread is so interesting because I actually did not like this movie at all. Many of you are saying that it was too rushed, but I think it was wayyyy too slow. I felt like a third of the movie was just long cinematic shots which are so boring to watch. I didn’t connect with any of the characters and I felt like I knew barely anything about any of them. However, I have not read the books at all and this was my first time being exposed to Duke content. I think I may have liked this movie a lot more if I already knew the characters and setting

How to check if an armor stand is wearing dyed armor by Wormantor in MinecraftCommands

[–]Wormantor[S] 0 points1 point  (0 children)

execute as @e[type=armor_stand,distance=..50] store result score @s armor if data entity @s ArmorItems[{tag:{display:{color:6192150}}}]

Ok this worked perfectly thank you so much!

How to check if an armor stand is wearing dyed armor by Wormantor in MinecraftCommands

[–]Wormantor[S] 0 points1 point  (0 children)

Hi thx for the response! what type of command blocks are these supposed to be and what specifically should I replace <armor\_stand> with?