Skip to content

Commit

Permalink
Port node coloring setup over to local chunk script
Browse files Browse the repository at this point in the history
  • Loading branch information
adamnovak authored Sep 27, 2023
1 parent e269899 commit 88de97e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion scripts/prepare_local_chunk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ function usage() {
exit 1
}

while getopts x:g:r:o:d: flag
while getopts x:g:r:o:d:n: flag
do
case "${flag}" in
x) GRAPH_FILE=${OPTARG};;
g) GAM_FILES+=("$OPTARG");;
r) REGION=${OPTARG};;
o) OUTDIR=${OPTARG};;
d) DESC="${OPTARG}";;
n) NODE_COLORS="${OPTARG}";;
*)
usage
;;
Expand Down Expand Up @@ -54,6 +55,7 @@ fi
echo >&2 "Graph File: " $GRAPH_FILE
echo >&2 "Region: " $REGION
echo >&2 "Output Directory: " $OUTDIR
echo >&2 "Node colors: " $NODE_COLORS

rm -fr $OUTDIR
mkdir -p $OUTDIR
Expand Down Expand Up @@ -92,6 +94,15 @@ for GAM_FILE in "${GAM_FILES[@]}"; do
GAM_NUM=$((GAM_NUM + 1))
done

# construct node file
if [[ ! -z "${NODE_COLORS}" ]] ; then
node_names_arr=($NODE_COLORS);
for NODENAME in "${node_names_arr[@]}"; do
echo >&2 "$NODENAME"
printf "$NODENAME\n" >> $OUTDIR/nodeColors.tsv
done
fi

# Make the empty but required annotation file. We have no haplotypes to put in it.
touch "${OUTDIR}/chunk_0_${REGION_CONTIG}_${REGION_START}_${REGION_END}.annotate.txt"
printf "\tchunk_0_${REGION_CONTIG}_${REGION_START}_${REGION_END}.annotate.txt\n" >> $OUTDIR/regions.tsv
Expand Down

0 comments on commit 88de97e

Please sign in to comment.