diff search_ppep.py @ 1:b76c75521d91 draft

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/mqppep commit 43e7a43b545c24b2dc33d039198551c032aa79be
author galaxyp
date Fri, 28 Oct 2022 18:26:42 +0000
parents 8dfd5d2b5903
children
line wrap: on
line diff
--- a/search_ppep.py	Mon Jul 11 19:22:54 2022 +0000
+++ b/search_ppep.py	Fri Oct 28 18:26:42 2022 +0000
@@ -237,7 +237,10 @@
 
     # Parse Command Line
     parser = argparse.ArgumentParser(
-        description="Phopsphoproteomic Enrichment phosphopeptide SwissProt search (in place in SQLite DB)."
+        description=" ".join([
+            "Phopsphoproteomic Enrichment",
+            "phosphopeptide SwissProt search (in place in SQLite DB)."
+        ])
     )
 
     # inputs:
@@ -249,7 +252,11 @@
         nargs=1,
         required=True,
         dest="phosphopeptides",
-        help="Phosphopeptide data for experimental results, generated by the Phopsphoproteomic Enrichment Localization Filter tool",
+        help=" ".join([
+            "Phosphopeptide data for experimental results,",
+            "generated by the Phopsphoproteomic Enrichment Localization",
+            "Filter tool"
+        ]),
     )
     parser.add_argument(
         "--uniprotkb",
@@ -257,7 +264,10 @@
         nargs=1,
         required=True,
         dest="uniprotkb",
-        help="UniProtKB/Swiss-Prot data, converted from FASTA format by the Phopsphoproteomic Enrichment Kinase Mapping tool",
+        help=" ".join([
+            "UniProtKB/Swiss-Prot data, converted from FASTA format by the",
+            "Phopsphoproteomic Enrichment Kinase Mapping tool"
+        ]),
     )
     parser.add_argument(
         "--schema",
@@ -310,7 +320,8 @@
     cur.executescript(DROP_TABLES_SQL)
 
     # if options.db_schema:
-    #     print("\nAfter dropping tables/views that are to be created, schema is:")
+    #     print("\nAfter dropping tables/views that are to be created,"
+    #         + schema is:")
     #     cur.execute("SELECT * FROM sqlite_schema")
     #     for row in cur.fetchall():
     #         if row[4] is not None:
@@ -403,7 +414,11 @@
         deppep_count = row[0]
 
     cur.execute(
-        "SELECT count(*) FROM (SELECT Sequence FROM UniProtKB GROUP BY Sequence)"
+        """
+        SELECT count(*) FROM (
+          SELECT Sequence FROM UniProtKB GROUP BY Sequence
+          )
+        """
     )
     for row in cur.fetchall():
         sequence_count = row[0]
@@ -431,9 +446,11 @@
     old_seq = ""
     for row in cur.fetchall():
         if duplicate_count == 0:
-            print(
-                "\nEach of the following sequences is associated with several accession IDs (which are listed in the first column) but the same gene ID (which is listed in the second column)."
-            )
+            print(" ".join([
+                "\nEach of the following sequences is associated with several",
+                "accession IDs (which are listed in the first column) but",
+                "the same gene ID (which is listed in the second column)."
+            ]))
         if row[2] != old_seq:
             old_seq = row[2]
             duplicate_count += 1
@@ -480,13 +497,19 @@
                     )
             else:
                 raise ValueError(
-                    "UniProtKB_id %s, but Sequence is None: Check whether SwissProt file is missing sequence for this ID"
-                    % (UniProtKB_id,)
+                    "UniProtKB_id %s, but Sequence is None: %s %s"
+                    % (
+                        UniProtKB_id,
+                        "Check whether SwissProt file is missing",
+                        "the sequence for this ID")
                 )
     ker.execute(
         """
-        SELECT   count(*) || ' accession-peptide-phosphopeptide combinations were found'
-        FROM     uniprotkb_pep_ppep_view
+        SELECT
+          count(*) ||
+            ' accession-peptide-phosphopeptide combinations were found'
+        FROM
+          uniprotkb_pep_ppep_view
         """
     )
     for row in ker.fetchall():
@@ -494,7 +517,9 @@
 
     ker.execute(
         """
-      SELECT   count(*) || ' accession matches were found', count(*) AS accession_count
+      SELECT
+        count(*) || ' accession matches were found',
+        count(*) AS accession_count
       FROM     (
         SELECT   accession
         FROM     uniprotkb_pep_ppep_view
@@ -520,7 +545,9 @@
 
     ker.execute(
         """
-      SELECT   count(*) || ' phosphopeptide matches were found', count(*) AS phosphopeptide_count
+      SELECT
+        count(*) || ' phosphopeptide matches were found',
+        count(*) AS phosphopeptide_count
       FROM     (
         SELECT   phosphopeptide
         FROM     uniprotkb_pep_ppep_view