TobiTekath / DTUrtle

Perform differential transcript usage (DTU) analysis of bulk or single-cell RNA-seq data. See documentation at:
https://tobitekath.github.io/DTUrtle
GNU General Public License v3.0
17 stars 3 forks source link

combine to matrix error #20

Closed vasikara17 closed 3 months ago

vasikara17 commented 10 months ago

Describe the bug Hello, thanks a lot for the very useful tool. I am trying it for the first time and I am starting from the already analyzed Seurat object. I am importing and transforming the gtf file for the annotation with: tx2gene <- import_gtf(gtf_file = "Mus_musculus.GRCm39.109.gtf.gz") tx2gene$gene_name <- one_to_one_mapping(name = tx2gene$gene_name, id = tx2gene$gene_id) tx2gene$transcript_name <- one_to_one_mapping(name = tx2gene$transcript_name, id = tx2gene$transcript_id) tx2gene <- move_columns_to_front(df = tx2gene, columns = c("transcript_name", "gene_name"))

Then I run: cts<-seur_obj_sub@assays$RNA$counts

seur_obj_sub <- combine_to_matrix(tx_list = cts ,seurat_obj = seur_obj_sub, tx2gene = tx2gene) **since I have a Seurat object what is the tx_list input I schould use?

Error: Trying to infer cell extensions from Seurat object Error in combine_to_matrix(tx_list = cts, seurat_obj = seur_obj_sub, tx2gene = tx2gene) : Could not 1:1 map inferred seurat cellname extensions and tx file list. Either provide explicit cell extensions or try subsetting the seurat object, if you do not want to provide tx information for all samples.

Thank you in advance for yout time!

TobiTekath commented 7 months ago

Hi @vasikara17, thank you for using DTUrtle and reaching out.

Just so that I understand your issue correctly: You have an Seurat object containing the gene-level expression levels, correct? Then you can use DTUrtle to add the transcript-level expression data to the Seurat same object (as new assay dtutx by default). I assume you have created some transcript-level quantification data (e.g. with Alevin or Bustools) - then please import this data (preferably with import_counts() and then supply the output from this function as tx_list.

See here and here for an example.

Hope this clarifies your question.