raghavagps / transfacpred

An ensemble method for predicting transcription factor in protein sequences
http://webs.iiitd.edu.in/raghava/transfacpred
GNU General Public License v3.0
4 stars 1 forks source link

Error running transfacpred #1

Closed Rohit-Satyam closed 1 year ago

Rohit-Satyam commented 1 year ago

Hi I was trying to run the transfacpred and I get the following error:

transfacpred -i subset_1455.fasta
 -o transfacpred_res -d 2

############################################################################################
# TransFacPred is developed for predicting Transcription Factors using protein sequence    #
# information, developed by Prof G. P. S. Raghava group.                                   #
# Please cite: https://webs.iiitd.edu.in/raghava/transfacpred/                             #
############################################################################################

Summary of Parameters:
Input File:  subset_1455.fasta ; Threshold:  -0.38
Output File:  transfacpred_res ; Display:  2

======Initiating Prediction Using Hybrid Model. Please Wait.......================

Traceback (most recent call last):
  File "/home/subudhak/miniconda3/envs/deeploc/bin/transfacpred", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/subudhak/miniconda3/envs/deeploc/lib/python3.11/site-packages/transfacpred/python_scripts/transfacpred.py", line 232, in main
    df_4b = pred(df_3b)
            ^^^^^^^^^^^
  File "/home/subudhak/miniconda3/envs/deeploc/lib/python3.11/site-packages/transfacpred/python_scripts/transfacpred.py", line 108, in pred
    clf = pickle.load(model_file)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "sklearn/tree/_tree.pyx", line 728, in sklearn.tree._tree.Tree.__setstate__
  File "sklearn/tree/_tree.pyx", line 1432, in sklearn.tree._tree._check_node_ndarray
ValueError: node array from the pickle has an incompatible dtype:
- expected: {'names': ['left_child', 'right_child', 'feature', 'threshold', 'impurity', 'n_node_samples', 'weighted_n_node_samples', 'missing_go_to_left'], 'formats': ['<i8', '<i8', '<i8', '<f8', '<f8', '<i8', '<f8', 'u1'], 'offsets': [0, 8, 16, 24, 32, 40, 48, 56], 'itemsize': 64}
- got     : [('left_child', '<i8'), ('right_child', '<i8'), ('feature', '<i8'), ('threshold', '<f8'), ('impurity', '<f8'), ('n_node_samples', '<i8'), ('weighted_n_node_samples', '<f8')]

Can you tell what's wrong?

Rohit-Satyam commented 1 year ago

Meanwhile I tried using a subset of sequences of my interest using your online server. I wish to understand how to choose the probability threshold parameter for Hybrid method. It ranges from -0.38 to 1.5 which is hard for me to understand since I would expect probability threshold to range from 0 to 1. I tried understanding why the lower bound was kept as -0.38 by reading your paper, but I couldn't find any mention about this threshold. Could you please mention this in the help section at least ?

image

Rohit-Satyam commented 1 year ago

Tried using DeepTFactor but it can only process 15 files at a time. When using a multifasta file containing 16 or more sequences it says:

Traceback (most recent call last):
  File "tf_running.py", line 56, in <module>
    output = model(x.to(device))
  File "/home/subudhak/miniconda3/envs/deeptfactor/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/subudhak/Documents/zena_scrnaseq_singleR/extra_analysis_June2023/hypothetical_proteins/tools/deeptfactor/deeptfactor/models.py", line 29, in forward
    x = self.cnn0(x)
  File "/home/subudhak/miniconda3/envs/deeptfactor/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/subudhak/Documents/zena_scrnaseq_singleR/extra_analysis_June2023/hypothetical_proteins/tools/deeptfactor/deeptfactor/models.py", line 94, in forward
    xs.append(layer(x))
  File "/home/subudhak/miniconda3/envs/deeptfactor/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/subudhak/miniconda3/envs/deeptfactor/lib/python3.6/site-packages/torch/nn/modules/container.py", line 92, in forward
    input = module(input)
  File "/home/subudhak/miniconda3/envs/deeptfactor/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/subudhak/miniconda3/envs/deeptfactor/lib/python3.6/site-packages/torch/nn/modules/container.py", line 92, in forward
    input = module(input)
  File "/home/subudhak/miniconda3/envs/deeptfactor/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/subudhak/miniconda3/envs/deeptfactor/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 343, in forward
    return self.conv2d_forward(input, self.weight)
  File "/home/subudhak/miniconda3/envs/deeptfactor/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 340, in conv2d_forward
    self.padding, self.dilation, self.groups)
RuntimeError: NNPACK SpatialConvolution_updateOutput failed
Rohit-Satyam commented 1 year ago

Here are the installation steps that I followed:

mamba create -n newtf pip
  Updating specs:

   - pip

  Package               Version  Build               Channel                    Size
──────────────────────────────────────────────────────────────────────────────────────
  Install:
──────────────────────────────────────────────────────────────────────────────────────

  + _libgcc_mutex           0.1  conda_forge         conda-forge/linux-64     Cached
  + _openmp_mutex           4.5  2_gnu               conda-forge/linux-64     Cached
  + bzip2                 1.0.8  h7f98852_4          conda-forge/linux-64     Cached
  + ca-certificates   2023.7.22  hbcca054_0          conda-forge/linux-64     Cached
  + ld_impl_linux-64       2.40  h41732ed_0          conda-forge/linux-64     Cached
  + libexpat              2.5.0  hcb278e6_1          conda-forge/linux-64     Cached
  + libffi                3.4.2  h7f98852_5          conda-forge/linux-64     Cached
  + libgcc-ng            13.2.0  h807b86a_2          conda-forge/linux-64     Cached
  + libgomp              13.2.0  h807b86a_2          conda-forge/linux-64     Cached
  + libnsl                2.0.0  hd590300_1          conda-forge/linux-64     Cached
  + libsqlite            3.43.0  h2797004_0          conda-forge/linux-64     Cached
  + libuuid              2.38.1  h0b41bf4_0          conda-forge/linux-64     Cached
  + libzlib              1.2.13  hd590300_5          conda-forge/linux-64     Cached
  + ncurses                 6.4  hcb278e6_0          conda-forge/linux-64     Cached
  + openssl               3.1.3  hd590300_0          conda-forge/linux-64     Cached
  + pip                  23.2.1  pyhd8ed1ab_0        conda-forge/noarch       Cached
  + python               3.12.0  hab00c5b_0_cpython  conda-forge/linux-64       32MB
  + readline                8.2  h8228510_1          conda-forge/linux-64     Cached
  + setuptools           68.2.2  pyhd8ed1ab_0        conda-forge/noarch       Cached
  + tk                   8.6.13  h2797004_0          conda-forge/linux-64     Cached
  + tzdata                2023c  h71feb2d_0          conda-forge/noarch       Cached
  + wheel                0.41.2  pyhd8ed1ab_0        conda-forge/noarch       Cached
  + xz                    5.2.6  h166bdaf_0          conda-forge/linux-64     Cached

pip install transfacpred
pip install requests

The help section refuses to appear when I type transfacpred -h. Besides, I have scikit_learn-1.3.1 and python 3.12.0

sumeetpatiyal commented 1 year ago

I have made the changes in the main code and envfile. Please make sure the blastp is downloaded and installed in your system before running the standalone.

Rohit-Satyam commented 7 months ago

Downgrading the scikitlearn to using pip install scikit-learn==1.2.2 worked. But yes you need to fix pip version of transfacpred as well.