annotate profmt.py @ 6:100cff4db790 draft default tip

planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit ae4270ce6b1052d7eaac8e1e816263ad17f3db51-dirty
author jjohnson
date Tue, 10 Apr 2018 11:58:31 -0400
parents 492f98d89e26
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
1 #!/usr/bin/env python
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
2 """
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
3 #
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
4 #------------------------------------------------------------------------------
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
5 # University of Minnesota
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
6 # Copyright 2016, Regents of the University of Minnesota
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
7 #------------------------------------------------------------------------------
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
8 # Author:
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
9 #
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
10 # James E Johnson
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
11 #
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
12 #------------------------------------------------------------------------------
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
13 """
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
14
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
15 import sys,re
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
16 from operator import itemgetter, attrgetter
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
17 from twobitreader import TwoBitFile
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
18
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
19 """
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
20 1 QNAME string spectrum name *
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
21 2 FLAG int bitwise FLAG (see further) *
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
22 3 RNAME string reference sequence name *
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
23 4 POS int 1-based lefmost mapping position 0
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
24 5 MAPQ int unused in proBAM 255
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
25 6 CIGAR string extended cigar string (see further) *
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
26 7 RNEXT string unused in proBAM *
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
27 8 PNEXT int unused in proBAM 0
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
28 9 TLEN int unused in proBAM 0
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
29 10 SEQ string coding sequence *
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
30 11 QUAL string unused in proBAM *
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
31 """
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
32 """
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
33 bit description FLAG
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
34 0x00 peptide maps to the forward strand 0
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
35 0x10 peptide maps to the reverse strand 16
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
36 0x100 peptide is not the rank=1 peptide for the spectrum 256
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
37 0x400 decoy peptide 1024
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
38 0x4 unmapped peptide 4
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
39 """
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
40
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
41 """
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
42 tag type description
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
43 --- ---- -----------
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
44 NH int number of genomic locations to which the peptide sequence maps
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
45 XL int number of peptides to which the spectrum maps
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
46 XP string peptide sequence
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
47 XR string reference peptide sequence
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
48 XS float PSM score
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
49 XQ float PSM q-value PSM FDR (i.e. q-value or 1-PEP).
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
50 XC int peptide charge
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
51 XA int Whether the peptide is annotated 0:yes; 1:parially unknown; 2:totally unknown;
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
52 XM string Modification(s): semicolon seperated list of position,modName
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
53 XN int number of missed cleavages
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
54 XT int tryptic state: 0:non-tryptic 1:semi-tryptic 2:tryptic
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
55 XG string peptide type: N:normal peptide V:variant peptide J:novel junction peptide D:decoy peptide U:unmappped
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
56 XB string Semicolon-separated list of mass in the following format: massdiff; experimental mass; calculated mass massdiff can be calculated by experimental mass - calculated mass. If any number is unavailable, the value should be left blank (such as 0.01;;).
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
57 XE int
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
58 XF string Reading frame of the peptide (0, 1, 2) (See section 4.4.6).
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
59 XG char Peptide type (see Table 6 and Figure 1)
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
60 XI float Peptide intensity
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
61 XO string This field indicates the uniqueness of the peptide mapping
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
62 XU string
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
63
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
64
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
65 NH i NH:i:1
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
66 XO Z XO:Z:unique
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
67 XL i XL:i:1
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
68 XP Z XP:Z:ATLELTHNWGTEDDATQSYHNGNSDPR
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
69 YP Z YP:Z:ENSP00000362463_rs4746:E111A
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
70 XF Z XF:Z:1,1
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
71 XI f XI:f:*
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
72 XB f XB:f:0.70082940064
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
73 XR Z XR:Z:ATLELTHNWGTEDDETQSYHNGNSDPR
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
74 YB Z YB:Z:RK
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
75 YA Z YA:Z:GF
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
76 XS f XS:f:73.1426
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
77 XQ f XQ:f:0
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
78 XC i XC:i:3
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
79 XA i XA:i:0
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
80 XM Z XM:Z:*
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
81 XN i XN:i:0
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
82 XT i XT:i:2
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
83 XE i XE:i:1
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
84 XG Z XG:Z:V
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
85 XU Z klc_070108x_PH_P7_COLO_205_D13.pepXML
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
86
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
87 NH:i:1
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
88 XO:Z:unique
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
89 XL:i:1
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
90 XP:Z:ATLELTHNWGTEDDATQSYHNGNSDPR
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
91 YP:Z:ENSP00000362463_rs4746:E111A
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
92 XF:Z:1,1
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
93 XI:f:*
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
94 XB:f:0.70082940064
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
95 XR:Z:ATLELTHNWGTEDDETQSYHNGNSDPR
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
96 YB:Z:RK
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
97 YA:Z:GF
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
98 XS:f:73.1426
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
99 XQ:f:0
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
100 XC:i:3
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
101 XA:i:0
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
102 XM:Z:*
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
103 XN:i:0
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
104 XT:i:2
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
105 XE:i:1
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
106 XG:Z:V
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
107 XU:Z:klc_070108x_PH_P7_COLO_205_D13.pepXML
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
108
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
109
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
110 NH:i:*
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
111 XO:Z:unique
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
112 XL:i:1
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
113 XP:Z:ATLELTHNWGTEDDATQSYHNGNSDPR
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
114 YP:Z:ENSP00000362463_rs4746:E111A
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
115 XF:Z:1,1
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
116 XI:f:*
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
117 XB:f:0.70082940064
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
118 XR:Z:ATLELTHNWGTEDDETQSYHNGNSDPR
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
119 YB:Z:RK
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
120 YA:Z:GF
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
121 XS:f:73.1426
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
122 XQ:f:0
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
123 XC:i:3
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
124 XA:i:0
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
125 XM:Z:*
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
126 XN:i:0
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
127 XT:i:2
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
128 XE:i:1
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
129 XG:Z:V
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
130 XU:Z:klc_070108x_PH_P7_COLO_205_D13.pepXML
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
131 """
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
132
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
133
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
134 PROBAM_TAGS = ['NH', 'XO', 'XL', 'XP', 'YP', 'XF', 'XI', 'XB', 'XR', 'YB', 'YA', 'XS', 'XQ', 'XC', 'XA', 'XM', 'XN', 'XT', 'XE', 'XG', 'XU']
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
135
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
136
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
137 PROBAM_TYTPES = {
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
138 'NH' : 'i', #number of genomic locations to which the peptide sequence maps
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
139 'XO' : 'Z', #uniqueness of the peptide mapping
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
140 'XL' : 'i', #number of peptides to which the spectrum maps
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
141 'XP' : 'Z', #peptide sequence
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
142 'YP' : 'Z', #Protein accession ID from the original search result
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
143 'XF' : 'Z', #Reading frame of the peptide (0, 1, 2)
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
144 'XI' : 'f', #Peptide intensity
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
145 'XB' : 'Z', #massdiff; experimental mass; calculated mass massdiff can be calculated by experimental mass - calculated mass. If any number is unavailable, the value should be left blank (such as 0.01;;).
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
146 'XR' : 'Z', #reference peptide sequence
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
147 'YB' : 'Z', #Preceding amino acids (2 AA, B stands for before).
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
148 'YA' : 'Z', #Following amino acids (2 AA, A stands for after).
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
149 'XS' : 'f', #PSM score
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
150 'XQ' : 'f', #PSM FDR (i.e. q-value or 1-PEP).
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
151 'XC' : 'i', #peptide charge
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
152 'XA' : 'i', #Whether the peptide is annotated 0:yes; 1:parially unknown; 2:totally unknown;
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
153 'XM' : 'Z', #Modifications
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
154 'XN' : 'i', #Number of missed cleavages in the peptide (XP)
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
155 'XT' : 'i', #Enzyme specificity
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
156 'XE' : 'i', #Enzyme used in the experiment
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
157 'XG' : 'A', #Peptide type
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
158 'XU' : 'Z', #URI
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
159 }
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
160
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
161
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
162 PROBAM_DEFAULTS = {
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
163 'NH' : -1, #number of genomic locations to which the peptide sequence maps
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
164 'XO' : '*', #uniqueness of the peptide mapping
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
165 'XL' : -1, #number of peptides to which the spectrum maps
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
166 'XP' : '*', #peptide sequence
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
167 'YP' : '*', #Protein accession ID from the original search result
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
168 'XF' : '*', #Reading frame of the peptide (0, 1, 2)
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
169 'XI' : -1, #Peptide intensity
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
170 'XB' : '*', #massdiff; experimental mass; calculated mass massdiff can be calculated by experimental mass - calculated mass. If any number is unavailable, the value should be left blank (such as 0.01;;).
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
171 'XR' : '*', #reference peptide sequence
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
172 'YB' : '*', #Preceding amino acids (2 AA, B stands for before).
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
173 'YA' : '*', #Following amino acids (2 AA, A stands for after).
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
174 'XS' : -1, #PSM score
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
175 'XQ' : -1, #PSM FDR (i.e. q-value or 1-PEP).
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
176 'XC' : -1, #peptide charge
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
177 'XA' : -1, #Whether the peptide is annotated 0:yes; 1:parially unknown; 2:totally unknown;
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
178 'XM' : '*', #Modifications
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
179 'XN' : -1, #Number of missed cleavages in the peptide (XP)
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
180 'XT' : -1, #Enzyme specificity
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
181 'XE' : -1, #Enzyme used in the experiment
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
182 'XG' : '*', #Peptide type
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
183 'XU' : '*', #URI
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
184 }
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
185
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
186 def cmp_alphanumeric(s1,s2):
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
187 if s1 == s2:
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
188 return 0
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
189 a1 = re.findall("\d+|[a-zA-Z]+",s1)
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
190 a2 = re.findall("\d+|[a-zA-Z]+",s2)
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
191 for i in range(min(len(a1),len(a2))):
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
192 if a1[i] == a2[i]:
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
193 continue
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
194 if a1[i].isdigit() and a2[i].isdigit():
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
195 return int(a1[i]) - int(a2[i])
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
196 return 1 if a1[i] > a2[i] else -1
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
197 return len(a1) - len(a2)
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
198
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
199
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
200 def sort_chrom_names(names):
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
201 rnames = sorted(names,cmp=cmp_alphanumeric)
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
202 if 'chrM' in rnames:
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
203 rnames.remove('chrM')
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
204 rnames.insert(0,'chrM')
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
205 if 'MT' in rnames:
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
206 rnames.remove('MT')
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
207 rnames.append('MT')
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
208 return rnames
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
209
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
210 def as_int_list(obj):
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
211 if obj is None:
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
212 return None
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
213 if isinstance(obj, list):
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
214 return [int(x) for x in obj]
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
215 elif isinstance(obj, str):
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
216 return [int(x) for x in obj.split(',')]
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
217 else: # python2 unicode?
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
218 return [int(x) for x in str(obj).split(',')]
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
219
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
220
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
221 class ProBEDEntry (object):
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
222 def __init__(self, chrom, chromStart, chromEnd, name, score, strand,
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
223 blockCount, blockSizes, blockStarts,
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
224 protacc, peptide, uniqueness, genomeReference,
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
225 psmScore='.', fdr='.', mods='.', charge='.',
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
226 expMassToCharge='.', calcMassToCharge='.',
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
227 psmRank='.', datasetID='.', uri='.'):
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
228 self.chrom = chrom
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
229 self.chromStart = int(chromStart)
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
230 self.chromEnd = int(chromEnd)
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
231 self.name = name
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
232 self.score = int(score) if score is not None else 0
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
233 self.strand = '-' if str(strand).startswith('-') else '+'
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
234 self.thickStart = self.chromStart
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
235 self.thickEnd = self.chromEnd
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
236 self.itemRgb = '0'
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
237 self.blockCount = int(blockCount)
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
238 self.blockSizes = as_int_list(blockSizes)
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
239 self.blockStarts = as_int_list(blockStarts)
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
240 self.protacc = protacc
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
241 self.peptide = peptide
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
242 self.uniqueness = uniqueness
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
243 self.genomeReference = genomeReference
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
244 self.psmScore = psmScore
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
245 self.fdr = fdr
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
246 self.mods = mods
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
247 self.charge = charge
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
248 self.expMassToCharge = expMassToCharge
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
249 self.calcMassToCharge = calcMassToCharge
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
250 self.psmRank = psmRank
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
251 self.datasetID = datasetID
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
252 self.uri = uri
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
253
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
254 def __str__(self):
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
255 return '%s\t%d\t%d\t%s\t%d\t%s\t%d\t%d\t%s\t%d\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n' % \
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
256 (self.chrom, self.chromStart, self.chromEnd,
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
257 self.name, self.score, self.strand,
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
258 self.thickStart, self.thickEnd, self.itemRgb,
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
259 self.blockCount, self.blockSizes, self.blockStarts,
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
260 self.protacc, self.peptide, self.uniqueness,
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
261 self.genomeReference,
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
262 self.psmScore, self.fdr, self.mods,
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
263 self.charge, self.expMassToCharge, self.calcMassToCharge,
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
264 self.psmRank, self.datasetID, self.uri)
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
265
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
266
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
267 class ProBED ( object ):
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
268 def __init__(self,species=None,assembly=None,comments=[]):
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
269 self.species = species
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
270 self.assembly = assembly
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
271 self.comments = comments
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
272 self.entries = dict()
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
273
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
274 def add_entry(self,entry):
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
275 if not entry.chrom in self.entries:
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
276 self.entries[entry.chrom] = []
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
277 self.entries[entry.chrom].append(entry)
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
278
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
279 def write(self,fh):
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
280 rnames = sort_chrom_names(self.entries.keys())
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
281 for sn in rnames:
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
282 if sn not in self.entries:
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
283 continue
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
284 ##for pbe in sorted(self.entries[sn], key=lambda probam_entry: probam_entry.pos):
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
285 for pbe in sorted(self.entries[sn], key=attrgetter('chromStart','chromEnd')):
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
286 fh.write('%s\n' % str(pbe))
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
287
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
288
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
289 class ProBAMEntry (object):
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
290 def __init__(self, qname='', flag=0, rname='', pos=0, mapq=255, cigar='', rnext='*', pnext='0', tlen='0', seq='*', qual='*', optional=PROBAM_DEFAULTS):
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
291 self.qname = qname
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
292 self.flag = flag
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
293 self.rname = rname
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
294 self.pos = pos
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
295 self.mapq = mapq
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
296 self.cigar = cigar
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
297 self.rnext = rnext
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
298 self.pnext = pnext
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
299 self.tlen = tlen
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
300 self.seq = seq
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
301 self.qual = qual
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
302 self.optional = optional
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
303 def __str__(self):
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
304 opt_cols = '\t%s' % '\t'.join(['%s:%s:%s' % (t,PROBAM_TYTPES[t],self.optional[t]) for t in PROBAM_TAGS]) if self.optional else ''
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
305 return '%s\t%d\t%s\t%d\t%d\t%s\t%s\t%s\t%s\t%s\t%s%s' % (
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
306 self.qname,self.flag,self.rname,self.pos,self.mapq,self.cigar,
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
307 str(self.rnext) if self.rnext else '',
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
308 str(self.pnext) if self.pnext else '',
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
309 str(self.tlen) if self.tlen else '',
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
310 self.seq,
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
311 self.qual, opt_cols)
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
312 def add_optional(self,tag,value):
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
313 self.optional[tag] = value
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
314
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
315
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
316 class ProBAM ( object ):
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
317 def __init__(self,species=None,assembly=None,seqlens={},comments=[]):
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
318 self.species = species
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
319 self.assembly = assembly
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
320 self.seqlens = seqlens
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
321 self.comments = comments
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
322 self.entries = dict()
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
323 self.opt_columns = set()
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
324 self.rg = []
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
325
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
326 def add_entry(self,pb_entry):
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
327 if not pb_entry.rname in self.entries:
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
328 self.entries[pb_entry.rname] = []
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
329 self.entries[pb_entry.rname].append(pb_entry)
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
330 if pb_entry.optional:
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
331 self.opt_columns | set(pb_entry.optional.keys())
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
332
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
333 def add_entry_from_bed(self,bed_entry,optional=dict()):
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
334 if bed_entry.pep:
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
335 optional['XP:Z'] = bed_entry.pep
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
336 qname=bed_entry.name
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
337 flag = 0 if bed_entry.strand == '+' else 16
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
338 rname = bed_entry.chrom
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
339 pos = bed_entry.chromStart + 1
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
340 cigar = bed_entry.get_cigar()
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
341 seq = bed_entry.get_spliced_seq(strand='+') if bed_entry.seq else '*'
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
342 pb_entry = ProBAMEntry(qname=qname, flag=flag, rname=rname, pos=pos,cigar=cigar,seq=seq,optional=optional)
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
343 self.add_entry(pb_entry)
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
344 ## print >> sys.stderr,('add_entry_from_bed:%s\n %s\n %s' % (self.entries.keys(),bed_entry,pb_entry))
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
345
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
346 def write(self,fh):
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
347 fh.write('@HD VN:1.0 SO:coordinate\n')
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
348 rnames = sort_chrom_names(self.seqlens.keys())
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
349 for sn in rnames:
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
350 fh.write('@SQ\tSN:%s\tLN:%d\n' % (sn,self.seqlens[sn]))
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
351 for rg in self.rg:
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
352 fh.write('@RG\tID:%s\n' % (rg))
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
353 fh.write('@PG\tID:SampleSpecificGenerator\n')
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
354 for comment in self.comments:
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
355 fh.write('@CO\t%s\n' % comment)
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
356 for sn in rnames:
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
357 if sn not in self.entries:
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
358 continue
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
359 ##for pbe in sorted(self.entries[sn], key=lambda probam_entry: probam_entry.pos):
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
360 for pbe in sorted(self.entries[sn], key=attrgetter('pos')):
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
361 fh.write('%s\n' % str(pbe))
492f98d89e26 planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/mzsqlite_psm_align commit 88e2fb9c31fbd687a0956924a870137d1fb9bee3-dirty
jjohnson
parents:
diff changeset
362