annotate 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
rev   line source
jpayne@68 1 package icecream;
jpayne@68 2
jpayne@68 3 import shared.Parse;
jpayne@68 4
jpayne@68 5 public class PBHeader {
jpayne@68 6
jpayne@68 7 public PBHeader(String s){
jpayne@68 8 setFrom(s);
jpayne@68 9 }
jpayne@68 10
jpayne@68 11 //m64021_190821_100154/102/32038_35649
jpayne@68 12 //m64021_190821_100154 is run id
jpayne@68 13 //102 is zmw id
jpayne@68 14 //32038_35649 are movie coordinates
jpayne@68 15 //This function allows extra stuff like whitespace after the end of the formal header.
jpayne@68 16 public void setFrom(final String header){
jpayne@68 17 original=header;
jpayne@68 18 int slash1=header.indexOf('/');
jpayne@68 19 assert(slash1>=0) : "Misformatted PBHeader: "+header;
jpayne@68 20 int slash2=header.indexOf('/', slash1+1);
jpayne@68 21 assert(slash2>=0) : "Misformatted PBHeader: "+header;
jpayne@68 22 int under3=header.indexOf('_', slash2+1);
jpayne@68 23 assert(under3>=0) : "Misformatted PBHeader: "+header;
jpayne@68 24 int terminator=under3+1;
jpayne@68 25 while(terminator<header.length() && Character.isDigit(header.charAt(terminator))){terminator++;}
jpayne@68 26 runID=header.substring(0, slash1);
jpayne@68 27 // System.err.println("\n"+header+"\n"+slash1+","+slash2);
jpayne@68 28 zmwID=Parse.parseInt(header, slash1+1, slash2);
jpayne@68 29 start=Parse.parseInt(header, slash2+1, under3);
jpayne@68 30 stop=Parse.parseInt(header, under3+1, terminator);
jpayne@68 31 }
jpayne@68 32
jpayne@68 33 public static int parseZMW(final String header){
jpayne@68 34 int slash1=header.indexOf('/');
jpayne@68 35 assert(slash1>=0) : "Misformatted PBHeader: "+header;
jpayne@68 36 int slash2=header.indexOf('/', slash1+1);
jpayne@68 37 assert(slash2>=0) : "Misformatted PBHeader: "+header;
jpayne@68 38 int zmwID=Parse.parseInt(header, slash1+1, slash2);
jpayne@68 39 return zmwID;
jpayne@68 40 }
jpayne@68 41
jpayne@68 42 public String original;
jpayne@68 43 public String runID;
jpayne@68 44 public int zmwID;
jpayne@68 45 public int start;
jpayne@68 46 public int stop;
jpayne@68 47
jpayne@68 48 }