Git Product home page Git Product logo

Comments (10)

LukasOussoren avatar LukasOussoren commented on August 29, 2024 1
Capture

I tried defining scplus_genes before the line of code you highlighted. So far it appears to have solved the issue.

from scenicplus.

orian116 avatar orian116 commented on August 29, 2024 1

Thank you! That seemed to work but now I am getting a new error
Screenshot 2024-05-07 at 11 34 15 AM

from scenicplus.

LukasOussoren avatar LukasOussoren commented on August 29, 2024 1

Thank you! That seemed to work but now I am getting a new error Screenshot 2024-05-07 at 11 34 15 AM

Okay, concatenate error solved for my part. I am just going to assume you processed your RNA-seq data in Seurat.
I did this to fix the issue. It was damn near impossible to find the source of the error, but in the end it turned out to be an issue with how seurat exports h5ad files. For some reason it doesn't save the gene names in the right place, which means that the ACC_GEX.h5mu file you generate won't have the gene names stored correctly either.

import scanpy as sc

adata = sc.read("rna.h5ad")
new_adata = adata.raw.to_adata()
new_adata.var_names = adata.raw.var['_index'] #Or whatever your index is called
new_adata.var_names.name = None
new_adata.raw = new_adata
sc.pp.normalize_total(new_adata, target_sum=1e4)
sc.pp.log1p(new_adata)
new_adata.write("rna_new.h5ad")

And then just use the new file in your config script.

Hope this works for you too. If so, then your next error will probably be this:
image

If you do get this error, updating dask to 2024.4.1 seems to fix it even though it warns you that it is not compatible with scenicplus

Also side note. If my assumption that you worked with seurat is correct, you may also have to go back into R and make sure to delete scale.data, because:

Add assay data

assay.group <- source[['assays']][[assay]]
if (source$index()[[assay]]$slots[['scale.data']]) {
x.data <- 'scale.data'
raw.data <- 'data'
} else {
x.data <- 'data'
raw.data <- if (source$index()[[assay]]$slots[['counts']]) {
'counts'
} else {
NULL
}
}

The data being called "raw.data" is not actually raw
(Snippet from seurat-disk convert.R

from scenicplus.

LukasOussoren avatar LukasOussoren commented on August 29, 2024 1

Hmmm that sounds strange

I literally just did this:
pip install dask==2024.4.1

And ran it again and then it worked

from scenicplus.

SeppeDeWinter avatar SeppeDeWinter commented on August 29, 2024

Hi @orian116

This is an issue with your genome annotation file (this should contain a column named "Gene").

Can you show the head of genome_annotation.tsv

All the best,

Seppe

from scenicplus.

orian116 avatar orian116 commented on August 29, 2024

Hi @SeppeDeWinter
Here is the head and tail of my genome annotation file. It does have the 'Gene' column:
Screenshot 2024-05-02 at 12 31 15 PM
Screenshot 2024-05-02 at 12 31 38 PM

from scenicplus.

LukasOussoren avatar LukasOussoren commented on August 29, 2024

I have this exact same issue and also do have the "Gene" column in my gene_annotation.tsv

from scenicplus.

orian116 avatar orian116 commented on August 29, 2024

@SeppeDeWinter I have narrowed down the error a bit. It seems like in the gene_search_space.py function, the column names are present before running pr_gene_annotation = pr.PyRanges(gene_annotation.query("Gene in @scplus_genes").copy()) but not after. I will try converting to a pyranges object without this. What file is "@scplus_genes" referencing? Here's a snippet of the code.

Screenshot 2024-05-06 at 7 09 18 PM

from scenicplus.

LukasOussoren avatar LukasOussoren commented on August 29, 2024

Yea same here. No objects to concatenate... Stuck on the same thing.

from scenicplus.

Raghav1881 avatar Raghav1881 commented on August 29, 2024

Thank you! That seemed to work but now I am getting a new error Screenshot 2024-05-07 at 11 34 15 AM

Okay, concatenate error solved for my part. I am just going to assume you processed your RNA-seq data in Seurat. I did this to fix the issue. It was damn near impossible to find the source of the error, but in the end it turned out to be an issue with how seurat exports h5ad files. For some reason it doesn't save the gene names in the right place, which means that the ACC_GEX.h5mu file you generate won't have the gene names stored correctly either.

import scanpy as sc

adata = sc.read("rna.h5ad") new_adata = adata.raw.to_adata() new_adata.var_names = adata.raw.var['_index'] #Or whatever your index is called new_adata.var_names.name = None new_adata.raw = new_adata sc.pp.normalize_total(new_adata, target_sum=1e4) sc.pp.log1p(new_adata) new_adata.write("rna_new.h5ad")

And then just use the new file in your config script.

Hope this works for you too. If so, then your next error will probably be this: image

If you do get this error, updating dask to 2024.4.1 seems to fix it even though it warns you that it is not compatible with scenicplus

Also side note. If my assumption that you worked with seurat is correct, you may also have to go back into R and make sure to delete scale.data, because:

Add assay data

assay.group <- source[['assays']][[assay]] if (source$index()[[assay]]$slots[['scale.data']]) { x.data <- 'scale.data' raw.data <- 'data' } else { x.data <- 'data' raw.data <- if (source$index()[[assay]]$slots[['counts']]) { 'counts' } else { NULL } }

The data being called "raw.data" is not actually raw (Snippet from seurat-disk convert.R

How did you get to upgrade dask without upgrading pandas? When I run scenicplus after following your steps, I get an error for is_categorical being deprecated

from scenicplus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.