Skip to content

Commit

Permalink
Merge pull request #176 from gymreklab/v5.0.1
Browse files Browse the repository at this point in the history
Fix a bug in qcSTR
  • Loading branch information
gymreklab authored Feb 1, 2023
2 parents 50ae86c + 72c8c65 commit 7ea6ff4
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,6 @@ stats_gangstr.tab
stats_popstr.tab
test.tab
test_association_results.tsv
test_association_results.tsv.temp
association_results.tsv
association_results.tsv.temp
2 changes: 1 addition & 1 deletion PUBLISHING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ You can tag a commit in two different ways.

#. Command line:

.. code-block: bash
.. code-block:: bash
git tag -a vX.Y.Z -m vX.Y.Z
git push --tags
Expand Down
7 changes: 7 additions & 0 deletions RELEASE_NOTES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
5.0.1
-----

Bug fixes:

* Remove outdated call in qcSTR to np.float()

5.0.0
-----

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
curdir = os.path.abspath(os.path.dirname(__file__))
MAJ = 5
MIN = 0
REV = 0
REV = 1
VERSION = '%d.%d.%d' % (MAJ, MIN, REV)
with open(os.path.join(curdir, 'trtools/version.py'), 'w') as fout:
fout.write(
Expand Down
8 changes: 7 additions & 1 deletion test/cmdline_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ TMPDIR=$(mktemp -d -t tmp-XXXXXXXXXX)
echo "Saving tmp files in ${TMPDIR}"

# Check version
for tool in mergeSTR dumpSTR qcSTR statSTR compareSTR
for tool in mergeSTR dumpSTR qcSTR statSTR compareSTR associaTR
do
runcmd_pass "${tool} --version"
done
Expand Down Expand Up @@ -73,6 +73,12 @@ runcmd_fail "compareSTR --vcf1 ${EXDATADIR}/NA12878_chr21_gangstr.sorted.vcf.gz
runcmd_pass "compareSTR --vcf1 ${EXDATADIR}/NA12878_chr21_gangstr.sorted.vcf.gz --vcf2 ${EXDATADIR}/NA12878_chr21_gangstr.sorted.vcf.gz --out ${TMPDIR}"
runcmd_fail "compareSTR --vcf1 ${EXDATADIR}/NA12878_chr21_gangstr.sorted.vcf.gz --vcf2 ${EXDATADIR}/NA12878_chr21_gangstr.sorted.vcf.gz --out ${TMPDIR}/"

runcmd_pass "associaTR association_results.tsv ${EXDATADIR}/ceu_ex.vcf.gz simulated_phenotype ${EXDATADIR}/simulated_traits_0.npy --same-samples"
runcmd_pass "associaTR association_results.tsv ${EXDATADIR}/ceu_ex.vcf.gz simulated_phenotype ${EXDATADIR}/simulated_traits_0.npy ${EXDATADIR}/simulated_traits_1.npy --same-samples"
runcmd_fail "associaTR association_results.tsv nonexistant simulated_phenotype ${EXDATADIR}/simulated_traits_0.npy ${EXDATADIR}/simulated_traits_1.npy --same-samples"
runcmd_fail "associaTR association_results.tsv ${EXDATADIR}/ceu_ex.vcf.gz simulated_phenotype nonexistant --same-samples"
runcmd_fail "associaTR association_results.tsv ${EXDATADIR}/ceu_ex.vcf.gz simulated_phenotype ${EXDATADIR}/simulated_traits_0.npy nonexistant --same-samples"

# check for invalid vcftypes

runcmd_fail "statSTR --vcf ${EXDATADIR}/NA12878_chr21_gangstr.sorted.vcf.gz --out stdout --mean --vcftype hipstr"
Expand Down
4 changes: 2 additions & 2 deletions trtools/associaTR/associaTR.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from . import load_and_filter_genotypes
import trtools
import trtools.utils.utils as utils
2

pval_precision = 2

def _merge_arrays(a, b):
Expand Down Expand Up @@ -576,7 +576,7 @@ def run():
action='store_true',
help=argparse.SUPPRESS
)

parser.add_argument("--version", action="version", version = '{}'.format(trtools.__version__))

args = parser.parse_args()
main(args)
Expand Down
6 changes: 3 additions & 3 deletions trtools/qcSTR/qcSTR.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ def _BetterCDF(data: np.ndarray,
))
ys = np.hstack((
[1],
np.arange(n_points - 1, n_ones - 1, -1) / np.float(n_points),
[n_ones / np.float(n_points)]
np.arange(n_points - 1, n_ones - 1, -1) / n_points,
[n_ones / n_points]
))
else:
data = np.hstack((
Expand All @@ -208,7 +208,7 @@ def _BetterCDF(data: np.ndarray,
))
ys = np.hstack((
[1],
np.arange(n_points - 1, -1, -1) / np.float(n_points),
np.arange(n_points - 1, -1, -1) / n_points,
[0]
))
#ax.step(data, ys)#, where='post')
Expand Down
2 changes: 1 addition & 1 deletion trtools/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

# THIS FILE IS GENERATED FROM SETUP.PY
version = '5.0.0'
version = '5.0.1'
__version__ = version

0 comments on commit 7ea6ff4

Please sign in to comment.