Class GorJavaUtilities


  • public class GorJavaUtilities
    extends java.lang.Object
    Created by sigmar on 21/12/15.
    • Constructor Detail

      • GorJavaUtilities

        public GorJavaUtilities()
    • Method Detail

      • getPhenotype

        public static GorJavaUtilities.PhenoInfo getPhenotype​(java.lang.String phenoHeader,
                                                              java.io.BufferedReader pheno)
      • clearHints

        public static java.lang.String clearHints​(java.lang.String query)
      • splitResourceHints

        public static java.lang.String[] splitResourceHints​(java.lang.String query,
                                                            java.lang.String validStart)
      • createMapString

        public static java.lang.String createMapString​(java.util.Map<java.lang.String,​java.lang.String> createMap)
      • stream2RowList

        public static java.util.List<org.gorpipe.gor.model.Row> stream2RowList​(java.util.stream.Stream<org.gorpipe.gor.model.Row> str)
      • seekReplacement

        public static java.lang.String seekReplacement​(java.lang.String myCommand,
                                                       java.lang.String chr,
                                                       int start,
                                                       int stop)
      • projectReplacement

        public static java.lang.String projectReplacement​(java.lang.String myCommand,
                                                          org.gorpipe.gor.session.GorSession session)
                                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • projectReplacement

        public static java.lang.String projectReplacement​(java.lang.String myCommand,
                                                          java.lang.String projectRoot,
                                                          java.lang.String requestId,
                                                          java.lang.String securityContext)
                                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • projectDataReplacement

        public static java.lang.String projectDataReplacement​(java.lang.String projectRoot,
                                                              java.lang.String myCommand)
                                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • getDbIteratorSource

        public static org.gorpipe.gor.model.GenomicIterator getDbIteratorSource​(java.lang.String sqlQuery,
                                                                                boolean gortable,
                                                                                java.lang.String source,
                                                                                boolean scoping)
      • wrapObjectArrayIterator

        public static java.util.stream.Stream<java.lang.String> wrapObjectArrayIterator​(java.util.Iterator<java.lang.Object[]> iterator)
        Helper method for wrapping Object[] iterator to Stream.
        Parameters:
        iterator -
        Returns:
        Stream where iterator elements are represented as string joined with tab delimiter
      • readWhiteList

        public static java.util.Map<java.lang.String,​GorJavaUtilities.CmdParams> readWhiteList​(java.nio.file.Path cmdConfigPath)
      • readWhiteList

        public static java.util.Map<java.lang.String,​GorJavaUtilities.CmdParams> readWhiteList​(java.lang.String cmdConfigFile)
                                                                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • resolveWhiteListFilePath

        public static java.nio.file.Path resolveWhiteListFilePath​(java.lang.String whiteListFile,
                                                                  java.nio.file.Path projectRoot)
        Helper method to resolve whitelist file path (from config file) to full path.

        If whitelist path is resolved as follows: 1. If input is absolute or empty then it is returned. 2. Search relative for the project directory. 3. If nothing is found we return the input.

        Parameters:
        whiteListFile - white list file path, can not be null or emtpy.
        projectRoot - project root for the current project.
        Returns:
        fully resolved path to the whitelist file.
      • getIgnoreCase

        public static java.util.Optional<java.lang.String> getIgnoreCase​(java.util.Collection<java.lang.String> c,
                                                                         java.lang.String str)
      • toUppercase

        public static java.lang.String[] toUppercase​(java.util.Collection<java.lang.String> c)
      • mergeArrays

        public static java.lang.String[] mergeArrays​(java.lang.String[] array1,
                                                     java.lang.String[] array2)
      • isGorCmd

        public static boolean isGorCmd​(java.lang.String cmd)
      • isPGorCmd

        public static boolean isPGorCmd​(java.lang.String cmd)
      • writeDictionaryFromMeta

        public static void writeDictionaryFromMeta​(java.nio.file.Path outfolderpath,
                                                   java.nio.file.Path dictionarypath)
                                            throws java.io.IOException
        Throws:
        java.io.IOException