Code Monkey home page Code Monkey logo

deepconv-dti's People

Contributors

dlsrnsi avatar lig050129 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

deepconv-dti's Issues

Issue with Adam

While executing the DeepConvDTI.py script, I am getting the error
ImportError: cannot import name 'Adam' from 'keras.optimizers'

I found that this could be solved by changing to:
from tensorflow.keras.optimizers import Adam

But then other errors pop-up:
AttributeError: module 'tensorflow' has no attribute 'global_variables_initializer'

Any better way to resolve the issue other than downgrading to tensorflow=1.*.

Example Files

Hello. I was wondering if you had any example files of the input data to test if the program will run. Thank You!

Inquiry about SAE code

Hi,

I saw on your paper, you replicate the result of SAE MFDR. I am wondering if you have any plan to share the code to the community for comparison? Thank you!

Is drug_features a list of strings?

I'm new to tf so I may have misunderstood something in the code.

In DeepConvDTI.py, the line where we extract the drug features is as follows:

drug_feature = np.stack(dti_df[drug_vec].map(lambda fp: fp.split("\t")))
Which makes it a list of strings. I checked the inputs before calling self.model_t.predict() and the drug feature remains unchanged. Does this mean we are giving a list of strings to the drug's pipeline? Or does tf.keras.Model() modify it implicitly?

Error while running the toy_examples

Hello, I'm running DeepConv-DTI for toy_examples, but it was getting an error message in process of prediction model.

python predict_with_model.py ./model.model -n predict -i ./toy_examples/test_dataset/test_dti.csv -d ./toy_examples/test_dataset/test_compound.csv -t ./toy_examples/test_dataset/test_protein.csv -v Convolution -l 2500 -V morgan_fp_r2 -L 2048 -W -o test_result.csv

Traceback (most recent call last): 
 File "predict_with_model.py", line 118, in <module>
 d_splitted = np.array_split(prediction_dic["drug_feature"], N)
File "<__array_function__ internals>", line 6, in array_split
File "/Data1/program/anaconda3/lib/python3.7/site-packages/numpy/lib/shape_base.py", line 761, in array_split
raise ValueError('number sections must be larger than 0.')

When I showed the variable, "N" indicated zero.

N = int(prediction_dic["drug_feature"].shape[0]/50)

In the code, ###prediction_dic["drug_feature"].shape[0] is 20.

Please, any help!
Thank you

Question about how to preprocess about compound '0\t0\t0\t...'

Dear authors:

I want to know how the author trained the baseline about DeepConv-DTI mainly about how to preprocess the origin data, When I trained the code ar DeepConv-DTI, the memory was quite high.

Thank you very much for your kind consideration and I am looking forward to your reply.

Example Command Line Usage?

Hi,

thanks for the code and detailed instruction. For the command line usage, could you Kindly provide an example input line since the brackets in the usage column seem not clear to me? Thanks!

Data preparation

I want to predict with DeepDTI using my data, but the process of making input is difficult.
Could you upload the code that makes 3 input data?
If you upload it, it will be useful to many people.

model fit not using GPU

Hi,

I'm trying to run DeepConv-DTI on my data. The model starts training but it won't use the available GPUs. I don't see any parameter to force GPU usage. Am I missing something?

Thank you.

KeyError: 'morgan_fp'

Hi i was trying to run the example but ran into an error. Any advice would be greatly appreciated. Thank you.

/home/shared/DeepConv-DTI$ python DeepConvDTI.py ./toy_examples/training_dataset/training_dti.csv ./toy_examples/training_dataset/training_compound.csv ./toy_examples/training_dataset/training_protein.csv --predict -n predict -i ./toy_examples/test_dataset/test_dti.csv -d ./toy_examples/test_dataset/test_compound.csv -t ./toy_examples/test_dataset/test_protein.csv -c 512 128 -w 10 15 20 25 30 -p 128 -f 128 -r 0.0001 -n
Using TensorFlow backend.
model parameters summary

drug_layers : [512, 128]
protein_strides : [10, 15, 20, 25, 30]
protein_layers : [128]
fc_layers : [128]
learning_rate : 0.0001
decay : 0.0
activation : None
filters : 64
dropout : 0.2
prot_vec : Convolution
prot_len : 2500
drug_vec : morgan_fp
drug_len : 2048

WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/ops/resource_variable_ops.py:1630: calling BaseResourceVariable.init (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.
Instructions for updating:
If using Keras pass *_constraint arguments to layers.
2019-11-25 18:27:44.659002: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory
2019-11-25 18:27:44.659036: E tensorflow/stream_executor/cuda/cuda_driver.cc:318] failed call to cuInit: UNKNOWN ERROR (303)
2019-11-25 18:27:44.659056: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (ip-10-76-116-174): /proc/driver/nvidia/version does not exist
2019-11-25 18:27:44.659300: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 AVX512F FMA
2019-11-25 18:27:44.669291: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 3000000000 Hz
2019-11-25 18:27:44.672797: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x5463830 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2019-11-25 18:27:44.672822: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
WARNING:tensorflow:From DeepConvDTI.py:164: The name tf.global_variables_initializer is deprecated. Please use tf.compat.v1.global_variables_initializer instead.

Model: "model_1"


Layer (type) Output Shape Param # Connected to

