[med-svn] [Git][med-team/htsjdk][master] Adding autopkgtests for the majority of reverse-dependencies

Pierre Gruet (@pgt) gitlab at salsa.debian.org
Fri Feb 18 21:22:42 GMT 2022



Pierre Gruet pushed to branch master at Debian Med / htsjdk


Commits:
b43e04ad by Pierre Gruet at 2022-02-18T22:22:33+01:00
Adding autopkgtests for the majority of reverse-dependencies

- - - - -


10 changed files:

- debian/changelog
- debian/copyright
- + debian/tests/beagle-run-sample-analysis
- + debian/tests/chromhmm-run-sample-analysis
- + debian/tests/control
- + debian/tests/drop-seq-run-unit-test
- + debian/tests/fastqc-run-unit-test
- + debian/tests/jalview-run-unit-test
- + debian/tests/picard-tools-run-unit-test
- + debian/tests/pilon-run-unit-test


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,12 @@
+htsjdk (2.24.1+dfsg-2) UNRELEASED; urgency=medium
+
+  * Adding autopkgtests to test reverse-dependencies when upgrading htsjdk
+    Closes: #920588
+
+  TODO: add tests for other reverse-dependencies.
+
+ -- Pierre Gruet <pgt at debian.org>  Fri, 18 Feb 2022 15:50:28 +0100
+
 htsjdk (2.24.1+dfsg-1) unstable; urgency=medium
 
   [ Olivier Sallou ]


=====================================
debian/copyright
=====================================
@@ -157,9 +157,35 @@ Copyright: 2010 Shaun Jackman <sjackman at debian.org>
            2013-2018 Olivier Sallou <osallou at debian.org>
            2015 Vincent Danjean <vdanjean at debian.org>
 License: ISC
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
+
+Files: debian/tests/beagle-run-sample-analysis
+       debian/tests/chromhmm-run-sample-analysis
+Copyright: 2016-2021 Dylan Aïssi <daissi at debian.org>
+License: Expat
+Comment: These files come from the packages beagle and chromhmm, licenses were
+ changed from GPL-3+ to Expat after discussion with the copyright holder..
+
+Files: debian/tests/drop-seq-run-unit-test
+       debian/tests/pilon-run-unit-test
+Copyright: 2020 Andreas Tille <tille at debian.org>
+License: Expat
+
+Files: debian/tests/fastqc-run-unit-test
+Copyright: 2012 Steffen Moeller <moeller at debian.org>
+License: Expat
+Comment: This file comes from the package fastqc, the license was changed from
+ GPL-3+ to Expat after discussion with the copyright holder.
+
+Files: debian/tests/jalview-run-unit-test
+Copyright: 2020-2021 Pierre Gruet <pgt at debian.org>
+License: Expat
+
+Files: debian/tests/picard-tools-run-unit-test
+Copyright: 2010 Shaun Jackman <sjackman at debian.org>
+           2013-2018 Olivier Sallou <osallou at debian.org>
+           2015-2016 Vincent Danjean <vdanjean at debian.org>
+           2016-2018 Andreas Tille <tille at debian.org>
+License: ISC
 
 License: Apache-2.0
  Licensed under the Apache License, Version 2.0 (the "License");
@@ -289,3 +315,8 @@ License: Public-Domain
  purpose.
  .
  Please cite the author in any work or product based on this material.
+
+License: ISC
+ Permission to use, copy, modify, and/or distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.


