Skip to content

Instantly share code, notes, and snippets.

@lindenb
Last active January 31, 2018 19:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lindenb/4465c0e822b175f3428029526beef80c to your computer and use it in GitHub Desktop.
Save lindenb/4465c0e822b175f3428029526beef80c to your computer and use it in GitHub Desktop.
zenity interface for vcffilterjdk/jvarkit https://www.biostars.org/p/296145/ zenity gui
#!/bin/bash
set -e
code=$(mktemp --suffix .code -t tmp.XXXXXXXXXX)
function cleanup {
rm -vf "${code}"
}
trap cleanup EXIT
INVCF=$(zenity --file-selection --title="Select input VCF" --file-filter "*.vcf *.vcf.gz")
OUTVCF=$(zenity --save --confirm-overwrite --file-selection --title="Select output VCF" --file-filter "*.vcf *.vcf.gz")
if [ "${INVCF}" == "${OUTVCF}" ]; then
zenity --title="ERROR" --error --text="input same as output (${INVCF})"
exit -1
fi
zenity --width=1000 --title="CODE" --entry --text="Java Code" --entry-text="return variant.getStart()%10==0;" > ${code}
## set the correct path
java -jar /set/the/path/to/vcffilterjdk.jar -o "${OUTVCF}" -f "${code}" ${INVCF}
zenity --title="DONE" --info --text="Done:${OUTVCF}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment