@@ -501,7 +501,9 @@ private JSONObject getVcfTrack(Logger log, ExpData targetFile, ReferenceGenome r
501501 {
502502 JSONObject ret = new JSONObject ();
503503 ret .put ("type" , getTrackType ());
504- ret .put ("trackId" , getObjectId ());
504+ final File finalLocation = getLocationOfProcessedTrack (false );
505+ ret .put ("trackId" , finalLocation == null ? null : finalLocation .getName ());
506+ ret .put ("trackGUID" , getObjectId ());
505507 ret .put ("name" , getLabel ());
506508 ret .put ("assemblyNames" , new JSONArray (){{
507509 put (JBrowseSession .getAssemblyName (rg ));
@@ -567,7 +569,9 @@ private JSONObject getBamTrack(Logger log, ExpData targetFile, ReferenceGenome r
567569 {
568570 JSONObject ret = new JSONObject ();
569571 ret .put ("type" , getTrackType ());
570- ret .put ("trackId" , getObjectId ());
572+ final File finalLocation = getLocationOfProcessedTrack (false );
573+ ret .put ("trackId" , finalLocation == null ? null : finalLocation .getName ());
574+ ret .put ("trackGUID" , getObjectId ());
571575 ret .put ("name" , getLabel ());
572576 ret .put ("category" , new JSONArray (){{
573577 put (getCategory ());
@@ -651,7 +655,9 @@ private JSONObject getTabixTrack(Logger log, ExpData targetFile, ReferenceGenome
651655 {
652656 JSONObject ret = new JSONObject ();
653657 ret .put ("type" , getTrackType ());
654- ret .put ("trackId" , getObjectId ());
658+ final File finalLocation = getLocationOfProcessedTrack (false );
659+ ret .put ("trackId" , finalLocation == null ? null : finalLocation .getName ());
660+ ret .put ("trackGUID" , getObjectId ());
655661 ret .put ("name" , getLabel ());
656662 ret .put ("category" , new JSONArray (){{
657663 put (getCategory ());
@@ -833,8 +839,6 @@ public File prepareResource(Logger log, boolean throwIfNotPrepared, boolean forc
833839 wrapper .setWorkingDir (targetFile .getParentFile ());
834840 wrapper .setThrowNonZeroExits (true );
835841
836- //TODO: eventually remove this. see: https://github.com/GMOD/jbrowse-components/issues/2354#issuecomment-926320747
837- wrapper .addToEnvironment ("DEBUG" , "*" );
838842 wrapper .execute (Arrays .asList (exe .getPath (), "text-index" , "--force" , "--quiet" , "--attributes" , StringUtils .join (attributes , "," ), "--prefixSize" , "5" , "--file" , targetFile .getPath ()));
839843 if (!ixx .exists ())
840844 {
@@ -849,31 +853,6 @@ public File prepareResource(Logger log, boolean throwIfNotPrepared, boolean forc
849853 {
850854 throw new PipelineJobException ("Unable to find file: " + ix .getPath ());
851855 }
852-
853- File ixCopy = new File (ix .getPath () + ".tmp" );
854- try (PrintWriter writer = PrintWriters .getPrintWriter (ixCopy ); BufferedReader reader = Readers .getReader (ix ))
855- {
856- String line ;
857- while ((line = reader .readLine ()) != null )
858- {
859- line = line .replaceAll ("\" " + targetFile .getName () + "\" " , "\" " + getObjectId () + "\" " );
860- writer .println (line );
861- }
862- }
863- catch (IOException e )
864- {
865- throw new PipelineJobException (e );
866- }
867-
868- try
869- {
870- ix .delete ();
871- FileUtils .moveFile (ixCopy , ix );
872- }
873- catch (IOException e )
874- {
875- throw new PipelineJobException (e );
876- }
877856 }
878857 }
879858
0 commit comments