# Load the shared object
useDynLib(SeqArray,
    SEQ_File_Init, SEQ_File_Done,
    SEQ_FilterPushEmpty, SEQ_FilterPushLast, SEQ_FilterPop,
    SEQ_MergeAllele, SEQ_MergeGeno, SEQ_MergePhase, SEQ_MergeInfo,
    SEQ_MergeFormat,
    SEQ_SetSpaceSample, SEQ_SetSpaceSample2,
    SEQ_SetSpaceVariant, SEQ_SetSpaceVariant2, SEQ_GetSortedIndex,
    SEQ_SetSpaceChrom, SEQ_SetSpaceAnnotID,
    SEQ_SplitSelection, SEQ_SplitSelectionX,
    SEQ_GetSpace, SEQ_GetSpaceSample, SEQ_GetSpaceVariant,
    SEQ_Summary, SEQ_System,
    SEQ_VCF_NumLines, SEQ_VCF_Split, SEQ_VCF_Parse,
    SEQ_ToVCF_Init, SEQ_ToVCF_Done,
    SEQ_Quote, SEQ_GetData, SEQ_ListVarData,
    SEQ_Apply_Variant, SEQ_Apply_Sample, SEQ_BApply_Variant,
    SEQ_ConvBED2GDS,
    SEQ_SelectFlag, SEQ_ResetChrom,
    SEQ_IntAssign, SEQ_AppendFill, SEQ_ClearVarMap, SEQ_BufferPosition,
    SEQ_Pkg_Init,
    SEQ_bgzip_create, SEQ_Progress, SEQ_ProgressAdd,
    SEQ_Unit_SlidingWindows,
    SEQ_ExternalName0, SEQ_ExternalName1, SEQ_ExternalName2,
    SEQ_ExternalName3, SEQ_ExternalName4, SEQ_ExternalName5
)


# Import all packages listed as Imports or Depends
import(methods)
import(gdsfmt)
importFrom(stats, median, sd)
importFrom(parallel, clusterApply, clusterApplyLB, clusterCall, detectCores,
    makeCluster, makeForkCluster, mclapply, stopCluster)
importFrom(utils, read.table, flush.console, write.table, str, tail,
    type.convert)

importFrom(S4Vectors, DataFrame, SimpleList)
importClassesFrom(IRanges, IRanges)
importFrom(IRanges, IRanges, LogicalList, IntegerList, NumericList,
    CharacterList, RawList, FactorList, DataFrameList)
importClassesFrom(GenomicRanges, GRanges, GRangesList)
importFrom(GenomicRanges, GRanges)
importMethodsFrom(GenomicRanges, granges)
importMethodsFrom(GenomeInfoDb, seqnames, seqlevels)
importFrom(GenomeInfoDb, renameSeqlevels)
importFrom(Biostrings, DNAStringSet, DNAStringSetList)


# Registering S3 methods
S3method(print, SeqVCFHeaderClass)
S3method(print, SeqVarDataList)
S3method(print, SeqUnitListClass)
S3method(summary, SeqUnitListClass)


# Export all names
exportPattern("^seq*")
export(.Last.lib)
exportClasses(SeqVarGDSClass)
exportMethods(granges, ref, alt, qual, filt, header, fixed, info, geno,
    colData, rowRanges)
exportMethods(seqClose, seqSetFilter)
