changeset 38:80a4b98121b6 draft

"planemo upload commit 22cd6b0fa88ce0ddc4052beab306f5ba10754f12"
author guerler
date Wed, 25 Nov 2020 17:38:24 +0000
parents 0be0af9e695d
children 172398348efd
files spring_cross.py spring_cross.xml spring_map.py spring_map.xml spring_roc.xml
diffstat 5 files changed, 17 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/spring_cross.py	Wed Nov 25 14:35:35 2020 +0000
+++ b/spring_cross.py	Wed Nov 25 17:38:24 2020 +0000
@@ -7,7 +7,9 @@
 
 
 def getId(line):
-    line = line.split()[0]
+    line = line.strip()
+    if len(line) != 6 or line[4:5] != "_":
+        raise Exception("Invalid list entry (`PDB_CHAIN`): %s." % line)
     return line[:4].upper() + line[4:6]
 
 
@@ -61,8 +63,8 @@
 if __name__ == "__main__":
     parser = argparse.ArgumentParser(description='List filtering.')
     parser.add_argument('-l', '--list', help='List of PDB chains [PDB_CHAIN]', required=True)
-    parser.add_argument('-i', '--index', help='PDB Database Index file (dbkit_index)', required=True)
-    parser.add_argument('-d', '--database', help='PDB Database files (dbkit)', required=True)
+    parser.add_argument('-i', '--index', help='PDB Database Index file (ffindex)', required=True)
+    parser.add_argument('-d', '--database', help='PDB Database files (ffdata)', required=True)
     parser.add_argument('-o', '--output', help='Output file', required=True)
     parser.add_argument('-t', '--temp', help='Temporary Directory', required=True)
     parser.add_argument('-g', '--log', help='Log File', required=True)
--- a/spring_cross.xml	Wed Nov 25 14:35:35 2020 +0000
+++ b/spring_cross.xml	Wed Nov 25 17:38:24 2020 +0000
@@ -4,9 +4,9 @@
         python3 '$__tool_directory__/spring_cross.py' -l '$list' -i '$index' -d '$database' -o '$output' -g '$log' -t temp
     ]]></command>
     <inputs>
-        <param format="tabular" name="list" type="data" label="PDB Chain Identifiers" help="List of PDB chains [PDB_CHAIN]."/>
-        <param format="tabular" name="index" type="data" label="PDB Database Index" help="Database Index file (ffindex)."/>
-        <param format="data" name="database" type="data" label="PDB Database" help="Database Data file (ffdata)."/>
+        <param format="tabular" name="list" type="data" label="PDB Chain Identifiers" help="List of PDB chains `PDB_CHAIN`."/>
+        <param format="ffindex" name="index" type="data" label="PDB Database Index" help="Database Index file."/>
+        <param format="ffdata" name="database" type="data" label="PDB Database" help="Database Data file."/>
     </inputs>
     <outputs>
         <data format="tabular" name="output" label="SPRING Cross Reference"/>
--- a/spring_map.py	Wed Nov 25 14:35:35 2020 +0000
+++ b/spring_map.py	Wed Nov 25 17:38:24 2020 +0000
@@ -8,6 +8,8 @@
 
 def getId(line):
     line = line.strip()
+    if len(line) != 6 or line[4:5] != "_":
+        raise Exception("Invalid list entry (`PDB_CHAIN`): %s." % line)
     return line[:4].upper() + line[4:6]
 
 
@@ -131,7 +133,7 @@
 
 if __name__ == "__main__":
     parser = argparse.ArgumentParser(description='Maps binding partners to template library')
-    parser.add_argument('-l', '--list', help='List of template entries [PDB_CHAIN]', required=True)
+    parser.add_argument('-l', '--list', help='List of template entries `PDB_CHAIN`', required=True)
     parser.add_argument('-i', '--index', help='PDB Database Index file (dbkit_index)', required=True)
     parser.add_argument('-d', '--database', help='PDB Database files (dbkit)', required=True)
     parser.add_argument('-c', '--cross', help='Cross reference (unmapped)', required=True)
--- a/spring_map.xml	Wed Nov 25 14:35:35 2020 +0000
+++ b/spring_map.xml	Wed Nov 25 17:38:24 2020 +0000
@@ -7,10 +7,10 @@
         python3 '$__tool_directory__/spring_map.py' -l '$list' -i '$index' -d '$database' -c '$cross' -o '$output' -g '$log' -t temp
     ]]></command>
     <inputs>
-        <param format="tabular" name="list" type="data" label="PDB Chain Identifiers" help="List of PDB chains [PDB_CHAIN]."/>
-        <param format="tabular" name="index" type="data" label="PDB Database Index" help="Database Index file (ffindex)."/>
-        <param format="data" name="database" type="data" label="PDB Database" help="Database Data file (ffdata)."/>
-        <param format="tabular" name="cross" type="data" label="Unmapped Cross Reference" help="SPRING PDB Cross Reference (unmapped)."/>
+        <param format="tabular" name="list" type="data" label="PDB Chain Identifiers" help="List of PDB chains `PDB_CHAIN`."/>
+        <param format="ffindex" name="index" type="data" label="PDB Database Index" help="Database Index file."/>
+        <param format="ffdata" name="database" type="data" label="PDB Database" help="Database Data file."/>
+        <param format="tabular" name="cross" type="data" label="Cross Reference (unmapped)" help="Unmapped SPRING PDB Cross Reference as produced by SPRING Cross tool."/>
     </inputs>
     <outputs>
         <data format="tabular" name="output" label="SPRING Map Cross Reference"/>
--- a/spring_roc.xml	Wed Nov 25 14:35:35 2020 +0000
+++ b/spring_roc.xml	Wed Nov 25 17:38:24 2020 +0000
@@ -83,8 +83,8 @@
     </outputs>
     <tests>
         <test>
-            <param format="tabular" name="input" value="roc/human_hv1h2.txt" />
-            <param format="tabular" name="database" value="roc/biogrid_fret.txt" />
+            <param name="input" value="roc/human_hv1h2.txt" />
+            <param name="database" value="roc/biogrid_fret.txt" />
             <output name="output" file="roc/human_hv1h2.png" />
         </test>
     </tests>