Mercurial > repos > rliterman > csp2
comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/opt/bbmap-39.01-1/current/icecream/PBHeader.java @ 68:5028fdace37b
planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author | jpayne |
---|---|
date | Tue, 18 Mar 2025 16:23:26 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
67:0e9998148a16 | 68:5028fdace37b |
---|---|
1 package icecream; | |
2 | |
3 import shared.Parse; | |
4 | |
5 public class PBHeader { | |
6 | |
7 public PBHeader(String s){ | |
8 setFrom(s); | |
9 } | |
10 | |
11 //m64021_190821_100154/102/32038_35649 | |
12 //m64021_190821_100154 is run id | |
13 //102 is zmw id | |
14 //32038_35649 are movie coordinates | |
15 //This function allows extra stuff like whitespace after the end of the formal header. | |
16 public void setFrom(final String header){ | |
17 original=header; | |
18 int slash1=header.indexOf('/'); | |
19 assert(slash1>=0) : "Misformatted PBHeader: "+header; | |
20 int slash2=header.indexOf('/', slash1+1); | |
21 assert(slash2>=0) : "Misformatted PBHeader: "+header; | |
22 int under3=header.indexOf('_', slash2+1); | |
23 assert(under3>=0) : "Misformatted PBHeader: "+header; | |
24 int terminator=under3+1; | |
25 while(terminator<header.length() && Character.isDigit(header.charAt(terminator))){terminator++;} | |
26 runID=header.substring(0, slash1); | |
27 // System.err.println("\n"+header+"\n"+slash1+","+slash2); | |
28 zmwID=Parse.parseInt(header, slash1+1, slash2); | |
29 start=Parse.parseInt(header, slash2+1, under3); | |
30 stop=Parse.parseInt(header, under3+1, terminator); | |
31 } | |
32 | |
33 public static int parseZMW(final String header){ | |
34 int slash1=header.indexOf('/'); | |
35 assert(slash1>=0) : "Misformatted PBHeader: "+header; | |
36 int slash2=header.indexOf('/', slash1+1); | |
37 assert(slash2>=0) : "Misformatted PBHeader: "+header; | |
38 int zmwID=Parse.parseInt(header, slash1+1, slash2); | |
39 return zmwID; | |
40 } | |
41 | |
42 public String original; | |
43 public String runID; | |
44 public int zmwID; | |
45 public int start; | |
46 public int stop; | |
47 | |
48 } |