input_2 (InputLayer) (None, 2500) 0


embedding_1 (Embedding) (None, 2500, 20) 520 input_2[0][0]


spatial_dropout1d_1 (SpatialDro (None, 2500, 20) 0 embedding_1[0][0]


input_1 (InputLayer) (None, 2048) 0


conv1d_1 (Conv1D) (None, 2500, 64) 12864 spatial_dropout1d_1[0][0]


conv1d_2 (Conv1D) (None, 2500, 64) 19264 spatial_dropout1d_1[0][0]


conv1d_3 (Conv1D) (None, 2500, 64) 25664 spatial_dropout1d_1[0][0]


conv1d_4 (Conv1D) (None, 2500, 64) 32064 spatial_dropout1d_1[0][0]


conv1d_5 (Conv1D) (None, 2500, 64) 38464 spatial_dropout1d_1[0][0]


dense_1 (Dense) (None, 512) 1049088 input_1[0][0]


batch_normalization_3 (BatchNor (None, 2500, 64) 256 conv1d_1[0][0]


batch_normalization_4 (BatchNor (None, 2500, 64) 256 conv1d_2[0][0]


batch_normalization_5 (BatchNor (None, 2500, 64) 256 conv1d_3[0][0]


batch_normalization_6 (BatchNor (None, 2500, 64) 256 conv1d_4[0][0]


batch_normalization_7 (BatchNor (None, 2500, 64) 256 conv1d_5[0][0]


batch_normalization_1 (BatchNor (None, 512) 2048 dense_1[0][0]


activation_3 (Activation) (None, 2500, 64) 0 batch_normalization_3[0][0]


activation_4 (Activation) (None, 2500, 64) 0 batch_normalization_4[0][0]


activation_5 (Activation) (None, 2500, 64) 0 batch_normalization_5[0][0]


activation_6 (Activation) (None, 2500, 64) 0 batch_normalization_6[0][0]


activation_7 (Activation) (None, 2500, 64) 0 batch_normalization_7[0][0]


activation_1 (Activation) (None, 512) 0 batch_normalization_1[0][0]


global_max_pooling1d_1 (GlobalM (None, 64) 0 activation_3[0][0]


global_max_pooling1d_2 (GlobalM (None, 64) 0 activation_4[0][0]


global_max_pooling1d_3 (GlobalM (None, 64) 0 activation_5[0][0]


global_max_pooling1d_4 (GlobalM (None, 64) 0 activation_6[0][0]


global_max_pooling1d_5 (GlobalM (None, 64) 0 activation_7[0][0]


dropout_1 (Dropout) (None, 512) 0 activation_1[0][0]


concatenate_1 (Concatenate) (None, 320) 0 global_max_pooling1d_1[0][0]
global_max_pooling1d_2[0][0]
global_max_pooling1d_3[0][0]
global_max_pooling1d_4[0][0]
global_max_pooling1d_5[0][0]


dense_2 (Dense) (None, 128) 65664 dropout_1[0][0]


dense_3 (Dense) (None, 128) 41088 concatenate_1[0][0]


batch_normalization_2 (BatchNor (None, 128) 512 dense_2[0][0]


batch_normalization_8 (BatchNor (None, 128) 512 dense_3[0][0]


activation_2 (Activation) (None, 128) 0 batch_normalization_2[0][0]


activation_8 (Activation) (None, 128) 0 batch_normalization_8[0][0]


dropout_2 (Dropout) (None, 128) 0 activation_2[0][0]


dropout_3 (Dropout) (None, 128) 0 activation_8[0][0]


concatenate_2 (Concatenate) (None, 256) 0 dropout_2[0][0]
dropout_3[0][0]


dense_4 (Dense) (None, 128) 32896 concatenate_2[0][0]


batch_normalization_9 (BatchNor (None, 128) 512 dense_4[0][0]


activation_9 (Activation) (None, 128) 0 batch_normalization_9[0][0]


dense_5 (Dense) (None, 1) 129 activation_9[0][0]


lambda_1 (Lambda) (None, 1) 0 dense_5[0][0]

Total params: 1,322,569
Trainable params: 1,320,137
Non-trainable params: 2,432


Parsing ./toy_examples/training_dataset/training_dti.csv , ./toy_examples/training_dataset/training_compound.csv, ./toy_examples/training_dataset/training_protein.csv with length 2500, type Convolution
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/pandas/core/indexes/base.py", line 2890, in get_loc
return self._engine.get_loc(key)
File "pandas/_libs/index.pyx", line 107, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 131, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1607, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1614, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'morgan_fp'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "DeepConvDTI.py", line 352, in
train_dic = parse_data(**train_dic)
File "DeepConvDTI.py", line 51, in parse_data
drug_feature = np.stack(dti_df[drug_vec].map(lambda fp: fp.split("\t")))
File "/usr/local/lib/python3.6/dist-packages/pandas/core/frame.py", line 2975, in getitem
indexer = self.columns.get_loc(key)
File "/usr/local/lib/python3.6/dist-packages/pandas/core/indexes/base.py", line 2892, in get_loc
return self._engine.get_loc(self._maybe_cast_indexer(key))
File "pandas/_libs/index.pyx", line 107, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 131, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1607, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1614, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'morgan_fp'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.