[med-svn] [Git][med-team/tiddit][master] 5 commits: Install binaries

Nilesh Patra gitlab at salsa.debian.org
Sun Jun 28 11:34:57 BST 2020



Nilesh Patra pushed to branch master at Debian Med / tiddit


Commits:
4cd22917 by Nilesh Patra at 2020-06-28T09:58:51+00:00
Install binaries

- - - - -
74e7fe50 by Nilesh Patra at 2020-06-28T15:55:07+05:30
Fix finding binary location

- - - - -
c51064d4 by Nilesh Patra at 2020-06-28T10:28:11+00:00
Add manpages for missing binaries

- - - - -
3398708e by Nilesh Patra at 2020-06-28T16:04:18+05:30
Spelling Fix

- - - - -
408a5c2a by Nilesh Patra at 2020-06-28T16:04:27+05:30
Add autopkgtests

- - - - -


14 changed files:

- debian/createmanpages
- debian/install
- + debian/man/TIDDIT.1
- debian/TIDDIT.py.1 → debian/man/TIDDIT.py.1
- debian/manpages
- + debian/patches/Fix-tiddit-binary-location.patch
- debian/patches/series
- debian/rules
- + debian/tests/README.md
- + debian/tests/control
- + debian/tests/data/normal.sam
- + debian/tests/data/ref.fa
- + debian/tests/data/tumor.sam
- + debian/tests/run-unit-test


Changes:

=====================================
debian/createmanpages
=====================================
@@ -1,5 +1,5 @@
 #!/bin/sh
-MANDIR=debian
+MANDIR=debian/man
 mkdir -p $MANDIR
 
 VERSION=`dpkg-parsechangelog | awk '/^Version:/ {print $2}' | sed -e 's/^[0-9]*://' -e 's/-.*//' -e 's/[+~]dfsg$//'`
@@ -26,3 +26,17 @@ Please enhance the help2man output.
 The following web page might be helpful in doing so:
     http://liw.fi/manpages/
 EOT
+
+progname=TIDDIT
+help2man --no-info --no-discard-stderr --help-option="--help" \
+         --name="$NAME" \
+            --version-string="$VERSION" ${progname} > $MANDIR/${progname}.1
+echo $AUTHOR >> $MANDIR/${progname}.1
+
+echo "$MANDIR/*.1" > debian/manpages
+
+cat <<EOT
+Please enhance the help2man output.
+The following web page might be helpful in doing so:
+    http://liw.fi/manpages/
+EOT


