@@ -501,8 +501,7 @@ private JSONObject getVcfTrack(Logger log, ExpData targetFile, ReferenceGenome r
501501 {
502502 JSONObject ret = new JSONObject ();
503503 ret .put ("type" , getTrackType ());
504- final File finalLocation = getLocationOfProcessedTrack (false );
505- ret .put ("trackId" , finalLocation == null ? null : finalLocation .getName ());
504+ ret .put ("trackId" , getJsonTrackId ());
506505 ret .put ("name" , getLabel ());
507506 ret .put ("assemblyNames" , new JSONArray (){{
508507 put (JBrowseSession .getAssemblyName (rg ));
@@ -564,12 +563,17 @@ public boolean matchesTrackSelector(List<String> toTest)
564563 return toTest .contains (getObjectId ()) || toTest .contains (getLabel ());
565564 }
566565
566+ public String getJsonTrackId ()
567+ {
568+ final File finalLocation = getLocationOfProcessedTrack (false );
569+ return finalLocation == null ? null : finalLocation .getName ();
570+ }
571+
567572 private JSONObject getBamTrack (Logger log , ExpData targetFile , ReferenceGenome rg )
568573 {
569574 JSONObject ret = new JSONObject ();
570575 ret .put ("type" , getTrackType ());
571- final File finalLocation = getLocationOfProcessedTrack (false );
572- ret .put ("trackId" , finalLocation == null ? null : finalLocation .getName ());
576+ ret .put ("trackId" , getJsonTrackId ());
573577 ret .put ("name" , getLabel ());
574578 ret .put ("category" , new JSONArray (){{
575579 put (getCategory ());
@@ -653,8 +657,7 @@ private JSONObject getTabixTrack(Logger log, ExpData targetFile, ReferenceGenome
653657 {
654658 JSONObject ret = new JSONObject ();
655659 ret .put ("type" , getTrackType ());
656- final File finalLocation = getLocationOfProcessedTrack (false );
657- ret .put ("trackId" , finalLocation == null ? null : finalLocation .getName ());
660+ ret .put ("trackId" , getJsonTrackId ());
658661 ret .put ("name" , getLabel ());
659662 ret .put ("category" , new JSONArray (){{
660663 put (getCategory ());
0 commit comments