annotate application.py @ 0:ddcab0f11473 draft

"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
author galaxyp
date Thu, 15 Oct 2020 07:45:17 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
1 import argparse
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
2
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
3 import psmfragmentation.psmfragmentation as pf
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
4
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
5
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
6 if __name__ == "__main__":
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
7 parser = argparse.ArgumentParser(description="Run PSM Validator")
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
8 parser.add_argument(
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
9 "-d",
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
10 "--dbname",
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
11 help="Path to mzsqlite db",
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
12 )
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
13 parser.add_argument(
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
14 "-p",
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
15 "--peptides",
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
16 help="Path to peptide sequence file",
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
17 )
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
18 parser.add_argument(
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
19 "-n",
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
20 "--neutral",
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
21 action="store_true",
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
22 default=False,
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
23 help="Calculate netutral loss",
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
24 )
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
25 parser.add_argument(
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
26 "-i",
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
27 "--internal",
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
28 action="store_true",
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
29 default=False,
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
30 help="Calculate internals",
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
31 )
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
32 parser.add_argument(
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
33 "-e", "--epsilon", type=float
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
34 )
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
35 parser.add_argument(
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
36 "-b",
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
37 "--b_run",
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
38 type=int,
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
39 default=2,
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
40 help="Number of consecutive b-ions"
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
41 )
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
42 parser.add_argument(
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
43 "-y",
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
44 "--y_run",
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
45 type=int,
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
46 default=2,
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
47 help="Number of consecutive y-ions"
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
48 )
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
49
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
50 parser.add_argument(
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
51 "-t",
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
52 "--test",
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
53 action="store_true",
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
54 default=False
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
55 )
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
56
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
57 args = parser.parse_args()
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
58
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
59 itypes = ['b', 'y']
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
60 if args.neutral:
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
61 itypes.extend(['b-H2O', 'b-NH3', 'y-H2O', 'y-NH3'])
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
62
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
63 if args.internal:
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
64 itypes.append('M')
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
65
ddcab0f11473 "planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/psm_validation commit 896365c9d6b9fcdcbb9c36e0c81db78c8a4e8dab"
galaxyp
parents:
diff changeset
66 pf.score_psms(args.dbname, args.peptides, ion_types=itypes, epsilon=args.epsilon, maxcharge=1, b_run=args.b_run, y_run=args.y_run, a_test=args.test)