=====================================
debian/install
=====================================
@@ -1 +1,2 @@
+bin/*		usr/bin
 TIDDIT.py	usr/bin


=====================================
debian/man/TIDDIT.1
=====================================
@@ -0,0 +1,26 @@
+.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.12.
+.TH TIDDIT "1" "June 2020" "TIDDIT 2.12.0" "User Commands"
+.SH NAME
+TIDDIT \- structural variant calling
+.SH SYNOPSIS
+.B TIDDIT
+\fI\,<module> \/\fR[\fI\,options\/\fR]
+.SH DESCRIPTION
+TIDDIT\-2.12.0 \- a structural variant caller
+.PP
+modules
+.TP
+\fB\-\-help\fR
+produce help message
+.TP
+\fB\-\-sv\fR
+collect SV signals
+.TP
+\fB\-\-cov\fR
+select the cov module to analyse the coverage of the genome using bins of a specified size
+.TP
+\fB\-\-gc\fR
+select the gc module to compute the gc content across the genome using bins of a specified size(accepts a fasta through stdin)
+.SH AUTHOR
+ This manpage was written by Nilesh Patra for the Debian distribution and
+ can be used for any other usage of the program.


=====================================
debian/TIDDIT.py.1 → debian/man/TIDDIT.py.1
=====================================


=====================================
debian/manpages
=====================================
@@ -1 +1 @@
-debian/*.1
+debian/man/*.1


=====================================
debian/patches/Fix-tiddit-binary-location.patch
=====================================
@@ -0,0 +1,65 @@
+Author: Nilesh Patra <npatra974 at gmail.com>
+Description: Search for the binary in same location: since both are eventually installed to /usr/bin
+Last Changed: Sun Jun 28 2020
+--- a/TIDDIT.py
++++ b/TIDDIT.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#! /usr/bin/python3
+ import argparse
+ import os
+ import sys
+@@ -60,14 +60,14 @@
+ 		print ("error,  could not find the bam file")
+ 		quit()
+ 
+-	if not os.path.isfile("{}/bin/TIDDIT".format(args.wd)):
++	if not os.path.isfile("{}/TIDDIT".format(args.wd)):
+ 		print ("error,  could not find the TIDDIT executable file, try rerun the INSTALL.sh script")
+ 		quit()
+ 
+ 	if not args.bam.endswith(".cram"):
+-		command_str="{}/bin/TIDDIT --sv -b {} -o {} -p {} -r {} -q {} -n {} -s {}".format(args.wd,args.bam,args.o,args.p,args.r,args.q,args.n,args.s)
++		command_str="{}/TIDDIT --sv -b {} -o {} -p {} -r {} -q {} -n {} -s {}".format(args.wd,args.bam,args.o,args.p,args.r,args.q,args.n,args.s)
+ 	else:
+-		command_str="samtools view -hbu {} -T {} | {}/bin/TIDDIT --sv -b /dev/stdin -o {} -p {} -r {} -q {} -n {} -s {}".format(args.bam,args.ref,args.wd,args.o,args.p,args.r,args.q,args.n,args.s)
++		command_str="samtools view -hbu {} -T {} | {}/TIDDIT --sv -b /dev/stdin -o {} -p {} -r {} -q {} -n {} -s {}".format(args.bam,args.ref,args.wd,args.o,args.p,args.r,args.q,args.n,args.s)
+ 	
+ 
+ 	if args.i:
+@@ -82,9 +82,9 @@
+ 			t=time.time()
+ 			print ("Generating GC wig file")
+ 			if args.ref.endswith(".gz"):
+-				os.system("zcat {} | {}/bin/TIDDIT --gc -z 50 -o {}".format(args.ref,args.wd,args.o))
++				os.system("zcat {} | {}/TIDDIT --gc -z 50 -o {}".format(args.ref,args.wd,args.o))
+ 			else:
+-				os.system("cat {} | {}/bin/TIDDIT --gc -z 50 -o {}".format(args.ref,args.wd,args.o))
++				os.system("cat {} | {}/TIDDIT --gc -z 50 -o {}".format(args.ref,args.wd,args.o))
+ 			print ("Constructed GC wig in {} sec".format(time.time()-t))
+ 
+ 	if not args.no_cluster:
+@@ -108,12 +108,12 @@
+ 			quit()
+ 
+ 	if not args.bam.endswith(".cram"):
+-		command="{}/bin/TIDDIT --cov -b {} -o {} -z {}".format(args.wd,args.bam,args.o,args.z)
++		command="{}/TIDDIT --cov -b {} -o {} -z {}".format(args.wd,args.bam,args.o,args.z)
+ 	else:
+ 		if not args.ref:
+ 			print("error, missing reference sequence!")
+ 			quit()
+-		command="samtools view -hbu {} -T {} | {}/bin/TIDDIT --cov -b /dev/stdin -o {} -z {}".format(args.bam,args.ref,args.wd,args.o,args.z)
++		command="samtools view -hbu {} -T {} | {}/TIDDIT --cov -b /dev/stdin -o {} -z {}".format(args.bam,args.ref,args.wd,args.o,args.z)
+ 
+ 	if args.w:
+ 		command += " -w"
+@@ -124,7 +124,7 @@
+ 	if not os.path.isfile(args.bam):
+ 		print ("error,  could not find the bam file")
+ 		quit()
+-	if not os.path.isfile("{}/bin/TIDDIT".format(args.wd)):
++	if not os.path.isfile("{}/TIDDIT".format(args.wd)):
+ 		print ("error,  could not find the TIDDIT executable file, try rerun the INSTALL.sh script")
+ 		quit()
+ 	os.system(command)


=====================================
debian/patches/series
=====================================
@@ -1 +1,2 @@
 use_debian_packaged_libs.patch
+Fix-tiddit-binary-location.patch


=====================================
debian/rules
=====================================
@@ -14,6 +14,7 @@ override_dh_auto_configure:
 	dh_auto_configure --sourcedirectory=src --buildsystem=pybuild
 
 override_dh_auto_build:
+	sed -i 's/betwen/between/' src/data_structures/Translocation.cpp
 	dh_auto_build
 	dh_auto_build --sourcedirectory=src --buildsystem=pybuild
 


=====================================
debian/tests/README.md
=====================================
@@ -0,0 +1,18 @@
+Data for tiddit
+=====================
+
+The data is from NA12878 (tumor) and NA12892 (normal) and represents a tiny chunk of chromsome 21. It was created from 1000 Genomes Project (http://www.1000genomes.org) data available in the following locations:
+* NA12892 - ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/data/NA12892/high_coverage_alignment/NA12892.mapped.ILLUMINA.bwa.CEU.high_coverage_pcr_free.20130906.bam
+* NA12878 - ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/data/NA12878/high_coverage_alignment/NA12878.mapped.ILLUMINA.bwa.CEU.high_coverage_pcr_free.20130906.bam
+* Build 37 reference - ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/technical/reference/human_g1k_v37.fasta.gz
+
+Should you wish to recreate the files in this repository, they were processed as follows below.
+
+    samtools view -hb NA12892.mapped.ILLUMINA.bwa.CEU.high_coverage_pcr_free.20130520.bam 21:10400000-10500000 > normal.bam
+    samtools view -hb NA12878.mapped.ILLUMINA.bwa.CEU.high_coverage_pcr_free.20130520.bam 21:10400000-10500000 > tumor.bam
+    gunzip human_g1k_v37.fasta.gz
+    samtools faidx human_g1k_v37.fasta 21:1-10505000 > ref.fa
+    samtools view -h -o normal.sam normal.bam
+    samtools view -h -o tumor.sam tumor.bam
+
+Note that ref.fa was then further edited to change the chromosome name back to 21 as faidx includes the requested region in the name.


=====================================
debian/tests/control
=====================================
@@ -0,0 +1,4 @@
+Tests: run-unit-test
+Depends: @, samtools, python3-numpy
+Restrictions: allow-stderr
+


=====================================
debian/tests/data/normal.sam
=====================================
The diff for this file was not included because it is too large.

=====================================
debian/tests/data/ref.fa
=====================================
The diff for this file was not included because it is too large.

=====================================
debian/tests/data/tumor.sam
=====================================
The diff for this file was not included because it is too large.

=====================================
debian/tests/run-unit-test
=====================================
@@ -0,0 +1,28 @@
+#!/bin/bash
+set -e
+
+pkg=tiddit
+CUR_DIR=`pwd`
+
+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 ${CUR_DIR}/debian/tests/data/* -a "${AUTOPKGTEST_TMP}"
+
+cd "${AUTOPKGTEST_TMP}"
+gunzip -r *
+cat normal.sam | samtools view -Sb - > normal.bam
+cat tumor.sam | samtools view -Sb - > tumor.bam
+
+echo 'Test 1'
+TIDDIT.py --sv --p_ratio 0.10 --bam tumor.bam -o tumor --ref ref.fa
+cat tumor.pass.vcf
+echo 'PASS'
+
+echo 'Test 2'
+TIDDIT.py --sv --bam normal.bam -o normal --ref ref.fa
+cat normal.pass.vcf
+echo 'PASS'
+



View it on GitLab: https://salsa.debian.org/med-team/tiddit/-/compare/8418e3259546b3928f4153b9849ac62a3b5518c1...408a5c2a80013cfb96e71af651e1b77713accc63

-- 
View it on GitLab: https://salsa.debian.org/med-team/tiddit/-/compare/8418e3259546b3928f4153b9849ac62a3b5518c1...408a5c2a80013cfb96e71af651e1b77713accc63
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/20200628/04bef258/attachment-0001.html>


More information about the debian-med-commit mailing list