<commit_before>#!/usr/bin/env bash

set -e
set -o pipefail

#   Load variables from supplied config file
source $1

#   Are we using Common_Config? If so, source it
if [[ -f "${COMMON}" ]]
then
    source "${COMMON}"
fi

#   Where is angsd-wrapper located?
SOURCE=$2

#   Where is ngsAdmix
ADMIX_DIR="${SOURCE}"/dependencies/ngsAdmix

#   Make the outdirectory
OUT=${SCRATCH}/${PROJECT}/Admixture
mkdir -p ${OUT}

for k in `seq 2 "${K}"`
do
    echo "Calculating for K=$k"
    "${ADMIX_DIR}"/NGSadmix \
        -likes "${LIKELIHOOD}" \
        -K "${k}" \
        -P "${N_CORES}" \
        -o "${OUT}"/"${PROJECT}"."${k}" \
        -minMaf "${MIN_MAF}"
done

for kvalue in `seq 2 "${K}"`
do
    cat "${OUT}"/"${PROJECT}"."$kvalue".qopt >> "${OUT}"/"${PROJECT}".allK.qopt
done<commit_msg>Invert merge order<commit_after>#!/usr/bin/env bash

set -e
set -o pipefail

#   Load variables from supplied config file
source $1

#   Are we using Common_Config? If so, source it
if [[ -f "${COMMON}" ]]
then
    source "${COMMON}"
fi

#   Where is angsd-wrapper located?
SOURCE=$2

#   Where is ngsAdmix
ADMIX_DIR="${SOURCE}"/dependencies/ngsAdmix

#   Make the outdirectory
OUT=${SCRATCH}/${PROJECT}/Admixture
mkdir -p ${OUT}

for k in `seq 2 "${K}"`
do
    echo "Calculating for K=$k"
    "${ADMIX_DIR}"/NGSadmix \
        -likes "${LIKELIHOOD}" \
        -K "${k}" \
        -P "${N_CORES}" \
        -o "${OUT}"/"${PROJECT}"."${k}" \
        -minMaf "${MIN_MAF}"
done

for kvalue in `eval echo {"$k"..2}`
do
    cat "${OUT}"/"${PROJECT}"."$kvalue".qopt >> "${OUT}"/"${PROJECT}".allK.qopt
done
{'fraction_non_alphanumeric': 0.2030264817150063, 'fraction_numerical': 0.005044136191677175, 'mean_word_length': 2.9774436090225564, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4187136', 'n_tokens_mistral': 630, 'n_tokens_neox': 613, 'n_words': 161}