I took this model verbatim from the GWAS branch. I did a quick search and “if(“ has 20473 hits in the source code…

From: Gustavo Lopes [mailto:notifications@github.com]
Sent: vrijdag 7 maart 2014 11:38
To: thehyve/transmart-core-db
Cc: Jan Hudecek
Subject: Re: [transmart-core-db] Vcf implementation (#20)


In grails-app/domain/org/transmartproject/db/dataquery/highdim/vcf/DeVariantSubjectDetailCoreDb.groovy:

> +    }

> +

> +    static GenomicVariantType getGenomicVariantType(String ref, String alt) {

> +        def refCleaned = (ref ?: '').replaceAll(/[^ACGT]/, '')

> +        def altCleaned = (alt ?: '').replaceAll(/[^ACGT]/, '')

> +

> +        if(refCleaned.length() == 1 && altCleaned.length() == 1)

> +            return SNP

> +

> +        if(altCleaned.length() > refCleaned.length()

> +                && altCleaned.contains(refCleaned))

> +            return INS

> +

> +        if(altCleaned.length() < refCleaned.length()

> +                && refCleaned.contains(altCleaned))

> +            return DEL

Leave a space between if and ( and collect and {.

—
Reply to this email directly or view it on GitHub<https://github.com/thehyve/transmart-core-db/pull/20/files#r10378982>.