Skip to content

Commit

Permalink
Merge branch 'dev' of git.illumina.com:Bioinformatics/hap.py into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Krusche committed Sep 23, 2016
2 parents d91aa74 + ccc512e commit 984d201
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 14 deletions.
9 changes: 9 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Hap.py Release Notes / Change Log

## v0.3.3

| Ticket | Description |
|---------|------------------------------------------------------------------------------------|
| HAP-232 | Fix help text in hap.py and pre.py |
| HAP-233 | INFO fields don't get mixed up in preprocessing anymore |
| HAP-234 | Forward unstructured headers through hap.py |
| HAP-236 | Fix quanitify test to work with compressed outputs |

## v0.3.2

| Ticket | Description |
Expand Down
1 change: 1 addition & 0 deletions src/c++/lib/variant/VariantAlleleSplitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ bool VariantAlleleSplitter::advance()
}
cur.pos = p.rv.start;
cur.len = p.rv.end - p.rv.start + 1;
cur.infos = p.infos;
}
for(auto const & m : p.infos.getMemberNames())
{
Expand Down
4 changes: 2 additions & 2 deletions src/c++/lib/variant/VariantWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ namespace variant
int idx = bcf_hrec_find_key(hrec, "ID");
if ( idx < 0 )
{
// no ID => skip
bcf_hrec_destroy(hrec);
// no ID => pass on
bcf_hdr_add_hrec(hdr, hrec);
continue;
}

Expand Down
6 changes: 3 additions & 3 deletions src/python/Tools/vcfcallerinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ def addVCF(self, vcfname):
tf.close()
vfh = {}
try:
sp = subprocess.Popen("vcfhdr2json %s %s" % (vcfname, tf.name),
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
sp = subprocess.Popen("vcfhdr2json '%s' '%s'" % (vcfname, tf.name),
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
o, e = sp.communicate()

if sp.returncode != 0:
Expand Down Expand Up @@ -120,7 +120,7 @@ def addBAM(self, bamfile):
""" Extract aligner information from a BAM file
:param bamfile: name of BAM file
"""
sp = subprocess.Popen("samtools view -H %s" % bamfile,
sp = subprocess.Popen("samtools view -H '%s'" % bamfile,
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
o, e = sp.communicate()

Expand Down
2 changes: 1 addition & 1 deletion src/python/Tools/vcfextract.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def extractHeadersJSON(vcfname):
vfh = {}

try:
sp = subprocess.Popen("vcfhdr2json %s %s" % (vcfname.replace(" ", "\\ "), tf.name.replace(" ", "\\ ")),
sp = subprocess.Popen("vcfhdr2json '%s' '%s'" % (vcfname, tf.name),
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
o, e = sp.communicate()

Expand Down
2 changes: 1 addition & 1 deletion src/python/hap.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def main():
parser.add_argument("--preprocess-truth", dest="preprocessing_truth", action="store_true", default=False,
help="Preprocess truth file with same settings as query (default is to accept truth in original format).")
parser.add_argument("--usefiltered-truth", dest="usefiltered_truth", action="store_true", default=False,
help="Preprocess truth file with same settings as query (default is to accept truth in original format).")
help="Use filtered variant calls in truth file (by default, only PASS calls in the truth file are used)")
parser.add_argument("--preprocessing-window-size", dest="preprocess_window",
default=10000, type=int,
help="Preprocessing window size (variants further apart than that size are not expected to interfere).")
Expand Down
8 changes: 4 additions & 4 deletions src/python/pre.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,23 +251,23 @@ def updateArgs(parser):
default=False,
help="Left-shift variants safely.")
parser.add_argument("--no-leftshift", dest="preprocessing_leftshift", action="store_false",
help="Left-shift variants safely.")
help="Do not left-shift variants safely.")

parser.add_argument("--decompose", dest="preprocessing_decompose", action="store_true",
default=True,
help="Decompose variants into primitives. This results in more granular counts.")
parser.add_argument("-D", "--no-decompose", dest="preprocessing_decompose", action="store_false",
help="Decompose variants into primitives. This results in more granular counts.")
help="Do not decompose variants into primitives.")

parser.add_argument("--bcftools-norm", dest="preprocessing_norm", action="store_true", default=False,
help="Enable preprocessing through bcftools norm -c x -D (requires external "
" preprocessing to be switched on).")

parser.add_argument("--fixchr", dest="fixchr", action="store_true", default=None,
help="Add/remove chr prefix (default: auto, attempt to match reference).")
help="Add chr prefix to VCF records where necessary (default: auto, attempt to match reference).")

parser.add_argument("--no-fixchr", dest="fixchr", action="store_false",
help="Add chr prefix to query file (default: auto, attempt to match reference).")
help="Do not add chr prefix to VCF records (default: auto, attempt to match reference).")

parser.add_argument("--bcf", dest="bcf", action="store_true", default=False,
help="Use BCF internally. This is the default when the input file"
Expand Down
14 changes: 11 additions & 3 deletions src/sh/run_quantify_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,17 @@ if [[ $? != 0 ]]; then
fi

# these are all the metrics. We filter out all the command line bits
cat ${TMP_OUT}.metrics.json | ${PYTHON} -mjson.tool | grep -v timestamp | grep -v hap.py > ${TMP_OUT}.hap.m.json
cat ${TMP_OUT}.qfy.metrics.json | ${PYTHON} -mjson.tool | grep -v timestamp | grep -v qfy.py > ${TMP_OUT}.qfy.m.json
diff ${TMP_OUT}.hap.m.json ${TMP_OUT}.qfy.m.json | head
gunzip -c ${TMP_OUT}.metrics.json.gz | ${PYTHON} -mjson.tool | grep -v timestamp | grep -v hap.py > ${TMP_OUT}.hap.m.json
if [[ $? != 0 ]] || [[ ! -s ${TMP_OUT}.hap.m.json ]]; then
echo "Cannot unzip metrics for original run."
exit 1
fi
gunzip -c ${TMP_OUT}.qfy.metrics.json.gz | ${PYTHON} -mjson.tool | grep -v timestamp | grep -v qfy.py > ${TMP_OUT}.qfy.m.json
if [[ $? != 0 ]] || [[ ! -s ${TMP_OUT}.qfy.m.json ]]; then
echo "Cannot unzip metrics for re-quantified run."
exit 1
fi
diff ${TMP_OUT}.hap.m.json ${TMP_OUT}.qfy.m.json
if [[ $? != 0 ]]; then
echo "Re-quantified counts are different! diff ${TMP_OUT}.hap.m.json ${TMP_OUT}.qfy.m.json "
exit 1
Expand Down

0 comments on commit 984d201

Please sign in to comment.