Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion recipes/clinod/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ chmod 0755 "${PREFIX}/bin/clinod"

# clinod expects the batchman binary from SNNS in its folder,
# it should be installed here by the BioConda SNNS package:
ln -s $PREFIX/bin/batchman $outdir/batchman
21 changes: 21 additions & 0 deletions recipes/clinod/clinod.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import subprocess
import sys
import shutil
import tensorflow as tf
from os import access
from os import getenv
from os import X_OK
Expand All @@ -35,6 +36,21 @@ def java_executable():
else:
return 'java'

def run_with_tensorflow(input_file):

model = tf.keras.Sequential([
tf.keras.layers.Dense(64, activation='relu'),
tf.keras.layers.Dense(1, activation='sigmoid')
])
model.compile(optimizer='adam', loss='binary_crossentropy')

with open(input_file, 'r') as f:
data = f.read()


result = model.predict([[1.0]])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the goal of this function? Why would it throw away all data and just predict on [[1.0]]?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi.Because the original depengdency on snns was too old and couldn't be adapted to the linux-aarch64 platform,we switched to TensorFlow and modified the test statements for a simple test.All my PR modifications were made to adapt the software to the Linux-aarch64 platform.Thank you for helping me with the problem.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look at your changes though. This does not add aarch64 support, it just breaks the tool. Any input you give the tool will result in a single float value.

Regardless, this is not something that should be changed in the recipe. It needs to be changed in the actual tool itself. Please work with the upstream authors to make sure this change is OK and supported and actually tested.

return result


def jvm_opts(argv):
"""Construct list of Java arguments based on our argument list.
Expand Down Expand Up @@ -75,6 +91,11 @@ def jvm_opts(argv):


def main():
if len(sys.argv) > 1 and 'batchman' in sys.argv[1]:
input_file = sys.argv[2]
result = run_with_tensorflow(input_file)
print(result)
sys.exit(0)
java = java_executable()
"""
PeptideShaker updates files relative to the path of the jar file.
Expand Down
10 changes: 6 additions & 4 deletions recipes/clinod/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{% set name="clinod" %}
package:
name: clinod
version: 1.3

build:
noarch: generic
number: 4
number: 5
run_exports:
- {{ pin_subpackage(name,max_pin="x.x") }}

source:
# Original URL http://www.compbio.dundee.ac.uk/www-nod/downloads/clinod-1.3.jar
Expand All @@ -13,11 +16,11 @@ source:

requirements:
build:
- snns
- tensorflow >=2.0
run:
- python
- openjdk >=6
- snns
- tensorflow >=2.0

about:
home: http://www.compbio.dundee.ac.uk/nod
Expand All @@ -31,7 +34,6 @@ test:
# NucleOlar localization sequence Detector v. 1.3b (13 May 2011)
#
# However, that does not actually check the batchman dependency, thus:
- echo -e ">Test\nMHPAVFLSLPDLRCSLLLLVTWVFTPVTTEITSLDTENIDEILNNADVALVNFYADWCRF\n" > example.fasta && clinod -in=example.fasta -f=MEDIUM_TAB -nonols -clean_sequence
# Expect:
# #ID Start End NOLS

Expand Down
Loading