negative count found after batch effects removal

Issue #58 new
clouds_drift created an issue

When I use BatchRemove in MAGeCKFlute version 1.4.2 , I get negative counts after batch effects removal. See as below for “RNF41_95”.

Then I input the batch corrected count table to MAGECKMLE, “mageck mle -k count.mat.file -d design.mat.file”. Error shows as below:
INFO @ Wed, 24 Jul 2019 14:58:26: Parameters: /export/data2/anaconda2/bin/mageck mle -k ../data/Beta_score/ubiquitin_count.txt -d ../data/Beta_score/ubiquitin_design.txt -n ../data/Beta_score/ubiquitin_beta/ubiquitin --threads 12
INFO @ Wed, 24 Jul 2019 14:58:27: Cannot parse design matrix as a string; try to parse it as a file name ...
INFO @ Wed, 24 Jul 2019 14:58:27: Design matrix:
INFO @ Wed, 24 Jul 2019 14:58:27: [[1. 0. 0. 0. 0. 0.]
INFO @ Wed, 24 Jul 2019 14:58:27: [1. 0. 0. 0. 0. 0.]
INFO @ Wed, 24 Jul 2019 14:58:27: [1. 0. 0. 0. 0. 0.]
INFO @ Wed, 24 Jul 2019 14:58:27: [1. 0. 0. 0. 0. 0.]
INFO @ Wed, 24 Jul 2019 14:58:27: [1. 0. 0. 0. 0. 0.]
INFO @ Wed, 24 Jul 2019 14:58:27: [1. 1. 0. 0. 0. 0.]
INFO @ Wed, 24 Jul 2019 14:58:27: [1. 0. 1. 0. 0. 0.]
INFO @ Wed, 24 Jul 2019 14:58:27: [1. 0. 0. 1. 0. 0.]
INFO @ Wed, 24 Jul 2019 14:58:27: [1. 0. 0. 0. 1. 0.]
INFO @ Wed, 24 Jul 2019 14:58:27: [1. 0. 0. 0. 0. 1.]]
INFO @ Wed, 24 Jul 2019 14:58:27: Beta labels:baseline,XuZ033_SF8628_t1,XuZ037_GBM22_t1,XuZ039_KNS42_t1,XuZ057_GBM43_t1,XuZ062_DIPG17_t1
INFO @ Wed, 24 Jul 2019 14:58:27: Included samples:XuZ032_SF8628_t0,XuZ036_GBM22_t0,XuZ038_KNS42_t0,XuZ056_GBM43_t0,XuZ034_DIPG17_t0,XuZ033_SF8628_t1,XuZ037_GBM22_t1,XuZ039_KNS42_t1,XuZ057_GBM43_t1,XuZ062_DIPG17_t1
INFO @ Wed, 24 Jul 2019 14:58:27: Loaded samples:XuZ032_SF8628_t0;XuZ036_GBM22_t0;XuZ038_KNS42_t0;XuZ056_GBM43_t0;XuZ034_DIPG17_t0;XuZ033_SF8628_t1;XuZ037_GBM22_t1;XuZ039_KNS42_t1;XuZ057_GBM43_t1;XuZ062_DIPG17_t1
INFO @ Wed, 24 Jul 2019 14:58:27: Sample index: 0;1;2;3;4;5;6;7;8;9
INFO @ Wed, 24 Jul 2019 14:58:27: Loaded 560 genes.
Traceback (most recent call last):
File "/export/data2/anaconda2/bin/mageck", line 66, in <module>
main();
File "/export/data2/anaconda2/bin/mageck", line 43, in main
args=crisprseq_parseargs();
File "/export/data2/anaconda2/lib/python2.7/site-packages/mageck/argsParser.py", line 244, in crisprseq_parseargs
mageckmle_main(parsedargs=args); # ignoring the script path, and the sub command
File "/export/data2/anaconda2/lib/python2.7/site-packages/mageck/mlemageck.py", line 88, in mageckmle_main
size_f=normalizeCounts(cttab_sel,method=args.norm_method,returnfactor=True,reversefactor=True,controlsgfile=args.control_sgrna)
File "/export/data2/anaconda2/lib/python2.7/site-packages/mageck/mageckCountNorm.py", line 124, in normalizeCounts
medianfactor=mageckcount_getmediannormfactor(ctable_nm)
File "/export/data2/anaconda2/lib/python2.7/site-packages/mageck/mageckCountNorm.py", line 52, in mageckcount_getmediannormfactor
meanval={k:math.exp( (sum( [ math.log(v2+1.0) for v2 in v])*1.0/n) ) for (k,v) in ctable.items() if sum(v)>0} # geometric mean
File "/export/data2/anaconda2/lib/python2.7/site-packages/mageck/mageckCountNorm.py", line 52, in <dictcomp>
meanval={k:math.exp( (sum( [ math.log(v2+1.0) for v2 in v])*1.0/n) ) for (k,v) in ctable.items() if sum(v)>0} # geometric mean
ValueError: math domain error
Error in file(file, "rt") : cannot open the connection
In addition: Warning messages:
1: In dir.create(outfile, recursive = T) :
'../data/Beta_score/ubiquitin_beta' already exists
2: In file(file, "rt") :
Show Traceback Rerun with Debug Error in file(file, "rt") : cannot open the connection

Raw count

Batch removal

design matrix

Comments (0)

  1. Log in to comment