@@ -52,7 +52,6 @@ public class DumpData {
5252 * @param juiceboxTools: String: path of juicertoolsBox
5353 * @param hicFile: String: path to the HiC file
5454 * @param norm: String: type of normalisation
55- * @param resolution: int: resolution of the bins
5655 */
5756 public DumpData (String juiceboxTools ,String hicFile , String norm ) {
5857 this ._juiceBoxTools = juiceboxTools ;
@@ -84,7 +83,7 @@ public boolean dumpObservedMExpected(String chr, String output, int resolution)
8483 catch (IOException e ) { e .printStackTrace ();}
8584 catch (InterruptedException e ) {e .printStackTrace ();}
8685 observedMExpected (obs ,output ,resolution );
87- if (_logError != "" ) {
86+ if (_logError . contains ( "Exception" )) {
8887 System .out .println (_logError );
8988 System .exit (0 );
9089 }
@@ -144,6 +143,7 @@ public boolean getExpected(String chr,String output,int resolution){
144143 Runtime runtime = Runtime .getRuntime ();
145144 String expected = output .replaceAll (".txt" , "_expected.txt" );
146145 String cmd = "java" +" -jar " +this ._juiceBoxTools +" dump expected " +this ._normalisation +" " +this ._hicFile +" " +chr +" BP " +resolution +" " +expected ;
146+ //System.out.println(cmd);
147147 this ._log = this ._log +"\n " +expected +"\t " +cmd ;
148148 Process process ;
149149 try {
@@ -163,7 +163,7 @@ public boolean getExpected(String chr,String output,int resolution){
163163 } catch (IOException | InterruptedException e ) {
164164 e .printStackTrace ();
165165 }
166- if (_logError != "" ){
166+ if (_logError . contains ( "Exception" ) ){
167167 System .out .println (_logError );
168168 System .exit (0 );
169169 }
@@ -189,10 +189,30 @@ public boolean getNormVector(String chr,String output,int resolution) throws IOE
189189 new ReturnFlux (process .getErrorStream ()).start ();
190190 process .getOutputStream ();
191191 exitValue =process .waitFor ();
192- if (_logError !="" ){
192+ if (_logError !="" && _logError .contains ("Exception" ) == false ){
193+ System .out .println ("VC vector not find, SIP is using " +this ._normalisation +" for " + chr +"\n " +_logError );
194+ runtime = Runtime .getRuntime ();
195+ _logError ="" ;
196+ cmd = "java" +" -jar " +this ._juiceBoxTools +" dump norm " +this ._normalisation +" " +this ._hicFile +" " +chr +" BP " +resolution +" " +output ;
197+ //System.out.println(cmd);
198+ process = runtime .exec (cmd );
199+
200+ new ReturnFlux (process .getInputStream ()).start ();
201+ new ReturnFlux (process .getErrorStream ()).start ();
202+ exitValue =process .waitFor ();
203+
204+ if (_logError .contains ("Exception" )){
205+ System .out .println (_logError );
206+ System .out .println ("juicer tool error !!!! " + chr +" " +cmd );
207+ System .exit (0 );
208+ }
209+ }else if ( _logError .contains ("Exception" )){
193210 System .out .println (_logError );
211+ System .out .println ("juicer tool error !!!! " + chr +" " +cmd );
194212 System .exit (0 );
213+
195214 }
215+ //System.out.println(_logError);
196216 return exitValue ==0 ;
197217 }
198218
0 commit comments