Commit 169b5c18 authored by Dylan Aïssi's avatar Dylan Aïssi
Browse files

New upstream version 5.0-180915+dfsg

parent 383b5902
Loading
Loading
Loading
Loading
+22 −14
Original line number Diff line number Diff line
@@ -261,6 +261,12 @@ public final class ImputedRecBuilder {
    }

    private void printInfoField(PrintWriter out, boolean isImputed) {
        if (nAlleles==1) {
            if (isImputed) {
                out.print("IMP");
            }
        }
        else {
            for (int a=1; a<nAlleles; ++a) {
                out.print( (a==1) ? "DR2=" : Const.comma);
                out.print(R2_VALS[(int) Math.rint(100*r2(a))]);
@@ -277,6 +283,7 @@ public final class ImputedRecBuilder {
                out.print(";IMP");
            }
        }
    }

    private float r2(int allele) {
        float sum = sumAlProbs[allele];
@@ -294,6 +301,7 @@ public final class ImputedRecBuilder {

    private static String[] defaultHomRefFields() {
        String[] sa = new String[5];
        sa[1] = Const.tab + "0|0";
        sa[2] = Const.tab + "0|0:0";
        for (int j=3; j<sa.length; ++j) {
            sa[j] = sa[j-1] + ",0";
@@ -303,7 +311,7 @@ public final class ImputedRecBuilder {

    private static String[] homRefFields(boolean ap, boolean gp) {
        String[] homRefField = new String[DEFAULT_HOM_REF_FIELDS.length];
        for (int nAl=2; nAl<homRefField.length; ++nAl) {
        for (int nAl=1; nAl<homRefField.length; ++nAl) {
            StringBuilder sb = new StringBuilder(DEFAULT_HOM_REF_FIELDS[nAl]);
            if (ap) {
                for (int a=1; a<nAl; ++a) {
+6 −6
Original line number Diff line number Diff line
@@ -61,7 +61,9 @@ public class ImputedVcfWriter {
     * @param refEnd an upper bound (exclusive) on the reference markers
     * that will be printed
     * @throws IndexOutOfBoundsException if
     * {@code (minRefStart < 0 || maxRefEnd > impData.refGT().nMarkers())}
     * {@code (refStart < 0 || refEnd > impData.refGT().nMarkers())}
     * @throws IndexOutOfBoundsException if
     * {@code targCluster < 0 || targCluster >= impData.nClusters()}
     * @throws NullPointerException if {@code impData == null}
     */
    public ImputedVcfWriter(ImpData impData, int targCluster, int refStart,
@@ -76,18 +78,16 @@ public class ImputedVcfWriter {
        this.targCluster = targCluster;
        if (targCluster==0) {
            this.refStart = refStart;
            int tmpClustEnd = Math.max(refStart, impData.refClusterEnd(targCluster));
            this.clustEnd = Math.min(tmpClustEnd, refEnd);
            this.refEnd = Math.min(impData.refClusterStart(targCluster + 1), refEnd);
        }
        else if (targCluster < impData.nClusters()-1) {
        else {
            this.refStart = Math.max(refStart, impData.refClusterStart(targCluster));
        }
        if (targCluster < impData.nClusters()-1) {
            int tmpClustEnd = Math.max(refStart, impData.refClusterEnd(targCluster));
            this.clustEnd = Math.min(tmpClustEnd, refEnd);
            this.refEnd = Math.min(impData.refClusterStart(targCluster + 1), refEnd);
        }
        else {
            this.refStart = Math.max(refStart, impData.refClusterStart(targCluster));
            this.clustEnd = refEnd;
            this.refEnd = refEnd;
        }
+3 −3
Original line number Diff line number Diff line
@@ -70,8 +70,8 @@ public class Main {
     * The program name and version.
     */
    public static final String VERSION = "(version 5.0)";
    public static final String PROGRAM = "beagle.03Jul18.40b.jar";
    public static final String COMMAND = "java -jar beagle.03Jul18.40b.jar";
    public static final String PROGRAM = "beagle.15Sep18.8a0.jar";
    public static final String COMMAND = "java -jar beagle.15Sep18.8a0.jar";

    /**
     * The copyright string.
@@ -83,7 +83,7 @@ public class Main {
     */
    public static final String SHORT_HELP = Main.PROGRAM + " " + VERSION
            + Const.nl + Main.COPYRIGHT
            + Const.nl + "Enter \"java -jar beagle.03Jul18.40b.jar\" to "
            + Const.nl + "Enter \"java -jar beagle.15Sep18.8a0.jar\" to "
            + "list command line argument";

    private final Par par;
+1 −1
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ public class MainHelper {
                    rand.nextLong());
            long t1 = System.nanoTime();
            PhaseLS.run(phaseData, estPhase, recombRegress);
            if (recombRegress!=null) {
            if (recombRegress!=null && recombRegress.cnt()>=100) {
                recombFactor = recombFactor(cd, recombRegress);
            }
            long elapsedNanos = System.nanoTime() - t0;