public GenomicLocation normalizeGenomicLocation(GenomicLocation genomicLocation) {
        GenomicLocation normalizedGenomicLocation = new GenomicLocation();
        // if original input is set in the incoming genomic location object then use the same value
        // for the normalized genomic location object returned, otherwise set it to the
        // string representation of the incoming genomic location object
        if (genomicLocation.getOriginalInput() != null && !genomicLocation.getOriginalInput().isEmpty()) {
            normalizedGenomicLocation.setOriginalInput(genomicLocation.getOriginalInput());
        } else {
            normalizedGenomicLocation.setOriginalInput(genomicLocation.toString());
        }
        // normalize chromosome name
        String chr = chromosomeNormalizer(genomicLocation.getChromosome().trim());
        normalizedGenomicLocation.setChromosome(chr);
        // convert vcf style start,end,ref,alt to MAF style
        Integer start = genomicLocation.getStart();
        Integer end = genomicLocation.getEnd();
        String ref = genomicLocation.getReferenceAllele().trim();
        String var = genomicLocation.getVariantAllele().trim();
        String prefix = "";
        if (!ref.equals(var)) {
            prefix = longestCommonPrefix(ref, var);
        }
        // Remove common prefix and adjust variant position accordingly
        if (prefix.length() > 0) {
            ref = ref.substring(prefix.length());
            var = var.substring(prefix.length());
            int nStart = start + prefix.length();
            if (ref.length() == 0) {
                nStart -= 1;
            }
            start = nStart;
        }
        normalizedGenomicLocation.setStart(start);
        normalizedGenomicLocation.setEnd(end);
        normalizedGenomicLocation.setReferenceAllele(ref);
        normalizedGenomicLocation.setVariantAllele(var);
        return normalizedGenomicLocation;
    }
public GenomicLocation normalizeGenomicLocation(GenomicLocation genomicLocation) {
        GenomicLocation normalizedGenomicLocation = new GenomicLocation();
       
       
       
        if (genomicLocation.getOriginalInput() != null && !genomicLocation.getOriginalInput().isEmpty()) {
            normalizedGenomicLocation.setOriginalInput(genomicLocation.getOriginalInput());
        } else {
            normalizedGenomicLocation.setOriginalInput(genomicLocation.toString());
        }
       
        String chr = chromosomeNormalizer(genomicLocation.getChromosome().trim());
        normalizedGenomicLocation.setChromosome(chr);
       
        Integer start = genomicLocation.getStart();
        Integer end = genomicLocation.getEnd();
        String ref = genomicLocation.getReferenceAllele().trim();
        String var = genomicLocation.getVariantAllele().trim();
        String prefix = "";
        if (!ref.equals(var)) {
            prefix = longestCommonPrefix(ref, var);
        }
       
        if (prefix.length() > 0) {
            ref = ref.substring(prefix.length());
            var = var.substring(prefix.length());
            int nStart = start + prefix.length();
            if (ref.length() == 0) {
                nStart -= 1;
            }
            start = nStart;
        }
        normalizedGenomicLocation.setStart(start);
        normalizedGenomicLocation.setEnd(end);
        normalizedGenomicLocation.setReferenceAllele(ref);
        normalizedGenomicLocation.setVariantAllele(var);
        return normalizedGenomicLocation;
    }
public genomiclocation normalizegenomiclocation(genomiclocation genomiclocation) { genomiclocation normalizedgenomiclocation = new genomiclocation(); if (genomiclocation.getoriginalinput() != null && !genomiclocation.getoriginalinput().isempty()) { normalizedgenomiclocation.setoriginalinput(genomiclocation.getoriginalinput()); } else { normalizedgenomiclocation.setoriginalinput(genomiclocation.tostring()); } string chr = chromosomenormalizer(genomiclocation.getchromosome().trim()); normalizedgenomiclocation.setchromosome(chr); integer start = genomiclocation.getstart(); integer end = genomiclocation.getend(); string ref = genomiclocation.getreferenceallele().trim(); string var = genomiclocation.getvariantallele().trim(); string prefix = ""; if (!ref.equals(var)) { prefix = longestcommonprefix(ref, var); } if (prefix.length() > 0) { ref = ref.substring(prefix.length()); var = var.substring(prefix.length()); int nstart = start + prefix.length(); if (ref.length() == 0) { nstart -= 1; } start = nstart; } normalizedgenomiclocation.setstart(start); normalizedgenomiclocation.setend(end); normalizedgenomiclocation.setreferenceallele(ref); normalizedgenomiclocation.setvariantallele(var); return normalizedgenomiclocation; }