@@ -790,12 +790,12 @@ private JSONObject getTabixTrack(User u, Logger log, ExpData targetFile, Referen
790790
791791 public boolean needsProcessing ()
792792 {
793- return (needsGzip () && !isGzipped ()) || doIndex () || shouldHaveFreeTextSearch ();
793+ return (needsGzip () && !isGzipped ()) || shouldBeReSorted () || doIndex () || shouldHaveFreeTextSearch ();
794794 }
795795
796796 public boolean shouldBeCopiedToProcessDir ()
797797 {
798- return (needsGzip () && !isGzipped ());
798+ return (needsGzip () && !isGzipped ()) || shouldBeReSorted () ;
799799 }
800800
801801 public boolean isGzipped ()
@@ -837,7 +837,7 @@ public File prepareResource(User u, Logger log, boolean throwIfNotPrepared, bool
837837 }
838838
839839 File targetFile = expData .getFile ();
840- if (needsGzip () && !isGzipped ())
840+ if (( needsGzip () && !isGzipped ()) || shouldBeReSorted ())
841841 {
842842 //need to gzip and tabix index:
843843 if (processedTrackFile .exists () && !SequencePipelineService .get ().hasMinLineCount (processedTrackFile , 1 ))
@@ -1165,6 +1165,17 @@ else if (TRACK_TYPES.gff.getFileType().isType(finalLocation) || TRACK_TYPES.gtf.
11651165 }
11661166 }
11671167
1168+ private boolean shouldBeReSorted ()
1169+ {
1170+ String sourceFilename = getSourceFileName ();
1171+ if (sourceFilename == null )
1172+ {
1173+ return false ;
1174+ }
1175+
1176+ return TRACK_TYPES .gff .getFileType ().isType (sourceFilename ) || TRACK_TYPES .gtf .getFileType ().isType (sourceFilename ) || TRACK_TYPES .bed .getFileType ().isType (sourceFilename );
1177+ }
1178+
11681179 public File getLocationOfProcessedTrack (boolean createDir )
11691180 {
11701181 ExpData expData = getExpData ();
0 commit comments