lihuamei / DeconPeaker

a deconvolution model to identify cell types based on chromatin accessibility in ATAC-Seq data of mixture samples
5 stars 6 forks source link

lm.fit error #2

Closed alexyfyf closed 2 years ago

alexyfyf commented 3 years ago
(/home/fyan0011/mx82/fyan0011/conda_env/DeconPeaker) [fyan0011@m3-login2 DeconPeaker]$ python deconPeaker.py deconvolution --lib-strategy=ATAC-Seq --mixture=/home/fyan0011/ls25_scratch/feng.yan/Immgen/diffbind2/output/mix_5k_chr.xls --pure=/home/fyan0011/ls25_scratch/feng.yan/Immgen/diffbind2/output/pure_mean_5k_chr.xls --format=TABLE --pvalue=FALSE --outdir=Lmo2
INFO  @ Tue, 16 Nov 2021 22:34:05: Deconvolving......
WARNING @ Tue, 16 Nov 2021 22:34:07: R[write to console]: Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
  0 (non-NA) cases

Traceback (most recent call last):
  File "deconPeaker.py", line 167, in <module>
    sys.exit(run())
  File "deconPeaker.py", line 160, in run
    stat = funcs[modes.index(ARGS.sub_parser)]()
  File "deconPeaker.py", line 118, in deconvolution
    results = deconvcells(
  File "/fs03/ls25/feng.yan/software/DeconPeaker/modules/deconv_mixed.py", line 122, in deconvcells
    deconv_results = deconv(mixsamples, sigprofile, method=method, pvalue=pvalue)
  File "/fs03/ls25/feng.yan/software/DeconPeaker/modules/build_models.py", line 87, in deconv
    for sn in mixsnames: deconv_results.append(SIMPLS(Y[sn], X, method, pvalue))
  File "/fs03/ls25/feng.yan/software/DeconPeaker/modules/build_models.py", line 38, in SIMPLS
    r('''
  File "/home/fyan0011/mx82/fyan0011/conda_env/DeconPeaker/lib/python3.8/site-packages/rpy2/robjects/__init__.py", line 438, in __call__
    res = self.eval(p)
  File "/home/fyan0011/mx82/fyan0011/conda_env/DeconPeaker/lib/python3.8/site-packages/rpy2/robjects/functions.py", line 198, in __call__
    return (super(SignatureTranslatedFunction, self)
  File "/home/fyan0011/mx82/fyan0011/conda_env/DeconPeaker/lib/python3.8/site-packages/rpy2/robjects/functions.py", line 125, in __call__
    res = super(Function, self).__call__(*new_args, **new_kwargs)
  File "/home/fyan0011/mx82/fyan0011/conda_env/DeconPeaker/lib/python3.8/site-packages/rpy2/rinterface_lib/conversion.py", line 45, in _
    cdata = function(*args, **kwargs)
  File "/home/fyan0011/mx82/fyan0011/conda_env/DeconPeaker/lib/python3.8/site-packages/rpy2/rinterface.py", line 680, in __call__
    raise embedded.RRuntimeError(_rinterface._geterrmessage())
rpy2.rinterface_lib.embedded.RRuntimeError: Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
  0 (non-NA) cases

Hi team, Thanks for developing this tool. However, I have encountered this error when running this. (the test data run ok).

My signature table looks like below:

>>> profile = pd.read_csv("/home/fyan0011/ls25_scratch/feng.yan/Immgen/diffbind2/output/pure_mean_5k_chr.xls", sep='\t', header=0)
>>> profile.head()
  chrom      start        end   B.Fem.Sp    B.Fo.Sp   B.FrE.BM  B.GC.CB.Sp  ...  Tgd.g2+d1.24a+.Th  Tgd.g2+d1.LN  Tgd.g2+d17.24a+.Th  Tgd.g2+d17.LN     Tgd.Sp  Treg.4.25hi.Sp  Treg.4.FP3+.Nrplo.Co
0  chr9   39847458   39848851  12.578028  12.578028  12.578028   12.578028  ...          12.578028     12.578028           12.578028      12.578028  12.578028       12.578028             12.578028
1  chr1  193200519  193202061   9.025825   9.025825   9.025825    9.025825  ...           9.025825      9.025825            9.025825       9.025825   9.025825        9.025825              9.025825
2  chr3  106083793  106085556   9.187085   9.187085   9.187085    9.187085  ...           9.187085      9.187085            9.187085       9.187085   9.187085        9.187085              9.187085
3  chr6   67715154   67716896   9.858280   9.858280   9.858280    9.858280  ...           9.858280      9.858280            9.858280       9.858280   9.858280        9.858280              9.858280
4  chr9   48408865   48410729   9.550301   9.550301   9.550301    9.550301  ...           9.550301      9.550301            9.550301       9.550301   9.550301        9.550301              9.550301

[5 rows x 96 columns]
>>> profile.dtypes
chrom                    object
start                     int64
end                       int64
B.Fem.Sp                float64
B.Fo.Sp                 float64
                         ...
Tgd.g2+d17.24a+.Th      float64
Tgd.g2+d17.LN           float64
Tgd.Sp                  float64
Treg.4.25hi.Sp          float64
Treg.4.FP3+.Nrplo.Co    float64
Length: 96, dtype: object

I would really appreciate it if you could help.

Cheers,

lihuamei commented 2 years ago

Hi Feng Yan, Thank you very much for following our work, this information may not be enough for me to discover the key cause straight away. However, I noticed that your reference expression profile has a "+" sign in the column name, please change it to an underscore or a dot and try again. Variables with "+" in their names are illegal when performing regression solving in R. If it still fails, please feel free to let me know.

Regards Huamei Li

alexyfyf commented 2 years ago

Thanks so much. The problem is solved now!