Kallisto generate empty matrix for spliced and unspliced annotation RNA velocity
dear all, I am running Kallisto to get spliced and unspliced attributes for RNA-velocity. I succeeded in the past following the tutorial (https://colab.research.google.com/github/pachterlab/kallistobustools/blob/master/notebooks/kb_velocity.ipynb) but now using the same script and same FASTQ files I get a NoneType matrix. Can you help me fix this?
I run the following command in Google colab:
!pip install kb-python
i am using the linnarson annotation
%%time !kb ref -d linnarsson -i index.idx -g t2g.txt -c1 spliced_t2c.txt -c2 unspliced_t2c.txt
!kb count --h5ad -i index.idx -g t2g.txt -x 10xv3 -o Opto_SHH_d7_kallisto
-c1 spliced_t2c.txt -c2 unspliced_t2c.txt --lamanno --filter bustools -t 2
Opto_SHH_d7_S1_L001_R1_001.fastq.gz
Opto_SHH_d7_S1_L001_R2_001.fastq.gz
Opto_SHH_d7_S1_L002_R1_001.fastq.gz
Opto_SHH_d7_S1_L002_R2_001.fastq.gz
[2020-12-05 16:13:43,385] WARNING The --lamanno and --nucleus flags are deprecated. These options will be removed in a future release. Please use --workflow lamanno or --workflow nucleus instead.
[2020-12-05 16:13:43,389] INFO Using index index.idx to generate BUS file to Opto_SHH_d7_kallisto from
[2020-12-05 16:13:43,389] INFO Opto_SHH_d7_S1_L001_R1_001.fastq.gz
[2020-12-05 16:13:43,389] INFO Opto_SHH_d7_S1_L001_R2_001.fastq.gz
[2020-12-05 16:13:43,389] INFO Opto_SHH_d7_S1_L002_R1_001.fastq.gz
[2020-12-05 16:13:43,389] INFO Opto_SHH_d7_S1_L002_R2_001.fastq.gz
[2020-12-05 17:49:35,750] INFO Sorting BUS file Opto_SHH_d7_kallisto/output.bus to Opto_SHH_d7_kallisto/tmp/output.s.bus
[2020-12-05 17:57:25,267] INFO Whitelist not provided
[2020-12-05 17:57:25,274] INFO Copying pre-packaged 10XV3 whitelist to Opto_SHH_d7_kallisto
[2020-12-05 17:57:26,286] INFO Inspecting BUS file Opto_SHH_d7_kallisto/tmp/output.s.bus
[2020-12-05 17:59:47,542] INFO Correcting BUS records in Opto_SHH_d7_kallisto/tmp/output.s.bus to Opto_SHH_d7_kallisto/tmp/output.s.c.bus with whitelist Opto_SHH_d7_kallisto/10xv3_whitelist.txt
[2020-12-05 18:04:13,467] INFO Sorting BUS file Opto_SHH_d7_kallisto/tmp/output.s.c.bus to Opto_SHH_d7_kallisto/output.unfiltered.bus
[2020-12-05 18:11:50,514] INFO Capturing records from BUS file Opto_SHH_d7_kallisto/output.unfiltered.bus to Opto_SHH_d7_kallisto/tmp/spliced.bus with capture list unspliced_t2c.txt
[2020-12-05 18:15:43,642] INFO Sorting BUS file Opto_SHH_d7_kallisto/tmp/spliced.bus to Opto_SHH_d7_kallisto/spliced.unfiltered.bus
[2020-12-05 18:20:19,615] INFO Inspecting BUS file Opto_SHH_d7_kallisto/spliced.unfiltered.bus
[2020-12-05 18:21:52,829] INFO Generating count matrix Opto_SHH_d7_kallisto/counts_unfiltered/spliced from BUS file Opto_SHH_d7_kallisto/spliced.unfiltered.bus
[2020-12-05 18:24:01,864] INFO Capturing records from BUS file Opto_SHH_d7_kallisto/output.unfiltered.bus to Opto_SHH_d7_kallisto/tmp/unspliced.bus with capture list spliced_t2c.txt
[2020-12-05 18:26:47,286] INFO Sorting BUS file Opto_SHH_d7_kallisto/tmp/unspliced.bus to Opto_SHH_d7_kallisto/unspliced.unfiltered.bus
[2020-12-05 18:27:47,140] INFO Inspecting BUS file Opto_SHH_d7_kallisto/unspliced.unfiltered.bus
[2020-12-05 18:28:32,334] INFO Generating count matrix Opto_SHH_d7_kallisto/counts_unfiltered/unspliced from BUS file Opto_SHH_d7_kallisto/unspliced.unfiltered.bus
[2020-12-05 18:29:53,743] INFO Reading matrix Opto_SHH_d7_kallisto/counts_unfiltered/spliced.mtx
[2020-12-05 18:30:53,191] INFO Reading matrix Opto_SHH_d7_kallisto/counts_unfiltered/unspliced.mtx
[2020-12-05 18:31:29,000] INFO Combining matrices
[2020-12-05 18:31:30,591] INFO Writing matrices to h5ad Opto_SHH_d7_kallisto/counts_unfiltered/adata.h5ad
[2020-12-05 18:31:32,864] INFO Filtering with bustools
[2020-12-05 18:31:32,864] INFO Generating whitelist Opto_SHH_d7_kallisto/filter_barcodes.txt from BUS file Opto_SHH_d7_kallisto/output.unfiltered.bus
[2020-12-05 18:33:32,599] INFO Correcting BUS records in Opto_SHH_d7_kallisto/output.unfiltered.bus to Opto_SHH_d7_kallisto/tmp/output.unfiltered.c.bus with whitelist Opto_SHH_d7_kallisto/filter_barcodes.txt
[2020-12-05 18:37:57,643] INFO Sorting BUS file Opto_SHH_d7_kallisto/tmp/output.unfiltered.c.bus to Opto_SHH_d7_kallisto/output.filtered.bus
[2020-12-05 18:44:58,589] INFO Capturing records from BUS file Opto_SHH_d7_kallisto/output.filtered.bus to Opto_SHH_d7_kallisto/tmp/spliced.bus with capture list unspliced_t2c.txt
[2020-12-05 18:49:52,429] INFO Sorting BUS file Opto_SHH_d7_kallisto/tmp/spliced.bus to Opto_SHH_d7_kallisto/spliced.filtered.bus
[2020-12-05 18:54:07,183] INFO Generating count matrix Opto_SHH_d7_kallisto/counts_filtered/spliced from BUS file Opto_SHH_d7_kallisto/spliced.filtered.bus
[2020-12-05 18:55:56,071] INFO Capturing records from BUS file Opto_SHH_d7_kallisto/output.filtered.bus to Opto_SHH_d7_kallisto/tmp/unspliced.bus with capture list spliced_t2c.txt
[2020-12-05 18:58:39,393] INFO Sorting BUS file Opto_SHH_d7_kallisto/tmp/unspliced.bus to Opto_SHH_d7_kallisto/unspliced.filtered.bus
[2020-12-05 18:59:37,947] INFO Generating count matrix Opto_SHH_d7_kallisto/counts_filtered/unspliced from BUS file Opto_SHH_d7_kallisto/unspliced.filtered.bus
[2020-12-05 19:00:55,275] INFO Reading matrix Opto_SHH_d7_kallisto/counts_filtered/spliced.mtx
[2020-12-05 19:01:39,062] INFO Reading matrix Opto_SHH_d7_kallisto/counts_filtered/unspliced.mtx
[2020-12-05 19:02:09,320] INFO Combining matrices
[2020-12-05 19:02:09,835] INFO Writing matrices to h5ad Opto_SHH_d7_kallisto/counts_filtered/adata.h5ad
CPU times: user 19.7 s, sys: 3.02 s, total: 22.7 s
Wall time: 2h 48min 31s
i get an object that has the correct number of genes and the expected number of cells
adata AnnData object with n_obs × n_vars = 9650 × 58367 layers: 'spliced', 'unspliced'
sc.pl.highest_expr_genes(adata, n_top=20, )
AttributeError Traceback (most recent call last)
1 frames /usr/local/lib/python3.6/dist-packages/scanpy/preprocessing/_normalization.py in normalize_total(adata, target_sum, exclude_highly_expressed, max_fraction, key_added, layers, layer_norm, inplace) 156 # counts per cell for subset, if max_fraction!=1 157 X = adata.X if gene_subset is None else adata[:, gene_subset].X --> 158 counts_per_cell = X.sum(1) 159 # get rid of adata view 160 counts_per_cell = np.ravel(counts_per_cell).copy()
AttributeError: 'NoneType' object has no attribute 'sum'
I get this error and seems that the matrix is an empty NoneType
Can you help me fix this? I run in the past the same script and FASTQ getting a correct object that now I want to integrate with a replica. This was supposed to be a positive control but it is not working as well as my new samples.
Thank you in advance for your help and support Best Ric