From eebfa6a6579f2d94d124f1f98cf4fb8afc664993 Mon Sep 17 00:00:00 2001 From: ChaochihL Date: Fri, 28 Sep 2018 18:03:07 -0500 Subject: [PATCH] old dir from Arun fork now merged into Wrappers dir --- scripts/2DSFS.conf | 15 - scripts/2DSFS.sh | 249 ----------------- scripts/ABBA_BABA.conf | 4 - scripts/ABBA_BABA.sh | 87 ------ scripts/ADMIX.conf | 2 - scripts/ADMIX.sh | 28 -- scripts/F.conf | 3 - scripts/F.sh | 93 ------- scripts/FASTA.conf | 2 - scripts/FASTA.sh | 13 - scripts/FST.conf | 23 -- scripts/FST.sh | 75 ----- scripts/GL.conf | 3 - scripts/GL.sh | 75 ----- scripts/PCA.conf | 2 - scripts/PCA.sh | 68 ----- scripts/SFS.conf | 11 - scripts/SFS.sh | 129 --------- scripts/THETAS.conf | 10 - scripts/THETAS.sh | 135 --------- scripts/common.conf | 28 -- scripts/shiny/server.R | 612 ----------------------------------------- scripts/shiny/ui.R | 217 --------------- scripts/utils.sh | 49 ---- 24 files changed, 1933 deletions(-) delete mode 100644 scripts/2DSFS.conf delete mode 100644 scripts/2DSFS.sh delete mode 100644 scripts/ABBA_BABA.conf delete mode 100644 scripts/ABBA_BABA.sh delete mode 100644 scripts/ADMIX.conf delete mode 100644 scripts/ADMIX.sh delete mode 100644 scripts/F.conf delete mode 100644 scripts/F.sh delete mode 100644 scripts/FASTA.conf delete mode 100644 scripts/FASTA.sh delete mode 100644 scripts/FST.conf delete mode 100644 scripts/FST.sh delete mode 100644 scripts/GL.conf delete mode 100644 scripts/GL.sh delete mode 100644 scripts/PCA.conf delete mode 100644 scripts/PCA.sh delete mode 100644 scripts/SFS.conf delete mode 100644 scripts/SFS.sh delete mode 100644 scripts/THETAS.conf delete mode 100644 scripts/THETAS.sh delete mode 100644 scripts/common.conf delete mode 100644 scripts/shiny/server.R delete mode 100644 scripts/shiny/ui.R delete mode 100644 scripts/utils.sh diff --git a/scripts/2DSFS.conf b/scripts/2DSFS.conf deleted file mode 100644 index 41a5275..0000000 --- a/scripts/2DSFS.conf +++ /dev/null @@ -1,15 +0,0 @@ -# Declare 2dSFS-specific parameters here. -# common configuration variables are stored in common.conf -# Which two taxa to compute? -TAXON1= -TAXON2= -# These are files that contain the list of BAM files and inbreeding coeff. -TAXON_LIST1=${DATA_DIR}/${TAXON1}_samples.txt -TAXON_INBREEDING1=${DATA_DIR}/${TAXON1}_F.txt -TAXON_LIST2=${DATA_DIR}/${TAXON2}_samples.txt -TAXON_INBREEDING2=${DATA_DIR}/${TAXON2}_F.txt -# What region? -REGIONS= -# If you would like to change the default parameters of the analysis, -# you may declare the appropriate variables below. -# See 2DSFS.sh for all possible parameters and their defaults diff --git a/scripts/2DSFS.sh b/scripts/2DSFS.sh deleted file mode 100644 index ec21202..0000000 --- a/scripts/2DSFS.sh +++ /dev/null @@ -1,249 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -u - -# Source the common configuration file -source scripts/common.conf -# load utils functions -source ${SCRIPTS_DIR}/utils.sh - -#Defaults -DO_SAF=2 -UNIQUE_ONLY=0 -MIN_BASEQUAL=20 -BAQ=1 -MIN_IND1=1 -MIN_IND2=1 -GT_LIKELIHOOD=2 -MIN_MAPQ=30 -N_CORES=16 -DO_MAJORMINOR=1 -DO_MAF=1 -OVERRIDE=false - -# load variables from supplied config file -load_config $1 - -#check if regions exist -if [[ ${REGIONS} == */*]]; then - if file_exists "${REGIONS}" && file_not_empty "${REGIONS}"; then - >&2 echo "WRAPPER: regions file exists and not empty, starting analysis..." - elif variable_exists "${REGIONS}"; then - >&2 echo "WRAPPER: regions variable set, starting analysis..." - else - >&2 echo "WRAPPER: regions not set, file does not exist, or file is empty. Exiting..." >&2; exit 1 - fi -fi - -#check if inbreeding coefficients fileS exist -if file_exists "${TAXON_INBREEDING1}" && file_not_empty "${TAXON_INBREEDING1}"; then - >&2 echo "WRAPPER: Inbreeding file for taxon 1 exists and is not empty, continuing..." -else - >&2 echo "WRAPPER: Inbreeding file for taxon 1 does not exist or is empty. Exiting..." >&2; exit 1 -fi - -if file_exists "${TAXON_INBREEDING2}" && file_not_empty "${TAXON_INBREEDING2}"; then - >&2 echo "WRAPPER: Inbreeding file for taxon 2 exists and is not empty, continuing..." -else - >&2 echo "WRAPPER: Inbreeding file for taxon 2 does not exist or is empty. Exiting..." >&2; exit 1 -fi - -# calculated variables -N_IND1=`wc -l < ${TAXON_LIST1}` -N_CHROM1=`expr 2 \* ${N_IND1}` -N_IND2=`wc -l < ${TAXON_LIST2}` -N_CHROM2=`expr 2 \* ${N_IND2}` - -# For 1st taxon -if file_exists "${RESULTS_DIR}/${TAXON1}_Intergenic.saf" && [ "$OVERRIDE" = "false" ]; then - >&2 echo "WRAPPER: saf already exists and OVERRIDE=false, skipping angsd -bam..." -elif [[ ${REGIONS} == */* ]]; then - >&2 echo "WRAPPER: $TAXON1 sfs starting..." - ${ANGSD_DIR}/angsd\ - -bam ${TAXON_LIST1}\ - -out ${RESULTS_DIR}/${TAXON1}_Intergenic\ - -doMajorMinor ${DO_MAJORMINOR}\ - -doMaf ${DO_MAF}\ - -indF ${TAXON_INBREEDING1}\ - -doSaf ${DO_SAF}\ - -uniqueOnly ${UNIQUE_ONLY}\ - -anc ${ANC_SEQ}\ - -minMapQ ${MIN_MAPQ}\ - -minQ ${MIN_BASEQUAL}\ - -nInd ${N_IND1}\ - -minInd ${MIN_IND1}\ - -baq ${BAQ}\ - -ref ${REF_SEQ}\ - -GL ${GT_LIKELIHOOD}\ - -P ${N_CORES}\ - -rf ${REGIONS} -else - >&2 echo "WRAPPER: $TAXON1 sfs starting" - ${ANGSD_DIR}/angsd\ - -bam ${TAXON_LIST1}\ - -out ${RESULTS_DIR}/${TAXON1}_Intergenic\ - -doMajorMinor ${DO_MAJORMINOR}\ - -doMaf ${DO_MAF}\ - -indF ${TAXON_INBREEDING1}\ - -doSaf ${DO_SAF}\ - -uniqueOnly ${UNIQUE_ONLY}\ - -anc ${ANC_SEQ}\ - -minMapQ ${MIN_MAPQ}\ - -minQ ${MIN_BASEQUAL}\ - -nInd ${N_IND1}\ - -minInd ${MIN_IND1}\ - -baq ${BAQ}\ - -ref ${REF_SEQ}\ - -GL ${GT_LIKELIHOOD}\ - -P ${N_CORES}\ - -r ${REGIONS} -fi - -# For 2nd taxon: -if file_exists "${RESULTS_DIR}/${TAXON2}_Intergenic.saf" && [ "$OVERRIDE" = "false" ]; then - >&2 echo "WRAPPER: saf already exists and OVERRIDE=false, skipping angsd -bam..." -elif [[ ${REGIONS} == */* ]]; then - >&2 echo "WRAPPER: $TAXON2 sfs starting..." - ${ANGSD_DIR}/angsd\ - -bam ${TAXON_LIST2}\ - -out ${RESULTS_DIR}/${TAXON2}_Intergenic\ - -doMajorMinor ${DO_MAJORMINOR}\ - -doMaf ${DO_MAF}\ - -indF ${TAXON_INBREEDING2}\ - -doSaf ${DO_SAF}\ - -uniqueOnly ${UNIQUE_ONLY}\ - -anc ${ANC_SEQ}\ - -minMapQ ${MIN_MAPQ}\ - -minQ ${MIN_BASEQUAL}\ - -nInd ${N_IND2}\ - -minInd ${MIN_IND2}\ - -baq ${BAQ}\ - -ref ${REF_SEQ}\ - -GL ${GT_LIKELIHOOD}\ - -P ${N_CORES}\ - -rf ${REGIONS} -else - >&2 echo "WRAPPER: $TAXON2 sfs starting..." - ${ANGSD_DIR}/angsd\ - -bam ${TAXON_LIST2}\ - -out ${RESULTS_DIR}/${TAXON2}_Intergenic\ - -doMajorMinor ${DO_MAJORMINOR}\ - -doMaf ${DO_MAF}\ - -indF ${TAXON_INBREEDING2}\ - -doSaf ${DO_SAF}\ - -uniqueOnly ${UNIQUE_ONLY}\ - -anc ${ANC_SEQ}\ - -minMapQ ${MIN_MAPQ}\ - -minQ ${MIN_BASEQUAL}\ - -nInd ${N_IND2}\ - -minInd ${MIN_IND2}\ - -baq ${BAQ}\ - -ref ${REF_SEQ}\ - -GL ${GT_LIKELIHOOD}\ - -P ${N_CORES}\ - -r ${REGIONS} -fi - -#find intersecting regions ->&2 echo "WRAPPER: making intersect file..." -gunzip -c ${RESULTS_DIR}/${TAXON1}_Intergenic.saf.pos ${RESULTS_DIR}/${TAXON2}_Intergenic.saf.pos | sort | uniq -d | sort -k1,1 > ${RESULTS_DIR}/intersect.${TAXON1}.${TAXON2}_intergenic.txt - -# calculate allele frequencies only on sites in both populations -if [[ ${REGIONS} == */* ]]; then - >&2 echo "WRAPPER: $TAXON1 sfs round 2..." - ${ANGSD_DIR}/angsd\ - -bam ${TAXON_LIST1}\ - -out ${RESULTS_DIR}/${TAXON1}_Intergenic_Conditioned\ - -doMajorMinor ${DO_MAJORMINOR}\ - -doMaf ${DO_MAF}\ - -indF ${TAXON_INBREEDING1}\ - -doSaf ${DO_SAF}\ - -uniqueOnly ${UNIQUE_ONLY}\ - -anc ${ANC_SEQ}\ - -minMapQ ${MIN_MAPQ}\ - -minQ ${MIN_BASEQUAL}\ - -nInd ${N_IND1}\ - -minInd ${MIN_IND1}\ - -baq ${BAQ}\ - -ref ${REF_SEQ}\ - -GL ${GT_LIKELIHOOD}\ - -P ${N_CORES}\ - -rf ${REGIONS}\ - -sites ${RESULTS_DIR}/intersect.${TAXON1}.${TAXON2}_intergenic.txt -else - >&2 echo "WRAPPER: $TAXON1 sfs round 2..." - ${ANGSD_DIR}/angsd\ - -bam ${TAXON_LIST1}\ - -out ${RESULTS_DIR}/${TAXON1}_Intergenic_Conditioned\ - -doMajorMinor ${DO_MAJORMINOR}\ - -doMaf ${DO_MAF}\ - -indF ${TAXON_INBREEDING1}\ - -doSaf ${DO_SAF}\ - -uniqueOnly ${UNIQUE_ONLY}\ - -anc ${ANC_SEQ}\ - -minMapQ ${MIN_MAPQ}\ - -minQ ${MIN_BASEQUAL}\ - -nInd ${N_IND1}\ - -minInd ${MIN_IND1}\ - -baq ${BAQ}\ - -ref ${REF_SEQ}\ - -GL ${GT_LIKELIHOOD}\ - -P ${N_CORES}\ - -r ${REGIONS}\ - -sites ${RESULTS_DIR}/intersect.${TAXON1}.${TAXON2}_intergenic.txt -fi - -if [[ ${REGIONS} == */* ]]; then - >&2 echo "WRAPPER: $TAXON2 sfs round 2..." - ${ANGSD_DIR}/angsd\ - -bam ${TAXON_LIST2}\ - -out ${RESULTS_DIR}/${TAXON2}_Intergenic_Conditioned\ - -doMajorMinor ${DO_MAJORMINOR}\ - -doMaf ${DO_MAF}\ - -indF ${TAXON_INBREEDING2}\ - -doSaf ${DO_SAF}\ - -uniqueOnly ${UNIQUE_ONLY}\ - -anc ${ANC_SEQ}\ - -minMapQ ${MIN_MAPQ}\ - -minQ ${MIN_BASEQUAL}\ - -nInd ${N_IND2}\ - -minInd ${MIN_IND2}\ - -baq ${BAQ}\ - -ref ${REF_SEQ}\ - -GL ${GT_LIKELIHOOD}\ - -P ${N_CORES}\ - -rf ${REGIONS}\ - -sites ${RESULTS_DIR}/intersect.${TAXON1}.${TAXON2}_intergenic.txt -else - >&2 echo "WRAPPER: $TAXON2 sfs round 2..." - ${ANGSD_DIR}/angsd\ - -bam ${TAXON_LIST2}\ - -out ${RESULTS_DIR}/${TAXON2}_Intergenic_Conditioned\ - -doMajorMinor ${DO_MAJORMINOR}\ - -doMaf ${DO_MAF}\ - -indF ${TAXON_INBREEDING2}\ - -doSaf ${DO_SAF}\ - -uniqueOnly ${UNIQUE_ONLY}\ - -anc ${ANC_SEQ}\ - -minMapQ ${MIN_MAPQ}\ - -minQ ${MIN_BASEQUAL}\ - -nInd ${N_IND2}\ - -minInd ${MIN_IND2}\ - -baq ${BAQ}\ - -ref ${REF_SEQ}\ - -GL ${GT_LIKELIHOOD}\ - -P ${N_CORES}\ - -r ${REGIONS}\ - -sites ${RESULTS_DIR}/intersect.${TAXON1}.${TAXON2}_intergenic.txt -fi - -# estimate joint SFS using realSFS ->&2 echo "WRAPPER: realSFS 2dsfs..." -${ANGSD_DIR}/misc/realSFS 2dsfs\ - ${RESULTS_DIR}/${TAXON1}_Intergenic_Conditioned.saf\ - ${RESULTS_DIR}/${TAXON2}_Intergenic_Conditioned.saf\ - ${N_CHROM1}\ - ${N_CHROM2}\ - -P ${N_CORES}\ - > ${RESULTS_DIR}/2DSFS_Intergenic.${TAXON1}.${TAXON2}.sfs diff --git a/scripts/ABBA_BABA.conf b/scripts/ABBA_BABA.conf deleted file mode 100644 index c3bd7dd..0000000 --- a/scripts/ABBA_BABA.conf +++ /dev/null @@ -1,4 +0,0 @@ -TAXON= -TAXON_LIST=${DATA_DIR}/${TAXON}_samples.txt -OUTGROUP= -DO_CONSENSUS= diff --git a/scripts/ABBA_BABA.sh b/scripts/ABBA_BABA.sh deleted file mode 100644 index ece8853..0000000 --- a/scripts/ABBA_BABA.sh +++ /dev/null @@ -1,87 +0,0 @@ -#! /usr/bin/env bash - -set -e -set -u - -source scripts/Common_Variables.conf - -source ${SCRIPTS_DIR}/utils.sh - -DO_FASTA=2 -DO_COUNTS=1 -DO_ABBABABA=1 -UNIQUE_ONLY=0 -MIN_BASEQUAL=20 -BAQ=1 -MIN_IND=1 -MIN_MAPQ=30 -N_CORES=32 -CHECK_BAM_HEADERS=0 -BLOCKSIZE=1000 - - -load_config $1 - -#check if regions exist -if [[ ${REGIONS} == */*]]; then - if file_exists "${REGIONS}" && file_not_empty "${REGIONS}"; then - >&2 echo "WRAPPER: regions file exists and not empty, starting analysis..." - elif variable_exists "${REGIONS}"; then - >&2 echo "WRAPPER: regions variable set, starting analysis..." - else - >&2 echo "WRAPPER: regions not set, file does not exist, or file is empty. Exiting..." >&2; exit 1 - fi -fi - -# extract consensus sequence of Tripsacum to be treated as outgroup -#angsd -doFasta 2 -doCounts 1 -i Tripsacum.bam -out Tripsacum -if [[ ${DO_CONSENSUS} == 1 ]]; then - ${ANGSD_DIR}/angsd \ - -doFasta ${DO_FASTA}\ - -doCounts ${DO_COUNTS}\ - -i ${OUTGROUP}\ - -out ${RESULTS_DIR}/${TAXON} -fi - -#-checkBamHeaders 0 -rf scaffoldNamesWithData.txt -#Those two flags are important, as in Tripsacum some small scaffolds have no reads mapped on. In that case, the consensus sequence file of Tripsacum (Tripsacum.fa) will have no sequence for those scaffolds. -#While those scaffold exist in the three ingroup bam files, angsd will scream "chromosome length inconsistency error". -#-checkBamHeaders 0 just ask it to skip checking the bam headers. The analyzed chromosomes are given by "-rf scaffoldNamesWithData.txt", which is generated by "cut -f1 Tripsacum.fa.fai" (the first column of samtools faidxed Tripsacum.fa file) -#-bam P3_luxurians.txt simply gives the directory of the three ingroup bam files -if [[ ${REGIONS} == */* ]]; then - ${ANGSD_DIR}/angsd \ - -doAbbababa ${DO_ABBABABA}\ - -blockSize ${BLOCKSIZE}\ - -doCounts ${DO_COUNTS}\ - -anc ${ANC_SEQ}\ - -bam ${TAXON_LIST}\ - -uniqueOnly ${UNIQUE_ONLY}\ - -minMapQ ${MIN_MAPQ}\ - -minQ ${MIN_BASEQUAL}\ - -minInd ${MIN_IND}\ - -P ${N_CORES}\ - -checkBamHeaders ${CHECK_BAM_HEADERS}\ - -rf ${REGIONS}\ - -out ${RESULTS_DIR}/${TAXON}.D -else - ${ANGSD_DIR}/angsd \ - -doAbbababa ${DO_ABBABABA}\ - -blockSize ${BLOCKSIZE}\ - -doCounts ${DO_COUNTS}\ - -anc ${ANC_SEQ}\ - -bam ${TAXON_LIST}\ - -uniqueOnly ${UNIQUE_ONLY}\ - -minMapQ ${MIN_MAPQ}\ - -minQ ${MIN_BASEQUAL}\ - -minInd ${MIN_IND}\ - -P ${N_CORES}\ - -checkBamHeaders ${CHECK_BAM_HEADERS}\ - -r ${REGIONS}\ - -out ${RESULTS_DIR}/${TAXON}.D -fi - -#jackKnife.R is provided with angsd. -Rscript ${ANGSD_DIR}/R/jackKnife.R \ - file=${RESULTS_DIR}/${TAXON}.D.abbababa\ - indNames=${TAXON_LIST}\ - outfile=${RESULTS_DIR}/${TAXON}.abbababa diff --git a/scripts/ADMIX.conf b/scripts/ADMIX.conf deleted file mode 100644 index cd6a269..0000000 --- a/scripts/ADMIX.conf +++ /dev/null @@ -1,2 +0,0 @@ -TAXON= -K= diff --git a/scripts/ADMIX.sh b/scripts/ADMIX.sh deleted file mode 100644 index b6ec5ec..0000000 --- a/scripts/ADMIX.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -u - -# source the common config file -source scripts/common.conf -# load utils functions -source ${SCRIPTS_DIR}/utils.sh - -K=5 -N_CORES=32 -MIN_MAF=0.05 - -load_config $1 - -LIKELIHOOD=${RESULTS_DIR}/${TAXON}_SFSOut.beagle.gz - -for ((k=2; k<=K; k++)) -do - echo "Calculating for K="$k - ${NGS_POPGEN_DIR}/NGSadmix\ - -likes ${LIKELIHOOD}\ - -K ${k}\ - -P ${N_CORES}\ - -o ${RESULTS_DIR}/${TAXON}.${k}\ - -minMaf ${MIN_MAF} -done diff --git a/scripts/F.conf b/scripts/F.conf deleted file mode 100644 index eae9f35..0000000 --- a/scripts/F.conf +++ /dev/null @@ -1,3 +0,0 @@ -TAXON=test -TAXON_LIST=${DATA_DIR}/${TAXON}_samples.txt - diff --git a/scripts/F.sh b/scripts/F.sh deleted file mode 100644 index 0b7ba77..0000000 --- a/scripts/F.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -u - -# Source the common configuration file -source scripts/common.conf -# load utils functions -source ${SCRIPTS_DIR}/utils.sh - -#Defaults -MIN_BASEQUAL=20 -GT_LIKELIHOOD=1 -DO_GLF=3 -MIN_MAPQ=30 -N_CORES=32 -DO_MAJORMINOR=1 -DO_MAF=1 -SNP_PVAL=1e-6 -OVERRIDE=false -SEED=12345 -MIN_EPSILON=1e-9 - -# load variables from supplied config file -load_config $1 -N_IND=`wc -l < ${TAXON_LIST}` - -#check if regions exist -if [[ ${REGIONS} == */* ]]; then - if file_exists "${REGIONS}" && file_not_empty "${REGIONS}"; then - >&2 echo "WRAPPER: regions file exists and not empty, starting analysis..." - elif variable_exists "${REGIONS}"; then - >&2 echo "WRAPPER: regions variable set, starting analysis..." - else - >&2 echo "WRAPPER: regions not set, file does not exist, or file is empty. Exiting..." >&2; exit 1 - fi -fi - -if [[ ${REGIONS} == */* ]]; then - ${ANGSD_DIR}/angsd \ - -bam ${TAXON_LIST}\ - -rf ${REGIONS}\ - -doGLF ${DO_GLF}\ - -GL ${GT_LIKELIHOOD}\ - -out ${RESULTS_DIR}/${TAXON}\ - -ref ${REF_SEQ}\ - -anc ${ANC_SEQ}\ - -doMaf ${DO_MAF}\ - -SNP_pval ${SNP_PVAL}\ - -doMajorMinor ${DO_MAJORMINOR}\ - -minMapQ ${MIN_MAPQ}\ - -minQ ${MIN_BASEQUAL}\ - -nThreads ${N_CORES} -else - ${ANGSD_DIR}/angsd \ - -bam ${TAXON_LIST}\ - -r ${REGIONS}\ - -doGLF ${DO_GLF}\ - -GL ${GT_LIKELIHOOD}\ - -out ${RESULTS_DIR}/${TAXON}\ - -ref ${REF_SEQ}\ - -anc ${ANC_SEQ}\ - -doMaf ${DO_MAF}\ - -SNP_pval ${SNP_PVAL}\ - -doMajorMinor ${DO_MAJORMINOR}\ - -minMapQ ${MIN_MAPQ}\ - -minQ ${MIN_BASEQUAL}\ - -nThreads ${N_CORES} -fi - -N_SITES=$((`zcat ${RESULTS_DIR}/${TAXON}.mafs.gz | wc -l`-1)) - - -zcat ${RESULTS_DIR}/${TAXON}.glf.gz | ./ngsF/ngsF \ - -n_ind ${N_IND}\ - -n_sites ${N_SITES}\ - -min_epsilon ${MIN_EPSILON}\ - -glf -\ - -out ${RESULTS_DIR}/${TAXON}.approx_indF\ - -approx_EM\ - -seed ${SEED}\ - -init_values r\ - -n_threads ${N_CORES} - -zcat ${RESULTS_DIR}/${TAXON}.glf.gz | ./ngsF/ngsF \ - -n_ind ${N_IND}\ - -n_sites ${N_SITES}\ - -min_epsilon ${MIN_EPSILON}\ - -glf -\ - -out ${RESULTS_DIR}/${TAXON}.indF\ - -init_values ${RESULTS_DIR}/${TAXON}.approx_indF.pars\ - -n_threads ${N_CORES} - diff --git a/scripts/FASTA.conf b/scripts/FASTA.conf deleted file mode 100644 index 0408d33..0000000 --- a/scripts/FASTA.conf +++ /dev/null @@ -1,2 +0,0 @@ -# Enter the BAM file containing the ancestral sequence you want to use -ANC_BAM= diff --git a/scripts/FASTA.sh b/scripts/FASTA.sh deleted file mode 100644 index 70d06ef..0000000 --- a/scripts/FASTA.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -u - -# Source the common configuration file -source scripts/common.conf -# load utils functions -source ${SCRIPTS_DIR}/utils.sh - - ${ANGSD_DIR}/angsd \ - -i ${ANC_BAM}\ - -doFasta 1 diff --git a/scripts/FST.conf b/scripts/FST.conf deleted file mode 100644 index a7cf6cd..0000000 --- a/scripts/FST.conf +++ /dev/null @@ -1,23 +0,0 @@ -# NOTE: configured for use in conjunction with 2DSFS.sh -# If you haven't run that yet, run that first -# If you already have run ANGSD to obtain a 2DSFS, -# make sure you have these files named in this way: -# POP1_SFS=${RESULTS_DIR}/${TAXON1}_Intergenic_Conditioned -# POP2_SFS=${RESULTS_DIR}/${TAXON2}_Intergenic_Conditioned -# INTERSECT=${RESULTS_DIR}/intersect.${TAXON1}.${TAXON2}_intergenic.txt -# 2DSFS=${RESULTS_DIR}/2DSFS_Intergenic.${TAXON1}.${TAXON2}.sfs - -# You will already have these if you run 2DSFS.sh beforehand - -# ngsFST specific configuration variables go in this file. -# common configuration variables are in common.conf - -# If you would like to change the default parameters of the analysis, -# you may declare the appropriate variables below. -# See NGS_FST.sh for all possible parameters and their defaults - -# Make sure your taxa are in the same order as they were in 2DSFS.sh - -TAXON1= -TAXON2= -BLOCK_SIZE= diff --git a/scripts/FST.sh b/scripts/FST.sh deleted file mode 100644 index e155a5b..0000000 --- a/scripts/FST.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -u - -# source common config file -source scripts/common.conf -# load utils functions -source ${SCRIPTS_DIR}/utils.sh - -#Need to have run 2DSFS or have files in correct name format - -DO_SAF=2 -UNIQUE_ONLY=0 -MIN_BASEQUAL=20 -BAQ=1 -MIN_IND1=1 -MIN_IND2=1 -GT_LIKELIHOOD=2 -MIN_MAPQ=30 -N_CORES=16 -DO_MAJORMINOR=1 -DO_MAF=1 -BLOCK_SIZE=20000 - -load_config $1 - -TAXON1_LIST=${DATA_DIR}/${TAXON1}_samples.txt -TAXON2_LIST=${DATA_DIR}/${TAXON2}_samples.txt -POP1_SFS=${RESULTS_DIR}/${TAXON1}_Intergenic_Conditioned.saf -POP2_SFS=${RESULTS_DIR}/${TAXON2}_Intergenic_Conditioned.saf -INTERSECT=${RESULTS_DIR}/intersect.${TAXON1}.${TAXON2}_intergenic.txt -TWODSFS=${RESULTS_DIR}/2DSFS_Intergenic.${TAXON1}.${TAXON2}.sfs - -N_IND_1=`wc -l < ${TAXON1_LIST}` -N_IND_2=`wc -l < ${TAXON2_LIST}` - -#check for sfs, intersect file, and 2dsfs from 2DSFS.sh -#exit with error if any don't exist -if file_exists "${POP1_SFS}"; then - >&2 echo "WRAPPER: saf for ${TAXON1} exists, continuing to check for ${TAXON2} saf..." -else >&2 echo "WRAPPER: saf for ${TAXON1} does not exist, exiting..." >&2; exit 1 -fi - -if file_exists "${POP2_SFS}"; then - >&2 echo "WRAPPER: saf for ${TAXON2} exists, continuing to check for intersect..." -else >&2 echo "WRAPPER: saf for ${TAXON2} does not exist, exiting..." >&2; exit 1 -fi - -if file_exists "${INTERSECT}"; then - >&2 echo "WRAPPER: intersect exists, continuing to check for 2dsfs..." -else >&2 echo "WRAPPER: intersect does not exist, exiting..." >&2; exit 1 -fi - -if file_exists "${TWODSFS}"; then - >&2 echo "WRAPPER: 2dsfs exists, continuing to check for intersect..." -else >&2 echo "WRAPPER: 2dsfs does not exist, exiting..." >&2; exit 1 -fi - -# get number of sites and individuals -N_SITES=`wc -l ${INTERSECT} | cut -f 1 -d " "` - -# convert ANGSD 2DSFS for ngsPopGen use -Rscript ${SCRIPTS_DIR}/convertSFS.R ${TWODSFS}\ - > ${RESULTS_DIR}/2DSFS_Intergenic.${TAXON1}.${TAXON2}.converted.sfs - -# get FST -# this is what needs the new ngsPopGen -# make sure to change this path when wrapper is updated -${NGS_TOOLS_DIR}/ngsPopGen/ngsFST\ - -postfiles ${POP1_SFS} ${POP2_SFS}\ - -priorfile ${RESULTS_DIR}/2DSFS_Intergenic.${TAXON1}.${TAXON2}.converted.sfs\ - -nind ${N_IND_1} ${N_IND_2}\ - -nsites ${N_SITES}\ - -outfile ${RESULTS_DIR}/${TAXON1}.${TAXON2}.fst diff --git a/scripts/GL.conf b/scripts/GL.conf deleted file mode 100644 index 9a5fb9c..0000000 --- a/scripts/GL.conf +++ /dev/null @@ -1,3 +0,0 @@ -TAXON= -TAXON_LIST=${DATA_DIR}/${TAXON}_samples.txt -TAXON_INBREEDING=${DATA_DIR}/${TAXON}_F.txt diff --git a/scripts/GL.sh b/scripts/GL.sh deleted file mode 100644 index a1176a9..0000000 --- a/scripts/GL.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env bash -set -e -set -u - -# Source the common configuration file -source scripts/common.conf -# load utils functions -source ${SCRIPTS_DIR}/utils.sh - -DO_MAJORMINOR=1 -UNIQUE_ONLY=0 -MIN_MAPQ=30 -MIN_BASEQUAL=20 -GT_LIKELIHOOD=2 -DO_GENO=7 -DO_POST=1 -POST_CUTOFF=0.95 -DO_MAF=2 -SNP_PVAL=1e-6 -MIN_IND=1 -N_CORES=32 - -load_config $1 - -#check if regions exist -if [[ ${REGIONS} == */*]]; then - if file_exists "${REGIONS}" && file_not_empty "${REGIONS}"; then - >&2 echo "WRAPPER: regions file exists and not empty, starting analysis..." - elif variable_exists "${REGIONS}"; then - >&2 echo "WRAPPER: regions variable set, starting analysis..." - else - >&2 echo "WRAPPER: regions not set, file does not exist, or file is empty. Exiting..." >&2; exit 1 - fi -fi - -N_IND=`wc -l < ${TAXON_LIST}` - -if [[ ${REGIONS} == */* ]]; then - >&2 echo "WRAPPER: $TAXON GL starting..." - ${ANGSD_DIR}/angsd\ - -bam ${TAXON_LIST}\ - -out ./results/${TAXON}_snps\ - -doMajorMinor ${DO_MAJORMINOR}\ - -uniqueOnly ${UNIQUE_ONLY}\ - -minMapQ ${MIN_MAPQ}\ - -minQ ${MIN_BASEQUAL}\ - -GL ${GT_LIKELIHOOD}\ - -rf ${REGIONS}\ - -doGeno ${DO_GENO}\ - -doPost ${DO_POST}\ - -postCutoff ${POST_CUTOFF}\ - -doMaf ${DO_MAF}\ - -SNP_pval ${SNP_PVAL}\ - -nInd ${N_IND}\ - -minInd ${MIN_IND}\ - -P ${N_CORES} -else - >&2 echo "WRAPPER: $TAXON GL starting" - ${ANGSD_DIR}/angsd\ - -bam ${TAXON_LIST}\ - -out ./results/${TAXON}_snps\ - -doMajorMinor ${DO_MAJORMINOR}\ - -uniqueOnly ${UNIQUE_ONLY}\ - -minMapQ ${MIN_MAPQ}\ - -minQ ${MIN_BASEQUAL}\ - -GL ${GT_LIKELIHOOD}\ - -r ${REGIONS}\ - -doGeno ${DO_GENO}\ - -doPost ${DO_POST}\ - -postCutoff ${POST_CUTOFF}\ - -doMaf ${DO_MAF}\ - -SNP_pval ${SNP_PVAL}\ - -nInd ${N_IND}\ - -minInd ${MIN_IND}\ - -P ${N_CORES} diff --git a/scripts/PCA.conf b/scripts/PCA.conf deleted file mode 100644 index fd2e26e..0000000 --- a/scripts/PCA.conf +++ /dev/null @@ -1,2 +0,0 @@ -TAXON= -TAXON_LIST=${DATA_DIR}/${TAXON}_samples.txt diff --git a/scripts/PCA.sh b/scripts/PCA.sh deleted file mode 100644 index 9d132d8..0000000 --- a/scripts/PCA.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -u - -# Source the common configuration file -source scripts/common.conf -# load utils functions -source ${SCRIPTS_DIR}/utils.sh - -DO_MAF=2 -DO_MAJORMINOR=1 -DO_GENO=32 -DO_POST=1 -N_CORES=8 -CALL=0 -GT_LIKELIHOOD=1 -N_SITES=100000 - -load_config $1 - -N_IND=`wc -l < ${TAXON_LIST}` - -#check if regions exist -if [[ ${REGIONS} == */* ]]; then - if file_exists "${REGIONS}" && file_not_empty "${REGIONS}"; then - >&2 echo "WRAPPER: regions file exists and not empty, starting analysis..." - elif variable_exists "${REGIONS}"; then - >&2 echo "WRAPPER: regions variable set, starting analysis..." - else - >&2 echo "WRAPPER: regions not set, file does not exist, or file is empty. Exiting..." >&2; exit 1 - fi -fi - -if [[ ${REGIONS} == */* ]]; then - ${ANGSD_DIR}/angsd \ - -bam ${TAXON_LIST}\ - -GL ${GT_LIKELIHOOD}\ - -out ${RESULTS_DIR}/${TAXON}_PCA\ - -doMajorMinor ${DO_MAJORMINOR}\ - -doMaf ${DO_MAF}\ - -doGeno ${DO_GENO}\ - -doPost ${DO_POST}\ - -nInd ${N_IND}\ - -P ${N_CORES}\ - -rf ${REGIONS} -else - ${ANGSD_DIR}/angsd \ - -bam ${TAXON_LIST}\ - -GL ${GT_LIKELIHOOD}\ - -out ${RESULTS_DIR}/${TAXON}_PCA\ - -doMajorMinor ${DO_MAJORMINOR}\ - -doMaf ${DO_MAF}\ - -doGeno ${DO_GENO}\ - -doPost ${DO_POST}\ - -nInd ${N_IND}\ - -P ${N_CORES}\ - -r ${REGIONS} -fi - -gunzip ${RESULTS_DIR}/${TAXON}_PCA.geno.gz - -${NGS_POPGEN_DIR}/ngsCovar \ - -probfile ${RESULTS_DIR}/${TAXON}_PCA.geno\ - -outfile ${RESULTS_DIR}/${TAXON}_PCA.covar\ - -nind ${N_IND}\ - -nsites ${N_SITES}\ - -call ${CALL} diff --git a/scripts/SFS.conf b/scripts/SFS.conf deleted file mode 100644 index 7cc2782..0000000 --- a/scripts/SFS.conf +++ /dev/null @@ -1,11 +0,0 @@ -# SFS specific variables go here. -# common configuration variables are in common.conf -# The file containing the list of samples to analyze with ANGSD -# We split it up by "taxon" because it is one way to think about how to -# partition the data -TAXON=test -TAXON_LIST=${DATA_DIR}/${TAXON}_samples.txt -TAXON_INBREEDING=${DATA_DIR}/${TAXON}_F.txt -# If you would like to change the default parameters of the analysis, -# you may declare the appropriate variables below. -# See SFS.sh for all possible parameters and their defaults diff --git a/scripts/SFS.sh b/scripts/SFS.sh deleted file mode 100644 index 2cc5215..0000000 --- a/scripts/SFS.sh +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -u - -# Source the common configuration file -source scripts/common.conf -# load utils functions -source ${SCRIPTS_DIR}/utils.sh - -#Defaults -DO_SAF=2 -UNIQUE_ONLY=0 -MIN_BASEQUAL=20 -BAQ=1 -MIN_IND=1 -GT_LIKELIHOOD=2 -DO_GLF=2 -MIN_MAPQ=30 -N_CORES=32 -DO_MAJORMINOR=1 -DO_GENO=32 -DO_MAF=1 -OVERRIDE=false - -# load variables from supplied config file -load_config $1 -#load_config ${SCRIPTS_DIR}/common.conf - -#check if regions exist -if [[ ${REGIONS} == */* ]]; then - if file_exists "${REGIONS}" && file_not_empty "${REGIONS}"; then - >&2 echo "WRAPPER: regions file exists and not empty, starting analysis..." - elif variable_exists "${REGIONS}"; then - >&2 echo "WRAPPER: regions variable set, starting analysis..." - else - >&2 echo "WRAPPER: regions not set, file does not exist, or file is empty. Exiting..." >&2; exit 1 - fi -fi - -#check if inbreeding coefficients file exists -if file_exists "${TAXON_INBREEDING}" && file_not_empty "${TAXON_INBREEDING}"; then - >&2 echo "WRAPPER: Inbreeding file for taxon exists and is not empty, continuing..." -else - >&2 echo "WRAPPER: Inbreeding file for taxon does not exist or is empty. Exiting..." >&2; exit 1 -fi - -# Variables created from transforming other variables -# The number of individuals in the taxon we are analyzing -# We use an embedded command to do this -# ( wc -l < FILE will return just the line count of FILE, -# rather than the line count and the filename. More efficient than piping -# to a separate 'cut' process!) -N_IND=`wc -l < ${TAXON_LIST}` -# How many inbreeding coefficients are supplied? -N_F=`wc -l < ${TAXON_INBREEDING}` -# For ANGSD, the actual sample size is twice the number of individuals, since -# each individual has two chromosomes. The individual inbreeding coefficents -# take care of the mismatch between these two numbers -N_CHROM=`expr 2 \* ${N_IND}` - -# Perform a little check - if the length of the inbreeding coefficients -# does not match the number of individuals, then exit with an error -if [ "${N_IND}" -ne "${N_F}" ] - then echo "Mismatch between number of samples in ${TAXON_LIST} and ${TAXON_INBREEDING}"; exit 1 -fi - -# if directories don't exist, create them -#if directory_exists ./results; then #if comparison doesn't like the ${RESLTS_DIR} var being used -# echo "directories exist, skipping init.sh"; -#else -# echo "creating directories..."; - #bash ${SCRIPTS_DIR}/init.sh; #init.sh throws an error. skip this script and just exit -# exit 1 -#fi - -# Now we actually run the command, this creates a binary file that contains the prior SFS -if file_exists "./results/${TAXON}_SFSOut.mafs.gz" && [ "$OVERRIDE" = "false" ]; then - echo "maf already exists and OVERRIDE=false, skipping angsd -bam..."; -else - if [[ ${REGIONS} == */* ]]; then - ${ANGSD_DIR}/angsd \ - -bam ${TAXON_LIST}\ - -out ${RESULTS_DIR}/${TAXON}_SFSOut\ - -indF ${TAXON_INBREEDING}\ - -doSaf ${DO_SAF}\ - -uniqueOnly ${UNIQUE_ONLY}\ - -anc ${ANC_SEQ}\ - -minMapQ ${MIN_MAPQ}\ - -minQ ${MIN_BASEQUAL}\ - -nInd ${N_IND}\ - -minInd ${MIN_IND}\ - -baq ${BAQ}\ - -ref ${REF_SEQ}\ - -GL ${GT_LIKELIHOOD}\ - -doGlf ${DO_GLF}\ - -P ${N_CORES}\ - -doMajorMinor $DO_MAJORMINOR\ - -doMaf $DO_MAF\ - -doGeno ${DO_GENO}\ - -rf ${REGIONS} - else - ${ANGSD_DIR}/angsd \ - -bam ${TAXON_LIST}\ - -out results/${TAXON}_SFSOut\ - -indF ${TAXON_INBREEDING}\ - -doSaf ${DO_SAF}\ - -uniqueOnly ${UNIQUE_ONLY}\ - -anc ${ANC_SEQ}\ - -minMapQ ${MIN_MAPQ}\ - -minQ ${MIN_BASEQUAL}\ - -nInd ${N_IND}\ - -minInd ${MIN_IND}\ - -baq ${BAQ}\ - -ref ${REF_SEQ}\ - -GL ${GT_LIKELIHOOD}\ - -doGlf ${DO_GLF}\ - -P ${N_CORES}\ - -doMajorMinor $DO_MAJORMINOR\ - -doMaf $DO_MAF\ - -r ${REGIONS} - fi -fi - -${ANGSD_DIR}/misc/realSFS\ - ${RESULTS_DIR}/${TAXON}_SFSOut.saf\ - ${N_CHROM}\ - -P ${N_CORES}\ - > ${RESULTS_DIR}/${TAXON}_DerivedSFS \ No newline at end of file diff --git a/scripts/THETAS.conf b/scripts/THETAS.conf deleted file mode 100644 index 08bf060..0000000 --- a/scripts/THETAS.conf +++ /dev/null @@ -1,10 +0,0 @@ -# I think I'd break these two things out into additional variables -# and build up the path from $HOME -TAXON= -TAXON_LIST=${DATA_DIR}/${TAXON}_samples.txt -TAXON_INBREEDING=${DATA_DIR}/${TAXON}_F.txt -PEST=${RESULTS_DIR}/${TAXON}_DerivedSFS -# If you would like to change the default parameters of the analysis, -# you may declare the appropriate variables below. -# See THETAS.sh for all possible parameters and their defaults - diff --git a/scripts/THETAS.sh b/scripts/THETAS.sh deleted file mode 100644 index c46e754..0000000 --- a/scripts/THETAS.sh +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -u - -# source the common config file -source scripts/common.conf -# load utils functions -source ${SCRIPTS_DIR}/utils.sh - -#Defaults -DO_SAF=2 -UNIQUE_ONLY=0 -MIN_BASEQUAL=20 -BAQ=1 -MIN_IND=1 -GT_LIKELIHOOD=2 -MIN_MAPQ=30 -N_CORES=32 -DO_MAJORMINOR=1 -DO_MAF=1 -DO_THETAS=1 -OVERRIDE=false -SLIDING_WINDOW=false -WIN=50000 -STEP=10000 - -# load variables from supplied config file -load_config $1 -#source scripts/common.conf - -#check if regions exist -if [[ ${REGIONS} == */*]]; then - if file_exists "${REGIONS}" && file_not_empty "${REGIONS}"; then - >&2 echo "WRAPPER: regions file exists and not empty, starting analysis..." - elif variable_exists "${REGIONS}"; then - >&2 echo "WRAPPER: regions variable set, starting analysis..." - else - >&2 echo "WRAPPER: regions not set, file does not exist, or file is empty. Exiting..." >&2; exit 1 - fi -fi - -#check if inbreeding coefficients file exists -if file_exists "${TAXON_INBREEDING}" && file_not_empty "${TAXON_INBREEDING}"; then - >&2 echo "WRAPPER: Inbreeding file for taxon exists and is not empty, continuing..." -else - >&2 echo "WRAPPER: Inbreeding file for taxon does not exist or is empty. Exiting..." >&2; exit 1 -fi - -# Variables created from transforming other variables -# The number of individuals in the taxon we are analyzing -# We use an embedded command to do this -# ( wc -l < FILE will return just the line count of FILE, -# rather than the line count and the filename. More efficient than piping -# to a separate 'cut' process!) -N_IND=`wc -l < ${TAXON_LIST}` -# For ANGSD, the actual sample size is twice the number of individuals, since -# each individual has two chromosomes. The individual inbreeding coefficents -# take care of the mismatch between these two numbers -N_CHROM=`expr 2 \* ${N_IND}` - -# if directories don't exist, create them -#if directory_exists "${RESULTS_DIR}"; then -# echo "directories exist, skipping init.sh"; -#else -# echo "creating directories..."; -# bash ${SCRIPTS_DIR}/init.sh; -#fi - - -if file_exists "${RESULTS_DIR}/${TAXON}_Diversity.mafs.gz" && [ "$OVERRIDE" = "false" ]; then - echo "maf already exists and OVERRIDE=false, skipping angsd -bam..."; -else - # Now we actually run the command, this creates a binary file that contains the prior SFS - if [[ ${REGIONS} == */* ]]; then #if regions contains a / (is a path) then it's probably a region file. Therefore, use -rf - ${ANGSD_DIR}/angsd \ - -bam ${TAXON_LIST}\ - -out ${RESULTS_DIR}/${TAXON}_Diversity\ - -indF ${TAXON_INBREEDING}\ - -doSaf ${DO_SAF}\ - -doThetas ${DO_THETAS}\ - -uniqueOnly ${UNIQUE_ONLY}\ - -anc ${ANC_SEQ}\ - -minMapQ ${MIN_MAPQ}\ - -minQ ${MIN_BASEQUAL}\ - -nInd ${N_IND}\ - -minInd ${MIN_IND}\ - -baq ${BAQ}\ - -ref ${REF_SEQ}\ - -GL ${GT_LIKELIHOOD}\ - -P ${N_CORES}\ - -doMajorMinor $DO_MAJORMINOR\ - -doMaf $DO_MAF\ - -pest ${PEST}\ - -rf ${REGIONS} - else - ${ANGSD_DIR}/angsd \ - -bam ${TAXON_LIST}\ - -out ${RESULTS_DIR}/${TAXON}_Diversity\ - -indF ${TAXON_INBREEDING}\ - -doSaf ${DO_SAF}\ - -doThetas ${DO_THETAS}\ - -uniqueOnly ${UNIQUE_ONLY}\ - -anc ${ANC_SEQ}\ - -minMapQ ${MIN_MAPQ}\ - -minQ ${MIN_BASEQUAL}\ - -nInd ${N_IND}\ - -minInd ${MIN_IND}\ - -baq ${BAQ}\ - -ref ${REF_SEQ}\ - -GL ${GT_LIKELIHOOD}\ - -P ${N_CORES}\ - -doMajorMinor $DO_MAJORMINOR\ - -doMaf $DO_MAF\ - -pest ${PEST}\ - -r ${REGIONS} - fi -fi - - -${ANGSD_DIR}/misc/thetaStat make_bed\ - ${RESULTS_DIR}/${TAXON}_Diversity.thetas.gz -# ${RESULTS_DIR}/${TAXON}_Tajimas - -if [ "$SLIDING_WINDOW" = "false" ]; then - ${ANGSD_DIR}/misc/thetaStat do_stat\ - ${RESULTS_DIR}/${TAXON}_Diversity.thetas.gz\ - -nChr ${N_CHROM} -else - ${ANGSD_DIR}/misc/thetaStat do_stat\ - ${RESULTS_DIR}/${TAXON}_Diversity.thetas.gz\ - -nChr ${N_CHROM}\ - -win ${WIN}\ - -step ${STEP} -fi diff --git a/scripts/common.conf b/scripts/common.conf deleted file mode 100644 index 5380bd1..0000000 --- a/scripts/common.conf +++ /dev/null @@ -1,28 +0,0 @@ -# angsd-wrapper common configuration file -# Declare top-level variables in bash syntax here - -# Where all the scripts and data are stored -PROJECT_DIR=${HOME}/ -# Where ANGSD is stored -ANGSD_DIR=${PROJECT_DIR}/angsd -# Where the scripts are stored -SCRIPTS_DIR=${PROJECT_DIR}/scripts -# Where we will store results -RESULTS_DIR=${PROJECT_DIR}/results -# A temporary directory -#TEMP_DIR=${PROJECT_DIR}/temp -# Where we will store data -DATA_DIR=${PROJECT_DIR}/data -# Where ngsPopGen is stored -NGS_POPGEN_DIR=${PROJECT_DIR}/ngsPopGen - -# Reference genome sequence -REF_SEQ= -# Ancestral sequence -ANC_SEQ= -# Which regions? -# This can be either a chromosomal region in the form of chr:start-stop, -# or the path to the file containing a list of regions in the same format, one per line -REGIONS= -# Overwrite previous results? -OVERRIDE= diff --git a/scripts/shiny/server.R b/scripts/shiny/server.R deleted file mode 100644 index 3bb548a..0000000 --- a/scripts/shiny/server.R +++ /dev/null @@ -1,612 +0,0 @@ -library(shiny) -library(genomeIntervals) -library(lattice) -library(Hmisc) -library(ape) -library(data.table) -options(shiny.maxRequestSize = -1) - -# Assign headers to thetas, Fst and intersect data -thetas.headers <- c("(indexStart,indexStop)(firstPos_withData,lastPos_withData)(WinStart,WinStop)","Chr","WinCenter","tW","tP","tF","tH","tL","Tajima","fuf","fud","fayh","zeng","nSites") -fst.headers <- c("A", "AB", "f", "FST", "Pvar") -intersect.headers <- c("Chr","bp") -sfs.headers <- c("Allele Frequency") - -thetas <- fread("C:/Users/Chaochih/angsd-wrapper/shinyGraphing/BKN_Diversity.thetas.gz.pestPG", sep = "\t") - -#thetasTest <- fread("C:/Users/Chaochih/Dropbox/ANGSD_Wrapper/angsd-wrapper_test/Thetas/ANGSD_test_Diversity.thetas.gz.pestPG", sep = "\t") - -not.loaded <- TRUE - -# Define server logic required to draw a histogram -shinyServer( - - - function(input, output) { - - # Thetas input data - dataInputThetas = reactive({ - data <- input$userThetas - path <- as.character(data$datapath) - thetas <- fread(input=path, sep="\t") - setnames(thetas,thetas.headers) - return(thetas) - }) - - # Subset of Thetas data frame -# thetas$"(indexStart,indexStop)(firstPos_withData,lastPos_withData)(WinStart,WinStop)" -# thetas$Chr -# thetas$WinCenter -# thetas$tW -# thetas$tP -# thetas$tF -# thetas$tH -# thetas$tL -# thetas$"Tajima" -# thetas$fuf -# thetas$fud -# thetas$fayh -# thetas$zeng -# thetas$nSites - - # SFS input data - dataInputSFS = reactive({ - data <- input$userSFS - path <- as.character(data$datapath) - Derived <- as.matrix(read.table(input=path, header = FALSE)) - sfs <- as.data.frame(t(Derived)) - names(sfs) <- c("Allele_frequency") - #sfs <- sfs[3:nrow(x=sfs)-1, ] - sfs <- exp(scan(path)) - return(sfs) - - }) - - # Fst input data - dataInputFst = reactive({ - data <- input$userFst - path <- as.character(data$datapath) - fst <- read.table(file=path, - sep="\t", - col.names=fst.headers - ) - return(fst) - }) - - # Intersect input data - dataInputIntersect = reactive({ - data <- input$userIntersect - path <- as.character(data$datapath) - intersect <- read.table(file=path, - sep="\t", - col.names=intersect.headers - ) - return(intersect) - }) - - # Admixture input data - dataInputAdmix = reactive({ - data <- input$userAdmix - path <- as.character(data$datapath) - admix <- t(as.matrix(read.table(path))) - return(admix) - - }) - - # ABBA BABA test input data - dataInputABBABABA = reactive({ - data <- input$userABBABABA - path <- as.character(data$datapath) - ABBABABA <- read.table(path, sep="\t", header=T) - return(ABBABABA) - - }) - - # PCA plot input data - dataInputPCA = reactive({ - data <- input$userPCA - path <- as.character(data$datapath) - PCA <- read.table(path, header=F) - return(PCA) - }) - - # GFF file input - gffInput = reactive({ - data <- input$userAnnotations - path <- as.character(data$datapath) - gff <- readGff3(path) - - return(gff) - - }) - - - # Output data - output$thetaChroms = renderUI({ - if(is.null(input$userThetas)){ - choices <- 10 - } - else{ - thetas <- dataInputThetas() - choices <- unique(thetas$Chr) - } - selectInput('thetaChrom', 'Chromosome to plot', - choices, - multiple = TRUE) - }) - - # Create zoomable plots - ranges <- reactiveValues(x = NULL, y = NULL) - - # Create reactive plot on left side of page - output$thetaPlot1 <- renderPlot({ - # error handling code to provide a default dataset to graph - thetas <- tryCatch({ - dataInputThetas() - }, error = function(err) { - thetas <- read.table(file="BKN_Diversity.thetas.gz.pestPG", - sep="\t", - col.names=thetas.headers) - } - ) - - thetas <- subset(thetas,Chr==input$thetaChrom) - if(input$annotations){ - validate(need(input$userAnnotations, 'Need GFF file before clicking checkbox!')) - gff <- gffInput() - gff.gene <- subset(gff, type="gene") - gff.df <- data.frame(gff.gene,annotation(gff)) - gff.df.chr <- subset(gff.df, seq_name==thetas$Chr[1]) - if(length(gff.df.chr$seq_name)==0){ - stop("Annotation does not match graphed region. Please make sure the first column of your GFF file matches the Chr column of the .pestPG file.") - } - gff.df.gene <- subset(gff.df.chr, type=="gene") - } - - if(input$subset) { - thetas.plot <- subset(thetas, WinCenter > input$WinCenterLow & WinCenter < input$WinCenterHigh) - } - else { - thetas.plot <- thetas - } - - # remove nsites=0 - thetas.plot <- subset(thetas.plot, nSites != 0) - # remove data points with less than 50 sites. Calculate minimum from data? - if(input$rm.nsites) { - thetas.plot <- subset(thetas.plot, nSites > input$nsites) - } - #divide thetas by the number of sites in each window - thetas.plot$tW <- thetas.plot$tW/thetas.plot$nSites - thetas.plot$tP <- thetas.plot$tP/thetas.plot$nSites - thetas.plot$tF <- thetas.plot$tF/thetas.plot$nSites - thetas.plot$tH <- thetas.plot$tH/thetas.plot$nSites - thetas.plot$tL <- thetas.plot$tW/thetas.plot$nSites - - data <- switch(input$thetaChoice, - "Watterson's Theta" = thetas.plot$tW, - "Pairwise Theta" = thetas.plot$tP, - "Fu and Li's Theta" = thetas.plot$tF, - "Fay's Theta" = thetas.plot$tH, - "Maximum likelihood (L) Theta" = thetas.plot$tL - ) - if(input$annotations) { - plot(thetas.plot$WinCenter, - data, t="p", pch=19,col=rgb(0,0,0,0.5), - xlab="Position (bp)", - ylab=paste(input$thetaChoice,"Estimator Value"), - main=paste("Estimators of theta along chromosome", thetas$Chr[1]) - ) - - rug(rect(gff.df.gene$X1, -1e2, gff.df.gene$X2, 0, col=rgb(0.18,0.55,0.8,0.75), border=NA)) - if(input$thetaLowess){lines(lowess(thetas.plot$WinCenter,data, f=0.1), col="red")} - } - else { - plot(thetas.plot$WinCenter, - data, t="p", pch=19,col=rgb(0,0,0,0.5), - xlab="Position (bp)", - ylab=paste(input$thetaChoice,"Estimator Value"), - main=paste("Estimators of theta along chromosome", thetas$Chr[1]) - ) - if(input$thetaLowess){lines(lowess(thetas.plot$WinCenter,data, f=0.1), col="red")} - } - }) - - # Create reactive plot that zooms in on right side - output$thetaPlot2 <- renderPlot({ - # error handling code to provide a default dataset to graph - thetas <- tryCatch({ - dataInputThetas() - }, error = function(err) { - thetas <- read.table(file="BKN_Diversity.thetas.gz.pestPG", - sep="\t", - col.names=thetas.headers) - } - ) - - thetas <- subset(thetas,Chr==input$thetaChrom) - if(input$annotations){ - validate(need(input$userAnnotations, 'Need GFF file before clicking checkbox!')) - gff <- gffInput() - gff.gene <- subset(gff, type="gene") - gff.df <- data.frame(gff.gene,annotation(gff)) - gff.df.chr <- subset(gff.df, seq_name==thetas$Chr[1]) - if(length(gff.df.chr$seq_name)==0){ - stop("Annotation does not match graphed region. Please make sure the first column of your GFF file matches the Chr column of the .pestPG file.") - } - gff.df.gene <- subset(gff.df.chr, type=="gene") - } - - if(input$subset) { - thetas.plot <- subset(thetas, WinCenter > input$WinCenterLow & WinCenter < input$WinCenterHigh) - } - else { - thetas.plot <- thetas - } - - # remove nsites=0 - thetas.plot <- subset(thetas.plot, nSites != 0) - # remove data points with less than 50 sites. Calculate minimum from data? - if(input$rm.nsites) { - thetas.plot <- subset(thetas.plot, nSites > input$nsites) - } - #divide thetas by the number of sites in each window - thetas.plot$tW <- thetas.plot$tW/thetas.plot$nSites - thetas.plot$tP <- thetas.plot$tP/thetas.plot$nSites - thetas.plot$tF <- thetas.plot$tF/thetas.plot$nSites - thetas.plot$tH <- thetas.plot$tH/thetas.plot$nSites - thetas.plot$tL <- thetas.plot$tW/thetas.plot$nSites - - data <- switch(input$thetaChoice, - "Watterson's Theta" = thetas.plot$tW, - "Pairwise Theta" = thetas.plot$tP, - "Fu and Li's Theta" = thetas.plot$tF, - "Fay's Theta" = thetas.plot$tH, - "Maximum likelihood (L) Theta" = thetas.plot$tL - ) - if(input$annotations) { - plot(thetas.plot$WinCenter, - data, t="p", pch=19,col=rgb(0,0,0,0.5), - xlab="Position (bp)", - ylab=paste(input$thetaChoice,"Estimator Value"), - main=paste("Estimators of theta along chromosome", thetas$Chr[1]) - ) - - rug(rect(gff.df.gene$X1, -1e2, gff.df.gene$X2, 0, col=rgb(0.18,0.55,0.8,0.75), border=NA)) - if(input$thetaLowess){lines(lowess(thetas.plot$WinCenter,data, f=0.1), col="red")} - } - else { - plot(thetas.plot$WinCenter, - data, t="p", pch=19,col=rgb(0,0,0,0.5), - xlab="Position (bp)", - ylab=paste(input$thetaChoice,"Estimator Value"), - main=paste("Estimators of theta along chromosome", - thetas$Chr[1]), - xlim = ranges$x, ylim = ranges$y - ) - if(input$thetaLowess){lines(lowess(thetas.plot$WinCenter,data, f=0.1), col="red")} - } - }) - - # Creating zoom function in thetasPlot1 and thetasPlot2 - observe({ - brush <- input$thetaPlot1_brush - if (!is.null(brush)) { - ranges$x <- c(brush$xmin, brush$xmax) - ranges$y <- c(brush$ymin, brush$ymax) - - } else { - ranges$x <- NULL - ranges$y <- NULL - } - }) - - # Creating reactive plot for selectionPlot1 and selectionPlot2 - ranges2 <- reactiveValues(x = NULL, y = NULL) - - # selectionPlot1 - output$selectionPlot1 <- renderPlot({ - # error handling code to provide a default dataset to graph - thetas <- tryCatch({ - dataInputThetas() - }, error = function(err) { - thetas <- read.table(file="BKN_Diversity.thetas.gz.pestPG", - sep="\t", - col.names=thetas.headers - ) - } - ) - - - thetas <- subset(thetas,Chr==input$thetaChrom) - - if(input$subset) { - thetas.plot <- subset(thetas, WinCenter > input$WinCenterLow & WinCenter < input$WinCenterHigh) - } - else { - thetas.plot <- thetas - } - - # remove nsites=0 - thetas.plot <- subset(thetas.plot, nSites != 0) - - data <- switch(input$selectionChoice, - "Tajima's D" = thetas.plot$Tajima, - "Fu and Li's F" = thetas.plot$fuf, - "Fu and Li's D" = thetas.plot$fud, - "Fay and Wu's H" = thetas.plot$fayh, - "Zeng's E" = thetas.plot$zeng - ) - - plot(thetas.plot$WinCenter, - data, t="p", pch=19,col=rgb(0,0,0,0.5), - xlab="Position (bp)", - ylab=input$selectionChoice, - main=paste("Neutrality test statistics along chromosome", thetas$Chr[1]) - ) - if(input$selectionLowess){lines(lowess(thetas.plot$WinCenter,data, f=0.1), col="red")} - }) - - # selectionPlot2 - output$selectionPlot2 <- renderPlot({ - # error handling code to provide a default dataset to graph - thetas <- tryCatch({ - dataInputThetas() - }, error = function(err) { - thetas <- read.table(file="BKN_Diversity.thetas.gz.pestPG", - sep="\t", - col.names=thetas.headers - ) - } - ) - - - thetas <- subset(thetas,Chr==input$thetaChrom) - - if(input$subset) { - thetas.plot <- subset(thetas, WinCenter > input$WinCenterLow & WinCenter < input$WinCenterHigh) - } - else { - thetas.plot <- thetas - } - - # remove nsites=0 - thetas.plot <- subset(thetas.plot, nSites != 0) - - data <- switch(input$selectionChoice, - "Tajima's D" = thetas.plot$Tajima, - "Fu and Li's F" = thetas.plot$fuf, - "Fu and Li's D" = thetas.plot$fud, - "Fay and Wu's H" = thetas.plot$fayh, - "Zeng's E" = thetas.plot$zeng - ) - - plot(thetas.plot$WinCenter, - data, t="p", pch=19,col=rgb(0,0,0,0.5), - xlab="Position (bp)", - ylab=input$selectionChoice, - main=paste("Neutrality test statistics along chromosome", thetas$Chr[1]), - xlim = ranges2$x, ylim = ranges2$y - ) - if(input$selectionLowess){lines(lowess(thetas.plot$WinCenter,data, f=0.1), col="red")} - }) - - # Creating zoom function in selectionPlot1 and selectionPlot2 - observe({ - brush <- input$selectionPlot1_brush - if (!is.null(brush)) { - ranges2$x <- c(brush$xmin, brush$xmax) - ranges2$y <- c(brush$ymin, brush$ymax) - - } else { - ranges2$x <- NULL - ranges2$y <- NULL - } - }) - - # Fst Plot - output$fstChroms = renderUI({ - if(is.null(input$userIntersect)){ - choices <- 12 - } - else{ - intersect <- dataInputIntersect() - choices <- unique(intersect$Chr) - } - selectInput('fstChrom', 'Chromosome to plot', choices) - }) - - output$fstMin = renderUI({ - if(is.null(input$userIntersect)){ - min <- 10944 - max <- 27530233 - } - else{ - intersect <- dataInputIntersect() - min <- min(intersect$bp) - max <- max(intersect$bp) - } - numericInput("intersectLow", "Base Start Position", value=min, min = min, max=max-1) - }) - - output$fstMax = renderUI({ - if(is.null(input$userIntersect)){ - min <- 10944 - max <- 27530233 - } - else{ - intersect <- dataInputIntersect() - min <- min(intersect$bp) - max <- max(intersect$bp) - } - numericInput("intersectHigh", "Base Start Position", value=min+10000, min=min+1, max=max) - }) - - output$fstPlot <- renderPlot({ - #error handling code to provide a default dataset to graph - fst <- tryCatch({ - dataInputFst() - }, error = function(err) { - fst <- fread("allo.indica.fst", - sep="\t") - }) - intersect <- tryCatch({ - dataInputIntersect() - }, error = function(err) { - intersect <- fread("intersect.allo.indica_intergenic.txt", - sep="\t") - }) - setnames(fst,fst.headers) - setnames(intersect,intersect.headers) - fst.intersect <- cbind(intersect,fst) - fst.intersect <- subset(fst.intersect, Chr==input$fstChrom) - fst.intersect <- subset(fst.intersect, FST>=0 & FST<=1) - - if(input$annotations){ - validate(need(input$userAnnotations, 'Need GFF file before clicking checkbox!')) - gff <- gffInput() - gff.gene <- subset(gff, type="gene") - gff.df <- data.frame(gff.gene,annotation(gff)) - gff.df.gene <- subset(gff.df, type=="gene") - } - - if(input$subset) { - fst.plot <- subset(fst.intersect, bp >= input$intersectLow & bp <= input$intersectHigh) - } - else { - fst.plot <- fst.intersect - } - - if(input$annotations) { - plot(fst.plot$bp, - fst.plot$FST, t="p", pch=19,col=rgb(0,0,0,0.5), - xlab="Position (bp)", - ylab="Fst", - main=paste("Fst along chromosome") - ) - rug(rect(gff.df.gene$X1, - -1e2, gff.df.gene$X2, - 0, - col=rgb(0.18,0.55,0.8,0.75), - border=NA)) - if(input$fstLowess){lines(lowess(fst.plot$bp, - fst.plot$FST, - f=0.1), - col="red")} - } - else { - plot(fst.plot$bp, - fst.plot$FST, - t="p", - pch=19, - col=rgb(0,0,0,0.5), - xlab="Position (bp)", - ylab=paste("Fst"), - main=paste("Fst along chromosome", fst.plot$Chr[1]) - ) - if(input$fstLowess){lines(lowess(fst.plot$bp, fst.plot$FST, - f=0.1), - col="red")} - } - }) - - output$SFSPlot <- renderPlot({ - sfs <- tryCatch({ - dataInputSFS() - - },error = function(err) { - sfs <- exp(scan("sfs_example.txt")) - }) -# subsfs <- sfs[-c(1,length(sfs))]/sum(sfs[-c(1,length(sfs))]) - -# Changed "Chromosome" for x axis label to "Derived Allele Frequency" ### Temporarily comment out Arun's version of the plot -# barplot(subsfs, xlab="Derived Allele Frequency", -# ylab="Proportion of SNPs", -# main="Site Frequency Spectrum", -# names=1:length(sfs[-c(1,length(sfs))]), -# col="#A2C8EC", border=NA) - barplot(exp(sfs), - xaxt = "n", - xlab = "Derived Allele Frequency", - ylab = "Proportion of SNPs", - main = "Site Frequency Spectrum", - offset = 0, - xlim = NULL, - ylim = NULL, - las = 1, - pch = 18, - xpd = TRUE) - axis.x <- axis(1, at= 1:23, labels = numeric(), lwd = 2) - axis.y <- axis(side = 2, at = , labels = numeric(), - lwd = 1, lwd.ticks = 1, - outer = FALSE, yaxt = "n") - - }) - - output$admixPlot <- renderPlot({ - admix <- tryCatch({ - dataInputAdmix() - - },error = function(err) { - admix<-t(as.matrix(read.table("ngsadmix_example.txt"))) - }) - barplot(admix,col=c("#006BA4","#FF800E","#A2C8EC","#898989","#ABABAB","#595959","#5F9ED1","#CFCFCF","#FFBC79","#C85200"),space=0,border=NA,xlab="Individuals",ylab="admixture proportion") - - }) - - output$ABBABABATree <- renderPlot({ - ABBABABA <- tryCatch({ - dataInputABBABABA() - }, error = function(err){ - ABBABABA <- read.table("abbababa.test", sep="\t", header=T) - }) - d.current <- subset(ABBABABA, H2 == input$h2 & H3 == input$h3) - tree <- read.tree(text=paste("(Outgroup,(", input$h3, ",(", input$h2, ",Taxon)));", sep="")) - plot(tree, type = "cladogram", edge.width = 2, direction='downwards') - - }) - output$ABBABABAPlot <- renderPlot({ - ABBABABA <- tryCatch({ - dataInputABBABABA() - }, error = function(err){ - ABBABABA <- read.table("abbababa.test", sep="\t", header=T) - }) - d.current <- subset(ABBABABA, H2 == input$h2 & H3 == input$h3) - mypanel.Dotplot <- function(x, y, ...) { - panel.Dotplot(x,y,...) - tips <- attr(x, "other") - panel.abline(v=0, lty=3) - trellis.par.set(mfrow=c(2,1)) - panel.arrows(x0 = tips[,1], y0 = y, - x1 = tips[,2], y1 = y, - length = 0.05, unit = "native", - angle = 90, code = 3) - } - Dotplot(factor(d.current$H1) ~ Cbind(d.current$Dstat,d.current$Dstat-d.current$SE,d.current$Dstat+d.current$SE), col="blue", pch=20, panel = mypanel.Dotplot, - xlab="D",ylab="Taxon", title=paste("D statistic comparison where H2=", input$h2, " and H3=", input$h3, sep="")) - - }) - - output$PCAPlot <- renderPlot({ - PCA <- tryCatch({ - dataInputPCA() - - },error = function(err) { - PCA <- read.table("all.pop.covar", header=F) - }) - eig <- eigen(PCA, symm=TRUE); - eig$val <- eig$val/sum(eig$val); - PC <- as.data.frame(eig$vectors) - plot(PC$V1, PC$V2, pch=19, col=rgb(0,0,0,0.4),xlab="PC1", ylab="PC2", main="ngsCovar Results",asp=1) - }) - - output$pacBio <- renderText({ - if(input$fastaChoice=='Yes'){ - text <- "Glad to hear it!" - } - if(input$fastaChoice=='No'){ - text <- "Perhaps your reads are too short. Have you considered PacBio?" - } - return(text) - }) - }) diff --git a/scripts/shiny/ui.R b/scripts/shiny/ui.R deleted file mode 100644 index f464040..0000000 --- a/scripts/shiny/ui.R +++ /dev/null @@ -1,217 +0,0 @@ -library(shiny) - -shinyUI(fluidPage( - # Application title - titlePanel("ANGSD-wrapper graph"), - tabsetPanel( - - # Tab 1 - tabPanel("Thetas", - sidebarLayout( - sidebarPanel( - headerPanel("Thetas Graphs", - windowTitle = "Thetas Graphs"), - # Choose input file - fileInput('userThetas', - label= "Choose '.pestPG' Thetas File" - ), - - # Watterson's theta - selectInput("thetaChoice", - # Need to specify file to choose - label = "Choose estimator of theta to graph", - choices = c("Watterson's Theta", "Pairwise Theta", "Fu and Li's Theta", "Fay's Theta", "Maximum likelihood (L) Theta"), - selected = "Watterson's Theta" - ), - - # Tajima's D - selectInput("selectionChoice", - label = "Choose a neutrality test statistic to graph", - choices = c("Tajima's D", "Fi and Li's D", "Fu and Li's F", "Fay and Wu's H", "Zeng's E"), - selected = "Tajima's D" - ), - uiOutput('thetaChroms'), - hr(), - checkboxInput("thetaLowess", - "Theta Lowess", - value=FALSE), - checkboxInput("selectionLowess", - "Neutrality Test Statistic Lowess", - value=FALSE), - hr(), - numericInput("WinCenterLow", - "Base Start Position", - value=0), - numericInput("WinCenterHigh", - "Base End Position", - value=10000), - checkboxInput("subset", - "Toggle subset data", - value=FALSE), - hr(), - checkboxInput("rm.nsites", - "Remove data where nSites < x", - value=FALSE), - numericInput("nsites", - "x:", - value=0), - - hr(), - fileInput('userAnnotations', - label= "Choose '.gff' File" - ), - checkboxInput("annotations", - "Toggle GFF annotations", - value=FALSE) - ), - # Show a plot of the thetas - mainPanel( - fluidRow( - column( - width = 12, height = 300, - h3("Click and drag to select area to zoom on this plot"), - plotOutput("thetaPlot1", - dblclick = "thetaPlot1_dblclick", - brush = brushOpts(id = "thetaPlot1_brush", - resetOnNew = TRUE)) - - ), - column( - width = 12, height = 300, - h3("Plot will zoom in on area selected above"), - plotOutput("thetaPlot2") - - ), - column( - width = 12, height = 300, - h3("Click and drag to select area to zoom on this plot"), - plotOutput("selectionPlot1", - dblclick = "selectionPlot1_dblclick", - brush = brushOpts(id = "selectionPlot1_brush", - resetOnNew = TRUE)) - ), - column( - width = 12, height = 300, - h3("Plot will zoom in on area selected above"), - plotOutput("selectionPlot2") - ) - ) - ) - ) - ), - - # Tab 2 - tabPanel( - "SFS", - sidebarLayout( - sidebarPanel( - headerPanel("Site Frequency Spectrum", - windowTitle = "SFS Graph"), - fileInput('userSFS', - label= "Choose '_DerivedSFS' SFS File" - ) - - ), - mainPanel( - plotOutput("SFSPlot") - ) - ) - ), - - # Tab 3 - tabPanel( - "ABBA BABA", - sidebarLayout( - sidebarPanel( - fileInput('userABBABABA', - label= "Choose 'abbababa.txt' ABBABABA File" - ), - textInput('h2', label="H2", value='NA11993'), - textInput('h3', label="H3", value='NA12763') - - ), - mainPanel( - plotOutput("ABBABABATree"), - plotOutput("ABBABABAPlot"), - helpText(a("https://youtu.be/unfzfe8f9NI", - href="https://youtu.be/unfzfe8f9NI")) - ) - ) - ), - tabPanel( - "Fst", - sidebarLayout( - sidebarPanel( - fileInput('userFst', - label= "Choose '.fst' Fst File" - ), - fileInput('userIntersect', - label= 'Choose Intersect File' - ), - - uiOutput('fstChroms'), - - hr(), - checkboxInput("fstLowess", - "Fst Lowess", - value=FALSE), - hr(), - - uiOutput('fstMin'), - uiOutput('fstMax'), - - checkboxInput("subset", - "Toggle subset data", - value=FALSE), - - hr(), - fileInput('userAnnotations', - label= 'Choose GFF File' - ), - checkboxInput("annotations", - "Toggle GFF annotations", - value=FALSE) - - ), - mainPanel( - plotOutput("fstPlot") - ) - ) - ), - tabPanel( - "PCA", - sidebarLayout( - sidebarPanel( - fileInput('userPCA', - label= "Choose a '_PCA.covar' File" - ) - ), - mainPanel( - plotOutput("PCAPlot"), - width=4 - ) - ) - ), - tabPanel( - "Admixture", - sidebarLayout( - sidebarPanel( - fileInput('userAdmix', - label= "Choose '.qopt' admixture File"), - numericInput("k", - "Number of K ancestral populations to graph:", - 1, - min = 1, - max = 10) - - ), - mainPanel( - plotOutput("admixPlot") - - ) - ) - ) - #end of tabsetPanel - ) -) -) \ No newline at end of file diff --git a/scripts/utils.sh b/scripts/utils.sh deleted file mode 100644 index 6742912..0000000 --- a/scripts/utils.sh +++ /dev/null @@ -1,49 +0,0 @@ -file_exists() { - if [[ -f "$1" ]] - then - return 0 - echo $1" exists!" - else - return 1 - echo $1" does not exist!" - fi -} - -file_not_empty() { - if [[ -s "$1" ]] - then - return 0 - echo $1" not empty!" - else - return 1 - echo $1" empty!" - fi -} - -directory_exists() { - if [[ -d "$1" ]] - then - return 0 - echo $1" exists!" - else - return 1 - echo $1" does not exist!" - fi -} - -variable_exists() { - if [[ -n "$1" ]] - then - return 0 - echo $1" exists!" - else - return 1 - echo $1" does not exist!" - fi -} - -load_config() { - - source $1 - -}