This is a test version of Biostars. For the public version, visit https://www.biostars.org.
MaGECK MLE Error: TypeError: unsupported operand type(s) for +: 'float' and 'list'

Hi there,

I am trying and failing to get MaGECK MLE to work (using windows subsystem for linux). i am using version 0.5.9.5

I keep getting errors which I think are due to incorrect parsing of the MLE command through my count table. This is what I'm trying to run:

#!/bin/bash 
mageck mle \
--count-table results/count/crispr1.count.txt \
--design-matrix matrix.txt \
--norm-method control \
--control-sgrna brunello_non_targeting_controls.txt

I get the following error:

INFO @ Tue, 27 Jan 2026 16:11:30: Included samples:bulk1,bulk2,low1,low2,high1,high2 INFO @ Tue, 27 Jan 2026 16:11:30: Loaded samples:bulk1;bulk2;low1;low2;high1;high2 INFO @ Tue, 27 Jan 2026 16:11:30: Sample index: 0;1;2;3;4;5 Error loading line 13 Error loading line 13 Error loading line 20 Error loading line 20 [...] INFO @ Tue, 27 Jan 2026 16:14:34: Loaded 20114 genes. INFO @ Tue, 27 Jan 2026 16:14:34: 0 out of 1000 control sgRNAs are found in count table. ERROR @ Tue, 27 Jan 2026 16:14:34: Not enough control sgRNAs found in the count table. Please check your control sgRNA list.

I have checked and the sgRNA IDs match my count table - i have also been unsuccessful using the --control-gene flag instead

I also cant get it to run without CNV normalisation or sgRNA normalisation. When i run without both it says:

INFO @ Tue, 27 Jan 2026 16:16:09: Loaded 20114 genes. Traceback (most recent call last): File "/home/jamie/miniconda3/envs/mageck36/bin/mageck", line 66, in

<module> main(); File "/home/jamie/miniconda3/envs/mageck36/bin/mageck", line 43, in main args=crisprseq_parseargs(); File "/home/jamie/miniconda3/envs/mageck36/lib/python3.6/site-packages/mageck/argsParser.py", line 258, in crisprseq_parseargs mageckmle_main(parsedargs=args); # ignoring the script path, and the sub command File "/home/jamie/miniconda3/envs/mageck36/lib/python3.6/site-packages/mageck/mlemageck.py", line 98, in mageckmle_main size_f=normalizeCounts(cttab_sel,method=args.norm_method,returnfactor=True,reversefactor=True,controlsgfile=args.control_sgrna) File "/home/jamie/miniconda3/envs/mageck36/lib/python3.6/site-packages/mageck/mageckCountNorm.py", line 119, in normalizeCounts samplefactor=mageckcount_gettotalnormfactor(ctable_nm) File "/home/jamie/miniconda3/envs/mageck36/lib/python3.6/site-packages/mageck/mageckCountNorm.py", line 24, in mageckcount_gettotalnormfactor sumsample=[sumsample[i]+v[i] for i in range(n)] File "/home/jamie/miniconda3/envs/mageck36/lib/python3.6/site-packages/mageck/mageckCountNorm.py", line 24, in <listcomp> sumsample=[sumsample[i]+v[i] for i in range(n)] TypeError: unsupported operand type(s) for +: 'float' and 'list'

I cant help but think the last line here must be improtant?

the count seemed to run fine which i ran with:

mageck count \   
-l brunello_library_mageck.csv \   
-n results/crispr1 \   
--sample-label bulk1,bulk2,low1,low2,high1,high2 \
--fastq FASTQ/BulkRep1_S5_R1_001.fastq.gz FASTQ/BulkRep2_S6_R1_001.fastq.gz \ FASTQ/LowRep1_S1_R1_001.fastq.gz FASTQ/LowRep2_S3_R1_001.fastq.gz \ FASTQ/HighRep1_S2_R1_001.fastq.gz FASTQ/HighRep2_S4_R1_001.fastq.gz

It generated a seemingly normal count table:

 head -n 5 results/count/crispr1.count.txt

sgRNA   Gene    bulk1   bulk2   low1    low2    high1   high2
NGFRAP1.1       NGFRAP1 854     813     675     832     1138    782
TMEM40.3        TMEM40  677     470     274     480     509     410
SOD3.4  SOD3    707     733     628     1364    674     676 
MYBPC2.4  MYBPC2  279     241     409     390     356     410

I have also checked and the sgRNAs are present in the counts. they do have space in the title though (e.g., Non-Targeting Control.682).

Any help would be massively appreciated - I'm completely stumped!

mageck python cripsr

0 answers

No answers yet.

Log in to answer this question.