=====================================
debian/tests/beagle-run-sample-analysis
=====================================
@@ -0,0 +1,28 @@
+#!/bin/sh -e
+# http://dep.debian.net/deps/dep8/
+# Autopkgtest: Test if beagle run analysis correctly
+# Author: Dylan Aïssi <daissi at debian.org>
+
+pkg=beagle
+if [ "$AUTOPKGTEST_TMP" = "" ] ; then
+  AUTOPKGTEST_TMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
+fi
+cd $AUTOPKGTEST_TMP
+cp -a /usr/share/doc/${pkg}/examples/* $AUTOPKGTEST_TMP
+
+# Generate necessary files
+gzip test.vcf
+zcat test.vcf.gz | cut -f1-190 | tr '/' '|' | gzip > ref.vcf.gz
+zcat test.vcf.gz | cut -f1-9,191-200 | gzip > target.vcf.gz
+bref3 ref.vcf.gz > ref.bref3
+
+# Beagle with gt argument
+beagle gt=test.vcf.gz out=out.gt
+
+# Beagle with ref and gt argument
+beagle ref=ref.vcf.gz gt=target.vcf.gz out=out.ref
+
+# Beagle with bref3 file
+beagle ref=ref.bref3 gt=target.vcf.gz out=out.bref3
+
+rm -f $AUTOPKGTEST_TMP/*


=====================================
debian/tests/chromhmm-run-sample-analysis
=====================================
@@ -0,0 +1,18 @@
+#!/bin/sh -e
+
+pkg=chromhmm
+
+if [ "$AUTOPKGTEST_TMP" = "" ] ; then
+  AUTOPKGTEST_TMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
+fi
+
+cp -a /usr/share/doc/${pkg}/examples/* $AUTOPKGTEST_TMP
+
+cd $AUTOPKGTEST_TMP
+
+# Just print the version
+ChromHMM Version
+
+# Example from ChromHMM website
+ChromHMM -mx1600M LearnModel SAMPLEDATA_HG18 OUTPUTSAMPLE 10 hg18
+


=====================================
debian/tests/control
=====================================
@@ -0,0 +1,26 @@
+Tests: beagle-run-sample-analysis
+Depends: beagle, beagle-doc
+Architecture: !armhf
+
+Tests: chromhmm-run-sample-analysis
+Depends: chromhmm, chromhmm-example
+
+Tests: drop-seq-run-unit-test
+Depends: drop-seq-tools, drop-seq-testdata, samtools
+Restrictions: allow-stderr, skip-not-installable
+
+Tests: fastqc-run-unit-test
+Depends: fastqc, unzip
+Restrictions: allow-stderr
+
+Tests: jalview-run-unit-test
+Depends: jalview
+Restrictions: allow-stderr
+
+Tests: picard-tools-run-unit-test
+Depends: picard-tools
+Restrictions: allow-stderr, skip-not-installable
+
+Tests: pilon-run-unit-test
+Depends: pilon
+Restrictions: allow-stderr


=====================================
debian/tests/drop-seq-run-unit-test
=====================================
@@ -0,0 +1,65 @@
+#!/bin/bash
+set -e
+
+pkg=drop-seq
+
+export LC_ALL=C.UTF-8
+if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
+  AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
+  # Double quote below to expand the temporary directory variable now versus
+  # later is on purpose.
+  # shellcheck disable=SC2064
+  trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
+fi
+
+cp -a /usr/share/doc/${pkg}/examples/* "${AUTOPKGTEST_TMP}"
+
+cd "${AUTOPKGTEST_TMP}"
+
+# gunzip -r mm10/*
+gunzip -r ref/*
+gunzip -r org/broadinstitute/dropseq/annotation/*
+gunzip -r org/broadinstitute/dropseq/readtrimming/*
+mkdir out
+#do_stuff_to_test_package#
+
+echo -e "\e[93m\e[1mTest 1\e[0m"
+drop-seq TagBamWithReadSequenceExtended INPUT=org/broadinstitute/dropseq/annotation/test.bam \
+    OUTPUT=out/TagBamWithReadSequenceExtended-cellular.bam SUMMARY=TagBamWithReadSequenceExtended-cellular.bam_summary.txt BASE_RANGE=1-12 BASE_QUALITY=10 BARCODED_READ=1 DISCARD_READ=false TAG_NAME=XC NUM_BASES_BELOW_QUALITY=1
+samtools view out/TagBamWithReadSequenceExtended-cellular.bam > out/TagBamWithReadSequenceExtended-cellular.sam
+diff out/TagBamWithReadSequenceExtended-cellular.sam ref/TagBamWithReadSequenceExtended-cellular.sam
+echo -e "\e[92m\e[1mPassed\e[0m"
+echo
+
+echo -e "\e[93m\e[1mTest 2\e[0m"
+drop-seq TagBamWithReadSequenceExtended INPUT=org/broadinstitute/dropseq/annotation/test.bam \
+    OUTPUT=out/TagBamWithReadSequenceExtended-molecular.bam SUMMARY=TagBamWithReadSequenceExtended-molecular.bam_summary.txt BASE_RANGE=1-12 BASE_QUALITY=10 BARCODED_READ=1 DISCARD_READ=false TAG_NAME=XM NUM_BASES_BELOW_QUALITY=1
+samtools view out/TagBamWithReadSequenceExtended-molecular.bam > out/TagBamWithReadSequenceExtended-molecular.sam
+diff out/TagBamWithReadSequenceExtended-molecular.sam ref/TagBamWithReadSequenceExtended-molecular.sam
+echo -e "\e[92m\e[1mPassed\e[0m"
+echo
+
+echo -e "\e[93m\e[1mTest 3\e[0m"
+drop-seq FilterBam TAG_REJECT=XQ INPUT=org/broadinstitute/dropseq/readtrimming/N701.subset.tagged_filtered.sam \
+    OUTPUT=out/FilterBam.bam
+samtools view out/FilterBam.bam > out/FilterBam.sam
+diff out/FilterBam.sam ref/FilterBam.sam
+echo -e "\e[92m\e[1mPassed\e[0m"
+echo
+
+echo -e "\e[93m\e[1mTest 4\e[0m"
+drop-seq TrimStartingSequence INPUT=out/FilterBam.bam OUTPUT=out/TrimStartingSequence.bam \
+    OUTPUT_SUMMARY=out/TrimStartingSequence.summary.txt SEQUENCE=AAGCAGTGGTATCAACGCAGAGTGAATGGG MISMATCHES=0 NUM_BASES=5
+samtools view out/TrimStartingSequence.bam > out/TrimStartingSequence.sam
+diff out/TrimStartingSequence.sam ref/TrimStartingSequence.sam
+echo -e "\e[92m\e[1mPassed\e[0m"
+echo
+
+echo -e "\e[93m\e[1mTest 5\e[0m"
+drop-seq PolyATrimmer INPUT=out/TrimStartingSequence.bam OUTPUT=out/PolyATrimmer.bam \
+    OUTPUT_SUMMARY=out/PolyATrimmer.summary.bam MISMATCHES=0 NUM_BASES=6 USE_NEW_TRIMMER=true
+samtools view out/PolyATrimmer.bam > out/PolyATrimmer.sam
+diff out/PolyATrimmer.sam ref/PolyATrimmer.sam
+echo -e "\e[92m\e[1mPassed\e[0m"
+echo
+


=====================================
debian/tests/fastqc-run-unit-test
=====================================
@@ -0,0 +1,42 @@
+#!/bin/bash
+set -e
+
+pkg="fastqc"
+test_failures=0
+
+if [ "$AUTOPKGTEST_TMP" = "" ] ; then
+  AUTOPKGTEST_TMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
+  trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
+fi
+
+cp -a /usr/share/doc/${pkg}/examples/* $AUTOPKGTEST_TMP
+
+cd $AUTOPKGTEST_TMP
+
+find . -name "*.gz" -exec gunzip \{\} \;
+
+for sample in example.fastq toy_sam.sam toy_bam.bam ; do
+    /usr/bin/fastqc --extract "$sample"
+    result="${sample%%.*}_fastqc"
+    expected="${result}_expected_summary.txt"
+    if ! diff -q "${result}/summary.txt" ${expected} 2>/dev/null ; then
+	(( test_failures += 1 ))
+        cat <<EOT
+Summary results did not match contents of ${expected} for
+    fastqc "$sample"
+Please investigate!
+EOT
+    else
+        echo "Summary results match for:  fastqc "$sample" "
+    fi
+    rm -rf "$result"*
+    echo ""
+done
+
+if (( test_failures == 0 )); then
+    echo "PASS"
+    exit 0
+fi
+
+echo "FAIL mismatched fastqc summary count: $test_failures"
+exit 1


=====================================
debian/tests/jalview-run-unit-test
=====================================
@@ -0,0 +1,44 @@
+#!/bin/bash
+set -e
+
+pkg=jalview
+
+export LC_ALL=C.UTF-8
+if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
+  AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
+  # Double quote below to expand the temporary directory variable now versus
+  # later is on purpose.
+  # shellcheck disable=SC2064
+  trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
+fi
+
+cp -a /usr/share/doc/${pkg}/examples/* "${AUTOPKGTEST_TMP}"
+
+cd "${AUTOPKGTEST_TMP}"
+
+jalview -nodisplay -open uniref50.fa -eps uniref50_out.eps
+
+if [ $? -eq 0 ]; then
+  echo "Output generated in eps format in $(pwd)/uniref50_out.eps"
+else
+  echo "Failed to generate output in eps format"
+  exit 1
+fi
+
+jalview -nodisplay -open uniref50.fa -html uniref50_out.html
+
+if [ $? -eq 0 ]; then
+  echo "Output generated in html format in $(pwd)/uniref50_out.html"
+else
+  echo "Failed to generate output in eps format"
+  exit 1
+fi
+
+jalview -nodisplay -open uniref50.fa -png uniref50_out.png
+
+if [ $? -eq 0 ]; then
+  echo "Output generated in png format in $(pwd)/uniref50_out.png"
+else
+  echo "Failed to generate output in png format"
+  exit 1
+fi


=====================================
debian/tests/picard-tools-run-unit-test
=====================================
@@ -0,0 +1,55 @@
+#!/bin/sh -e
+
+pkg=picard-tools
+
+if [ "$AUTOPKGTEST_TMP" = "" ] ; then
+  AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
+  trap "rm -rf $AUTOPKGTEST_TMP" 0 INT QUIT ABRT PIPE TERM
+fi
+
+cd $AUTOPKGTEST_TMP
+
+cp -a /usr/share/doc/${pkg}/unmapped.sam .
+cp -a /usr/share/doc/${pkg}/test.* .
+cp -a /usr/share/doc/${pkg}/mini.vcf* .
+gunzip -r *
+
+PicardCommandLine ViewSam PF_STATUS=All ALIGNMENT_STATUS=All INPUT=unmapped.sam
+
+PicardCommandLine CollectSequencingArtifactMetrics I=test.sam O=test R=test.fasta
+
+o1="test.bait_bias_detail_metrics"
+o2="test.bait_bias_summary_metrics"
+o3="test.error_summary_metrics"
+o4="test.pre_adapter_detail_metrics"
+o5="test.pre_adapter_summary_metrics"
+
+if [ -e "$o1" ] && [ -e "$o2" ] && [ -e "$o3" ] && [ -e "$o4" ] && [ -e "$o5" ]; then
+  echo "All output files generated" >&2
+else
+  echo "Some files are not generated" >&2
+  exit 1
+fi
+
+PicardCommandLine SortVcf I=mini.vcf O=mini_sorted.vcf
+
+out_vcf="mini_sorted.vcf"
+
+if [ -e "$out_vcf" ]; then
+  echo "sorted vcf generated" >&2
+else
+  echo "sorted vcf haven't been generated" >&2
+  exit 1
+fi
+
+PicardCommandLine SplitVcfs I=mini.vcf SNP_OUTPUT=snp.vcf INDEL_OUTPUT=indel.vcf
+
+out_snp="snp.vcf"
+out_indel="indel.vcf"
+
+if [ -e "$out_snp" ] && [ -e "$out_indel" ]; then
+  echo "snp and indel vcfs generated" >&2
+else
+  echo "not all output files have been generated" >&2
+  exit 1
+fi


=====================================
debian/tests/pilon-run-unit-test
=====================================
@@ -0,0 +1,22 @@
+#!/bin/bash
+set -e
+
+pkg=pilon
+
+export LC_ALL=C.UTF-8
+if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
+  AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
+  # Double quote below to expand the temporary directory variable now versus
+  # later is on purpose.
+  # shellcheck disable=SC2064
+  trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
+fi
+
+cp -a /usr/share/doc/${pkg}/examples/* "${AUTOPKGTEST_TMP}"
+
+cd "${AUTOPKGTEST_TMP}"
+
+gunzip -r *
+#do_stuff_to_test_package#
+pilon --genome NC_045512.2.fasta --bam SRR11728627.sorted.bam
+diff pilon.fasta ref/pilon.fasta 



View it on GitLab: https://salsa.debian.org/med-team/htsjdk/-/commit/b43e04ad5247e67ea960753ee618847086210d6a

-- 
View it on GitLab: https://salsa.debian.org/med-team/htsjdk/-/commit/b43e04ad5247e67ea960753ee618847086210d6a
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20220218/6f8fd11a/attachment-0001.htm>


More information about the debian-med-commit mailing list