public static List <long> GetFileOffsets(string vcfUrl, int numPartitions, Tabix.Index tabixIndex) { long fileSize = HttpUtilities.GetLength(vcfUrl); long[] sizeBasedOffsets = GetEqualSizeOffsets(fileSize, numPartitions); return(GetBlockOffsets(sizeBasedOffsets, tabixIndex)); }
private static long[] GetAllLinearFileOffsets(Tabix.Index tabixIndex) => MergeConsecutiveEqualValues(tabixIndex.ReferenceSequences.SelectMany(x => x.LinearFileOffsets.Select(y => VirtualPosition.From((long)y).FileOffset))).ToArray();
private static List <long> GetBlockOffsets(long[] sizeBasedOffsets, Tabix.Index tabixIndex) { long[] allLinearOffsets = GetAllLinearFileOffsets(tabixIndex); return(FindEqualOrClosestSmallerOffsets(sizeBasedOffsets, allLinearOffsets)); }