JiekaiLab / scTE

MIT License
87 stars 27 forks source link

The input file unassigned_alignments.bam has no cell barcodes information #63

Open tinnenissen opened 1 year ago

tinnenissen commented 1 year ago

Hi there,

I am trying to analyse my single-cell RNA data with the pipeline. I am not very experienced with bioinformatics. I am using the unfiltered bam file and in this experiment I have multiplexed three different sampels using the totals antibodies (Cell Multiplexing with cellranger). This is what my file looks like:

samtools view unassigned_alignments.bam | head
VH00148:1:AAANHF5HV:1:1511:64623:44088 16 chr1 14520 1 90M * 0 0 CCGCCCCAGCTGTGTGGCCTCAAGCCAGCCTTCCGCTCCTTGAAGCTGGTCTCCACACAGTGCTGGTTCCGTCACCCCCTCCCAAGGAAG CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC-CCCCCCCCC;CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC NH:i:3 HI:i:1 AS:i:88 nM:i:0 RG:Z:Tinne-6:0:1:AAANHF5HV:1 RE:A:I xf:i:0 CR:Z:TGTTTCATCAGGAGGT CY:Z:CCCCCCCCCCCCCCCC UR:Z:TAGAGATCCCGG UY:Z:CCCCCCCCCCCC UB:Z:TAGAGATCCCGG

When running with default settings: scTE -i unassigned_alignments.bam -o out -x hg38.exclusive.idx --hdf5 True -CB CB -UMI UB

I got this error: ERROR : The input file unassigned_alignments.bam has no cell barcodes information, plese make sure the aligner have add the cell barcode key, or set CB to False

I realised that I do not have CB values - so I ran it again with 'CB False'. However, now I got a new error: ERROR : The input file unassigned_alignments.bam has no UB:Z information, plese make sure the aligner have add the UMI key, or set UMI to False

This I find confusing as I do have UB:Z values in my file? I am wondering if it the cell multiplexing that is making it tricky?

Hope you help this wet lab-based scientist out :-)

Best, Tinne

jphe commented 11 months ago

You need to pre-filter the bam file to remove the reads without CB:Z and UB:Z tags before run scTE.

or you can set the '-CB CR -UB UR' option with scTE, which will use the CR and UR tag in the bam file.

t1nnenissen commented 10 months ago

Hi there,

Thank you so much for your input! I tried running the program again but unfortunately ran into another issue. Do you have any idea as to why I am getting these error messages?

(base) k20047529@KCLFVFGP6K8Q05N scTE % scTE -i unassigned_alignments_proliferation.bam -o out -x hg38.exclusive.idx --hdf5 True -CB CR -UMI UR DEBUG : Creating converter from 7 to 5 DEBUG : Creating converter from 5 to 7 DEBUG : Creating converter from 7 to 5 DEBUG : Creating converter from 5 to 7 INFO : Parameter list: Sample = out Reference annotation index = hg38.exclusive.idx Minimum number of genes required = 200 Minimum number of counts required = None Number of threads = 1

INFO : Loading the genome annotation index... 2023-08-10 23:54:26 INFO : Loaded 'hg38.exclusive.idx' binary file with 5400305 items ['1', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '2', '20', '21', '22', '3', '4', '5', '6', '7', '8', '9', 'M', 'X', 'Y'] INFO : Finished loading the genome annotation index... 2023-08-10 23:55:10

INFO : Processing BAM/SAM files ...2023-08-10 23:55:10 INFO : Input SAM/BAM file appears to be valid CR UR good

INFO : Done BAM/SAM files processing ...2023-08-10 23:56:10

INFO : Splitting ...2023-08-10 23:56:10 INFO : Executing single thread path INFO : Finished processing sample files 2023-08-10 23:56:30

INFO : Fetching from the annotation index... 2023-08-10 23:56:30 INFO : Done fetching... 2023-08-10 23:56:30

INFO : Calculating expression... 2023-08-10 23:56:30 Traceback (most recent call last): File "/Users/k20047529/miniconda3/lib/python3.10/site-packages/scipy-1.11.0rc2-py3.10-macosx-11.1-arm64.egg/scipy/sparse/_base.py", line 371, in asformat return convert_method(copy=copy) File "/Users/k20047529/miniconda3/lib/python3.10/site-packages/scipy-1.11.0rc2-py3.10-macosx-11.1-arm64.egg/scipy/sparse/_coo.py", line 412, in tocsr data = np.empty_like(self.data, dtype=upcast(self.dtype)) File "/Users/k20047529/miniconda3/lib/python3.10/site-packages/scipy-1.11.0rc2-py3.10-macosx-11.1-arm64.egg/scipy/sparse/_sputils.py", line 53, in upcast raise TypeError(f'no supported conversion for types: {args!r}') TypeError: no supported conversion for types: (dtype('<U2'),)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/k20047529/miniconda3/bin/scTE", line 4, in import('pkg_resources').run_script('scTE==1.0', 'scTE') File "/Users/k20047529/miniconda3/lib/python3.10/site-packages/pkg_resources/init.py", line 672, in run_script self.require(requires)[0].run_script(script_name, ns) File "/Users/k20047529/miniconda3/lib/python3.10/site-packages/pkg_resources/init.py", line 1472, in run_script exec(code, namespace, namespace) File "/Users/k20047529/miniconda3/lib/python3.10/site-packages/scTE-1.0-py3.10.egg/EGG-INFO/scripts/scTE", line 169, in main() File "/Users/k20047529/miniconda3/lib/python3.10/site-packages/scTE-1.0-py3.10.egg/EGG-INFO/scripts/scTE", line 155, in main len_res, genenumber, filename = Countexpression(filename=args.out, allelement=allelement, genenumber=args.genenumber, cellnumber=args.cellnumber, hdf5=args.hdf5) File "/Users/k20047529/miniconda3/lib/python3.10/site-packages/scTE-1.0-py3.10.egg/scTE/base.py", line 506, in Countexpression adata.X = scipy.sparse.csr_matrix(adata.X) File "/Users/k20047529/miniconda3/lib/python3.10/site-packages/scipy-1.11.0rc2-py3.10-macosx-11.1-arm64.egg/scipy/sparse/_compressed.py", line 83, in init self._set_self(self.class( File "/Users/k20047529/miniconda3/lib/python3.10/site-packages/scipy-1.11.0rc2-py3.10-macosx-11.1-arm64.egg/scipy/sparse/_compressed.py", line 32, in init arg1 = arg1.asformat(self.format) File "/Users/k20047529/miniconda3/lib/python3.10/site-packages/scipy-1.11.0rc2-py3.10-macosx-11.1-arm64.egg/scipy/sparse/_base.py", line 373, in asformat return convert_method() File "/Users/k20047529/miniconda3/lib/python3.10/site-packages/scipy-1.11.0rc2-py3.10-macosx-11.1-arm64.egg/scipy/sparse/_coo.py", line 412, in tocsr data = np.empty_like(self.data, dtype=upcast(self.dtype)) File "/Users/k20047529/miniconda3/lib/python3.10/site-packages/scipy-1.11.0rc2-py3.10-macosx-11.1-arm64.egg/scipy/sparse/_sputils.py", line 53, in upcast raise TypeError(f'no supported conversion for types: {args!r}')