[med-svn] [Git][med-team/discosnp][master] 18 commits: Fix script pathes

Andreas Tille gitlab at salsa.debian.org
Wed Jan 23 15:34:44 GMT 2019


Andreas Tille pushed to branch master at Debian Med / discosnp


Commits:
ef34ffab by Andreas Tille at 2019-01-23T11:47:23Z
Fix script pathes

- - - - -
2df769f4 by Andreas Tille at 2019-01-23T11:48:03Z
Missing ','

- - - - -
aab7a5f7 by Andreas Tille at 2019-01-23T11:51:36Z
Manpages also for scripts

- - - - -
ce3fa0c2 by Andreas Tille at 2019-01-23T14:16:55Z
Python3 helper

- - - - -
6ea2a7f2 by Andreas Tille at 2019-01-23T14:17:28Z
Spelling

- - - - -
692c4dc5 by Andreas Tille at 2019-01-23T14:18:32Z
Do not install jenkins input

- - - - -
e7416185 by Andreas Tille at 2019-01-23T14:20:40Z
Update README.Debian

- - - - -
07f5d2cb by Andreas Tille at 2019-01-23T14:21:49Z
Leave the readme that describes the scripts next to the scripts

- - - - -
02b39a77 by Andreas Tille at 2019-01-23T14:23:04Z
Script is actually bash not sh

- - - - -
0cf61493 by Andreas Tille at 2019-01-23T14:34:30Z
Depends: gatb-core

- - - - -
65c393ea by Andreas Tille at 2019-01-23T14:38:17Z
Adapt to script dir

- - - - -
170cb0ef by Andreas Tille at 2019-01-23T14:41:58Z
Adapt test scripts to Debian PATH

- - - - -
e0afd99e by Andreas Tille at 2019-01-23T14:55:15Z
Add missing dh-python

- - - - -
acbf9449 by Andreas Tille at 2019-01-23T14:55:44Z
Add autopkgtest

- - - - -
0e5fbfc7 by Andreas Tille at 2019-01-23T14:56:29Z
Document how the package can be tested.

- - - - -
242c4a8e by Andreas Tille at 2019-01-23T15:05:26Z
Some scripts have remaining Python2 syntax

- - - - -
fdd10ba6 by Andreas Tille at 2019-01-23T15:28:43Z
Run all scripts trough 2to3

- - - - -
9ea19bd4 by Andreas Tille at 2019-01-23T15:34:10Z
fix autopkttest

- - - - -


22 changed files:

- + debian/README.Debian
- − debian/README.debian
- + debian/README.test
- debian/changelog
- debian/control
- debian/copyright
- debian/createmanpages
- debian/docs
- debian/lintian-overrides
- debian/manpages
- debian/kissnp2.1 → debian/mans/kissnp2.1
- debian/kissreads2.1 → debian/mans/kissreads2.1
- + debian/mans/run_discoSnp++.sh.1
- + debian/mans/run_discoSnpRad.sh.1
- + debian/patches/2to3.patch
- + debian/patches/adapt_test_scripts.patch
- + debian/patches/fix_scripts.patch
- debian/patches/path_to_readme_file_names.patch
- debian/patches/series
- debian/rules
- + debian/tests/control
- + debian/tests/run-unit-test


Changes:

=====================================
debian/README.Debian
=====================================
@@ -0,0 +1,10 @@
+discosnp for DEBIAN
+-------------------
+
+Please note that several scripts which are in the upstream distribution
+can be found in
+
+    /usr/share/discosnp/scripts  and
+    /usr/share/discosnp/scripts_RAD
+
+ -- Andreas Tille <tille at debian.org>  Sat, 20 Oct 2018 10:56:58 +0200


=====================================
debian/README.debian deleted
=====================================
@@ -1,18 +0,0 @@
-discosnp for DEBIAN
--------------------
-
-No man page is available but to get help, just type: kissreads or kissnp2
-
-Output analysis scripts are:
-  discoSnp_to_genotypes
-  discoSnp_to_cvs
-
-type any on command line to get help.
-
- -- Olivier Sallou <osallou at debian.org>  Mon, 13 Jan 2014 10:55:29 +0100
-
-This tools is superseded by DiscoSnp++ (see
-
-   http://colibread.inria.fr/software/discosnp/
-
- -- Andreas Tille <tille at debian.org>  Tue, 14 Nov 2017 09:41:19 +0100


=====================================
debian/README.test
=====================================
@@ -0,0 +1,8 @@
+Notes on how this package can be tested.
+────────────────────────────────────────
+
+This package can be tested by running the provided test:
+
+    sh run-unit-test
+
+in order to confirm its integrity.


=====================================
debian/changelog
=====================================
@@ -10,6 +10,8 @@ discosnp (2.3.0-1) UNRELEASED; urgency=medium
   * Remove trailing whitespace in debian/copyright
   * Build-Depends: libboost-dev, libgatbcore-dev, libhdf5-dev, zlib1g-dev
   * Fix dh_install
+  * Depends: gatb-core
+  * Add autopkgtest
 
  -- Andreas Tille <tille at debian.org>  Sat, 20 Oct 2018 10:56:58 +0200
 


=====================================
debian/control
=====================================
@@ -5,6 +5,7 @@ Uploaders: Olivier Sallou <osallou at debian.org>,
 Section: science
 Priority: optional
 Build-Depends: debhelper (>= 12~),
+               dh-python,
                cmake,
                libgatbcore-dev (>= 1.4.1+git20180206.6f8fce8~),
                libboost-dev,
@@ -19,9 +20,9 @@ Package: discosnp
 Architecture: any
 Depends: ${misc:Depends},
          ${shlibs:Depends},
-         ${python3:Depends}
-         python3
-Recommends: gatb-core
+         ${python3:Depends},
+         python3,
+         gatb-core
 Description: discovering Single Nucleotide Polymorphism from raw set(s) of reads
  Software discoSnp is designed for discovering Single Nucleotide
  Polymorphism (SNP) from raw set(s) of reads obtained with Next Generation


=====================================
debian/copyright
=====================================
@@ -364,7 +364,7 @@ License: CeCILL
  terms  and  conditions  of  such  technical  assistance,  and/or   such
  maintenance, shall then be set forth in  a  separate  instrument.  Only  the
  Licensor offering said  maintenance  and/or  technical  assistance  services
- shall incur liability therefor.
+ shall incur liability therefore.
  .
  7.2. Similarly, any or all Licensor  shall  be  entitled  to  offer  to  its
  Licensees, under its own responsibility, a  warranty,  that  shall  only  be


=====================================
debian/createmanpages
=====================================
@@ -1,5 +1,5 @@
 #!/bin/sh
-MANDIR=debian
+MANDIR=debian/mans
 mkdir -p $MANDIR
 
 VERSION=`dpkg-parsechangelog | awk '/^Version:/ {print $2}' | sed -e 's/^[0-9]*://' -e 's/-.*//' -e 's/[+~]dfsg$//'`
@@ -24,6 +24,18 @@ help2man --no-info --no-discard-stderr --help-option=" -help" \
             --version-string="$VERSION" ${progname} > $MANDIR/${progname}.1
 echo $AUTHOR >> $MANDIR/${progname}.1
 
+progname=run_discoSnp++.sh
+help2man --no-info --no-discard-stderr --help-option=" -h" \
+         --name="pipelining kissnp2 and kissreads for calling SNPs and small indels from NGS reads without the need of a reference genome" \
+            --version-string="$VERSION" ${progname} > $MANDIR/${progname}.1
+echo $AUTHOR >> $MANDIR/${progname}.1
+
+progname=run_discoSnpRad.sh
+help2man --no-info --no-discard-stderr --help-option=" -h" \
+         --name="pipelining kissnp2 and kissreads and clustering per locus for calling SNPs and small indels from RAD-seq data without the need of a reference genome" \
+            --version-string="$VERSION" ${progname} > $MANDIR/${progname}.1
+echo $AUTHOR >> $MANDIR/${progname}.1
+
 echo "$MANDIR/*.1" > debian/manpages
 
 cat <<EOT


=====================================
debian/docs
=====================================
@@ -1,3 +1,5 @@
 README*
 doc/*
 test
+debian/tests/run-unit-test
+debian/README.test


=====================================
debian/lintian-overrides
=====================================
@@ -1,3 +1,5 @@
 # see https://lists.debian.org/debian-med/2018/06/msg00043.html
 discosnp: script-with-language-extension usr/bin/run_discoSnp++.sh
 discosnp: script-with-language-extension usr/bin/run_discoSnpRad.sh
+# The doc is where it belongs to
+discosnp: package-contains-documentation-outside-usr-share-doc usr/share/discosnp/scripts_RAD/README.md


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


=====================================
debian/kissnp2.1 → debian/mans/kissnp2.1
=====================================


=====================================
debian/kissreads2.1 → debian/mans/kissreads2.1
=====================================


=====================================
debian/mans/run_discoSnp++.sh.1
=====================================
@@ -0,0 +1,61 @@
+.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.8.
+.TH RUN_DISCOSNP++.SH "1" "January 2019" "run_discoSnp++.sh 2.3.0" "User Commands"
+.SH NAME
+run_discoSnp++.sh \- pipelining kissnp2 and kissreads for calling SNPs and small indels from NGS reads without the need of a reference genome
+.SH SYNOPSIS
+.B run_discoSnp++.sh
+\fI\,-r read_file_of_files \/\fR[\fI\,OPTIONS\/\fR]
+.SH DESCRIPTION
+run_discoSnp++.sh, a pipelining kissnp2 and kissreads for calling SNPs and small indels from NGS reads without the need of a reference genome
+Version 2.3.X
+.IP
+MANDATORY:
+.TP
+\fB\-r\fR read_file_of_files
+Example: \fB\-r\fR bank.fof with bank.fof containing the two lines
+.TP
+data_sample/reads_sequence1.fasta
+data_sample/reads_sequence2.fasta.gz
+.IP
+DISCOSNP++ OPTIONS:
+.IP
+\fB\-g\fR: reuse a previously created graph (.h5 file) with same prefix and same k and c parameters.
+\fB\-b\fR value.
+.TP
+0: forbid variants for which any of the two paths is branching (high precision, lowers the recall in complex genomes). Default value
+1: (smart branching) forbid SNPs for which the two paths are branching (e.g. the two paths can be created either with a 'A' or a 'C' at the same position
+2: No limitation on branching (lowers the precision, high recall)
+.IP
+\fB\-s\fR value. In b2 mode only: maximal number of symmetrical croasroads traversed while trying to close a bubble. Default: no limit
+\fB\-D\fR value. discoSnp++ will search for deletions of size from 1 to D included. Default=100
+\fB\-a\fR value. Maximal size of ambiguity of INDELs. INDELS whose ambiguity is higher than this value are not output  [default '20']
+\fB\-P\fR value. discoSnp++ will search up to P SNPs in a unique bubble. Default=1
+\fB\-p\fR prefix. All out files will start with this prefix. Default="discoRes"
+\fB\-l\fR: remove low complexity bubbles
+\fB\-k\fR value. Set the length of used kmers. Must fit the compiled value. Default=31
+\fB\-t\fR: extend found polymorphisms with unitigs \- Forced usage when using discoSnpRad
+\fB\-T\fR: extend found polymorphisms with contigs
+\fB\-c\fR value. Set the minimal coverage per read set: Used by kissnp2 (don't use kmers with lower coverage) and kissreads (read coherency threshold). This coverage can be automatically detected per read set or specified per read set, see the documentation. Default=auto
+\fB\-C\fR value. Set the maximal coverage for each read set: Used by kissnp2 (don't use kmers with higher coverage). Default=2^31\-1
+\fB\-d\fR value. Set the number of authorized substitutions used while mapping reads on found SNPs (kissreads). Default=1
+\fB\-n\fR: do not compute the genotypes
+\fB\-u\fR: max number of used threads
+\fB\-v\fR: verbose 0 (avoids progress output) or 1 (enables progress output) \fB\-\-\fR default=1.
+.IP
+REFERENCE GENOME AND/OR VCF CREATION OPTIONS
+.IP
+\fB\-G\fR: reference genome file (fasta, fastq, gzipped or nor). In absence of this file the VCF created by VCF_creator won't contain mapping related results.
+\fB\-R\fR: use the reference file also in the variant calling, not only for mapping results
+\fB\-B\fR: bwa path. e.g. \fI\,/home/me/my_programs/bwa\-0.7\/\fP.12/ (note that bwa must be pre\-compiled)
+.IP
+Optional unless option \fB\-G\fR used and bwa is not in the binary path.
+.TP
+\fB\-M\fR: Maximal number of mapping errors during BWA mapping phase.
+Useless unless mapping on reference genome is required (option \fB\-G\fR). Default=4.
+.IP
+\fB\-h\fR: Prints this message and exist
+\fB\-e\fR: map SNP predictions on reference genome with their extensions. \- Forced usage when using discoSnpRad
+.PP
+Any further question: read the readme file or contact us via the Biostar forum: https://www.biostars.org/t/discosnp/
+.SH AUTHOR
+This manpage was written by Andreas Tille for the Debian distribution and can be used for any other usage of the program.


=====================================
debian/mans/run_discoSnpRad.sh.1
=====================================
@@ -0,0 +1,49 @@
+.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.8.
+.TH RUN_DISCOSNPRAD.SH "1" "January 2019" "run_discoSnpRad.sh 2.3.0" "User Commands"
+.SH NAME
+run_discoSnpRad.sh \- pipelining kissnp2 and kissreads and clustering per locus for calling SNPs and small indels from RAD-seq data without the need of a reference genome
+.SH SYNOPSIS
+.B run_discoSnpRad.sh
+\fI\,-r read_file_of_files \/\fR[\fI\,OPTIONS\/\fR]
+.SH DESCRIPTION
+run_discoSnpRad.sh, pipelining kissnp2 and kissreads and clustering per locus for calling SNPs and small indels from RAD\-seq data without the need of a reference genome
+Version 2.3.X
+.IP
+MANDATORY:
+.TP
+\fB\-r\fR read_file_of_files
+Example: \fB\-r\fR bank.fof with bank.fof containing the two lines
+.TP
+data_sample/reads_sequence1.fasta
+data_sample/reads_sequence2.fasta.gz
+.TP
+\fB\-S\fR **absolute** path to short_read_connector directory, containing the short_read_connector.sh'' file.
+\fB\-Note1\fR: short read connector must be compiled.
+\fB\-Note2\fR: if this option is missing, discoSnpRad will still however provide a fasta file containing SNPs and INDELS, that won't be clustered by locus
+.IP
+DISCOSNPRAD OPTIONS:
+.IP
+\fB\-g\fR: reuse a previously created graph (.h5 file) with same prefix and same k and c parameters.
+\fB\-b\fR value.
+.TP
+1: (smart branching) forbid SNPs for which the two paths are branching (e.g. the two paths can be created either with a 'A' or a 'C' at the same position Default value
+2: No limitation on branching (lowers the precision, high recall)
+.IP
+\fB\-s\fR value. In b2 mode only: maximal number of symmetrical croasroads traversed while trying to close a bubble. Default: no limit
+\fB\-D\fR value. discoSnpRad will search for deletions of size from 1 to D included. Default=100
+\fB\-a\fR value. Maximal size of ambiguity of INDELs. INDELS whose ambiguity is higher than this value are not output  [default '20']
+\fB\-P\fR value. discoSnpRad will search up to P SNPs in a unique bubble. Default=5
+\fB\-p\fR prefix. All out files will start with this prefix. Default="discoRad"
+\fB\-l\fR: remove low complexity bubbles
+\fB\-k\fR value. Set the length of used kmers. Must fit the compiled value. Default=31
+\fB\-c\fR value. Set the minimal coverage per read set: Used by kissnp2 (don't use kmers with lower coverage) and kissreads (read coherency threshold). This coverage can be automatically detected per read set or specified per read set, see the documentation. Default=auto
+\fB\-C\fR value. Set the maximal coverage for each read set: Used by kissnp2 (don't use kmers with higher coverage). Default=2^31\-1
+\fB\-d\fR value. Set the number of authorized substitutions used while mapping reads on found SNPs (kissreads). Default=1
+\fB\-u\fR: max number of used threads
+\fB\-v\fR: verbose 0 (avoids progress output) or 1 (enables progress output) \fB\-\-\fR default=1.
+.IP
+\fB\-h\fR: Prints this message and exist
+.PP
+Any further question: read the readme file or contact us via the Biostar forum: https://www.biostars.org/t/discosnp/
+.SH AUTHOR
+This manpage was written by Andreas Tille for the Debian distribution and can be used for any other usage of the program.


=====================================
debian/patches/2to3.patch
=====================================
@@ -0,0 +1,257 @@
+Author: Andreas Tille <tille at debian.org>
+Last-Update: Mon, 21 Jan 2019 09:01:19 +0100
+Description: Result of 2to3
+
+--- a/scripts/filter_out_using_MAF.py
++++ b/scripts/filter_out_using_MAF.py
+@@ -2,8 +2,8 @@ import sys
+ import gzip
+ 
+ if len(sys.argv)<3:
+-    print "This tool filters out discoSnp prediction having a minor allele frequency lower than a provided threshold for ALL datasets."
+-    print "python filter_out_using_MAF.py \".fa from discoSnp\" \"MAF threshold\""
++    print("This tool filters out discoSnp prediction having a minor allele frequency lower than a provided threshold for ALL datasets.")
++    print("python filter_out_using_MAF.py \".fa from discoSnp\" \"MAF threshold\"")
+     sys.exit()
+ 
+ 
+@@ -52,7 +52,7 @@ while True:
+             break
+     
+     if to_output:
+-        print (comment1,path1,comment2,path2,)
++        print((comment1,path1,comment2,path2,))
+     
+       
+             
+--- a/scripts_RAD/1SNP_by_cluster.py
++++ b/scripts_RAD/1SNP_by_cluster.py
+@@ -88,5 +88,5 @@ vcf_file=sys.argv[1]
+ dict, nb_SNP_before, nb_SNP_after = store_info(vcf_file)
+ output_newvcf(vcf_file, dict)
+ 
+-print("nb SNP before : " + str(nb_SNP_before))
+-print("nb SNP after  : " + str(nb_SNP_after))
++print(("nb SNP before : " + str(nb_SNP_before)))
++print(("nb SNP after  : " + str(nb_SNP_after)))
+--- a/scripts_RAD/filter_paralogs.py
++++ b/scripts_RAD/filter_paralogs.py
+@@ -100,4 +100,4 @@ dict, nb_cluster_tot = store_info(vcf_fi
+ clusters_to_keep, nb_clusters_kept = discard_clusters(dict, y)
+ output_newvcf(vcf_file, clusters_to_keep)
+ 
+-print(str(nb_clusters_kept) + " on " + str(nb_cluster_tot) + " clusters had less than " + str(y*100) + "% of SNP with less than " + str(x*100) + "% heterygous genotypes") 
++print((str(nb_clusters_kept) + " on " + str(nb_cluster_tot) + " clusters had less than " + str(y*100) + "% of SNP with less than " + str(x*100) + "% heterygous genotypes")) 
+--- a/scripts_RAD/filter_vcf_by_indiv_cov_and_max_missing.py
++++ b/scripts_RAD/filter_vcf_by_indiv_cov_and_max_missing.py
+@@ -17,25 +17,25 @@ import getopt
+ 
+ def usage():
+     '''Usage'''
+-    print "-----------------------------------------------------------------------------"
+-    print sys.argv[0]," : vcf filter"
+-    print "-----------------------------------------------------------------------------"
+-    print "usage: ",sys.argv[0]," -i vcf_file -o output_file [-c min_cov -m max_missing -s]"
+-    print "  -i: input vcf file"
+-    print "  -o: output vcf file"
+-    print "  -m: max missing genotype proportion to keep a variant (between 0 and 1, def = 1)"
+-    print "  -c: min coverage to call a genotype (int, def=0)"
+-    print "  -s: snp only (def= all variants)"
+-    print "-----------------------------------------------------------------------------"
++    print("-----------------------------------------------------------------------------")
++    print(sys.argv[0]," : vcf filter")
++    print("-----------------------------------------------------------------------------")
++    print("usage: ",sys.argv[0]," -i vcf_file -o output_file [-c min_cov -m max_missing -s]")
++    print("  -i: input vcf file")
++    print("  -o: output vcf file")
++    print("  -m: max missing genotype proportion to keep a variant (between 0 and 1, def = 1)")
++    print("  -c: min coverage to call a genotype (int, def=0)")
++    print("  -s: snp only (def= all variants)")
++    print("-----------------------------------------------------------------------------")
+     sys.exit(2)
+ 
+ 
+ def main():
+     try:
+         opts, args = getopt.getopt(sys.argv[1:], "i:o:c:m:s", ["in=", "out=","cov=","miss=","snp-only"])
+-    except getopt.GetoptError, err:
++    except getopt.GetoptError as err:
+         # print help information and exit:
+-        print str(err)  # will print something like "option -a not recognized"
++        print(str(err))  # will print something like "option -a not recognized"
+         usage()
+         sys.exit(2)
+     
+@@ -60,7 +60,7 @@ def main():
+             assert False, "unhandled option"
+ 
+     if input_file == 0 or output_file == 0:
+-        print "Missing arguments"
++        print("Missing arguments")
+         usage()
+         sys.exit(2)
+     else:
+--- a/scripts/ClassVCF_creator.py
++++ b/scripts/ClassVCF_creator.py
+@@ -177,7 +177,7 @@ class VARIANT():
+ #---------------------------------------------------------------------------------------------------------------------------                                                   
+         def RetrievePolymorphismFromHeader(self):
+                 '''Gets from the dicoAllele all the positions, and the nucleotides for each variant '''
+-                for key,(posD,ntUp,ntLow) in self.dicoAllele.items(): #Goes through the dictionary of parsed header
++                for key,(posD,ntUp,ntLow) in list(self.dicoAllele.items()): #Goes through the dictionary of parsed header
+                         self.upper_path.listPosForward.append(int(posD)+1)
+                         self.lower_path.listPosForward.append(int(posD)+1)
+                         self.upper_path.listPosReverse.append(len(self.upper_path.seq)-int(posD))
+@@ -390,12 +390,12 @@ class VARIANT():
+                 if IDVariantUp != IDVariantLow:
+                         if bitwiseFlag & 2048 : #Checks if it's a supplementary alignment
+                                 print("Supplementary alignment:")
+-                                print(self.upper_path.listSam)
++                                print((self.upper_path.listSam))
+                                 return (2) 
+                         else :
+                                 print("WARNING two consecutive lines do not store the same variant id: ")
+-                                print(self.upper_path.listSam)
+-                                print(self.lower_path.listSam)
++                                print((self.upper_path.listSam))
++                                print((self.lower_path.listSam))
+                                 return (1)
+                 
+                 else:
+@@ -438,7 +438,7 @@ class PATH():
+ 
+         def RetrieveXA(self,VCFObject):
+                 VCFObject.XA=""
+-                for position,(NM,cigarcode) in self.dicoMappingPos.items():
++                for position,(NM,cigarcode) in list(self.dicoMappingPos.items()):
+                        if cigarcode!="":
+                                 VCFObject.XA+=str(position)+","
+                 if VCFObject.XA:
+@@ -852,7 +852,7 @@ class INDEL(VARIANT):
+                        else:
+                                 self.longestSequenceForward=self.ReverseComplement(self.upper_path.seq)
+                                 self.longestSequenceReverse=self.upper_path.seq
+-                for key,(posD,ind,amb) in self.dicoAllele.items():#Goes through the dictionary of parsed header
++                for key,(posD,ind,amb) in list(self.dicoAllele.items()):#Goes through the dictionary of parsed header
+                         #In case of forward strand mapped
+                         #we return the disco indel + the lefmost nucleotide before the indel (by taking into account the ambiguity
+                         self.upper_path.listPosForward.append(int(posD)-int(amb))
+@@ -1230,8 +1230,8 @@ class VCFFIELD():
+                                 error+=1
+                 if error>0:
+                         print(" !!! Line where the error occured !!!")
+-                        print(VARIANT.upper_path.listSam)
+-                        print(VARIANT.lower_path.listSam)
++                        print((VARIANT.upper_path.listSam))
++                        print((VARIANT.lower_path.listSam))
+                 else : return (error)                                   
+                                 
+                 
+--- a/scripts/discoSnp++_to_csv.py
++++ b/scripts/discoSnp++_to_csv.py
+@@ -64,7 +64,7 @@ while 1:
+         i+=1
+     sys.stdout.write( com2_tab[i][:-1]+",")
+     
+-    print (data1_2,)
++    print((data1_2,))
+     
+     
+     
+--- a/scripts/filterOnBestDP_multiple_variant_at_same_pos.py
++++ b/scripts/filterOnBestDP_multiple_variant_at_same_pos.py
+@@ -25,7 +25,7 @@ while True:
+                 line = vcf_for_igv.readline()
+                 if not line: break
+         if line.startswith("#"): #We just print the header
+-                print (line.rstrip())
++                print((line.rstrip()))
+                 continue
+         list_line_same_pos.append(line) #list with all the lines 
+         pos=int(line.split("\t")[1])  
+@@ -61,9 +61,9 @@ while True:
+                                                 DP_max=DP
+         compt+=1
+         if to_output:
+-                print (line_to_print.rstrip())
++                print((line_to_print.rstrip()))
+         elif line_to_print :
+-                print (line_to_print.rstrip())
++                print((line_to_print.rstrip()))
+         if out:break         
+ vcf_for_igv.close() 
+ 
+--- a/scripts/filter_out_using_ratio_of_covered_files.py
++++ b/scripts/filter_out_using_ratio_of_covered_files.py
+@@ -53,7 +53,7 @@ while True:
+         if coverage_high[i]>=minimal_coverage or coverage_low[i]>=minimal_coverage: number_of_covered_sets+=1
+     
+     if 100*number_of_covered_sets/float(number_of_read_sets)>=ratio_threshold:
+-        print (comment1,path1,comment2,path2,)
++        print((comment1,path1,comment2,path2,))
+     
+       
+             
+--- a/scripts/functionObjectVCF_creator.py
++++ b/scripts/functionObjectVCF_creator.py
+@@ -191,25 +191,25 @@ def CheckAtDistanceXBestHits(upper_path,
+         best_up=1024
+         if int(upper_path.mappingPosition)==0 and int(lower_path.mappingPosition)==0:#Checks if paths are unmappped
+                 return(".")
+-        for position,(nbMismatch,cigarcode) in posUp.items(): 
++        for position,(nbMismatch,cigarcode) in list(posUp.items()): 
+                 if nbMismatch<best_up:
+                         best_up=nbMismatch
+ 
+         # get the best mapping distance for lower path 
+         best_low=1024
+-        for position,(nbMismatch,cigarcode) in posLow.items(): 
++        for position,(nbMismatch,cigarcode) in list(posLow.items()): 
+                 if nbMismatch<best_low:
+                         best_low=nbMismatch
+     
+         # get the union of the mapping position at the best mapping positions
+         position_set = set()
+-        for position,(nbMismatch,cigarcode) in posUp.items():
++        for position,(nbMismatch,cigarcode) in list(posUp.items()):
+                 if nbMismatch == best_up:
+                         position_set.add(position)
+                 if len(position_set) > 1: 
+                         return("MULTIPLE")
+ 
+-        for position,(nbMismatch,cigarcode) in posLow.items():
++        for position,(nbMismatch,cigarcode) in list(posLow.items()):
+                 if nbMismatch == best_low:
+                         position_set.add(position)
+                 if len(position_set) > 1: 
+--- a/scripts/one2zeroBased_vcf.py
++++ b/scripts/one2zeroBased_vcf.py
+@@ -10,7 +10,7 @@ VCFfile=open("VCFone2zeroBAsed.vcf","w")
+ 
+ for line in file:
+     if "#" == line[0]: 
+-        print (line,)
++        print((line,))
+         continue
+     line=line.rstrip('\n')
+     #SNP_higher_path_3       117     3       C       G       .       .       Ty=SNP;Rk=1.00000;UL=86;UR=261;CL=.;CR=.;C1=124,0;C2=0,134      GT:DP:PL        0/0:124:10,378,2484     1/1:134:2684,408,10
+--- a/scripts/VCF_creator.py
++++ b/scripts/VCF_creator.py
+@@ -75,7 +75,7 @@ for opt, arg in opts :
+                        listName[1]=listName[1].replace("_", " ")
+                stream_file=open(fileName,'r')
+         else : 
+-              print("!! No file :" +str(arg)+"!!")
++              print(("!! No file :" +str(arg)+"!!"))
+               sys.exit(2)  
+     elif opt in ("-o","--output"):
+         if arg!=None:
+@@ -91,7 +91,7 @@ for opt, arg in opts :
+             print("!! No filtered sam output !!")
+             sys.exit(2)      
+     else:
+-        print("Unkwnown option {} ".format(opt))
++        print(("Unkwnown option {} ".format(opt)))
+         usage()
+         sys.exit(2)
+ 


=====================================
debian/patches/adapt_test_scripts.patch
=====================================
@@ -0,0 +1,25 @@
+Author: Andreas Tille <tille at debian.org>
+Last-Update: Mon, 21 Jan 2019 09:01:19 +0100
+Description: Adapt test scripts to Debian PATH
+
+--- a/test/simple_test.sh
++++ b/test/simple_test.sh
+@@ -1,6 +1,6 @@
+ #!/bin/bash
+ 
+-../run_discoSnp++.sh -r fof.txt -T
++run_discoSnp++.sh -r fof.txt -T
+ 
+ diff discoRes_k_31_c_auto_D_100_P_1_b_0_coherent.fa ref_discoRes_k_31_c_auto_D_100_P_1_b_0_coherent.fa
+ if [ $? -ne 0 ] ; then
+--- a/test/large_test/local_large_test.sh
++++ b/test/large_test/local_large_test.sh
+@@ -2,7 +2,7 @@
+ #####################
+ # Default option run: 
+ #####################
+-../../run_discoSnp++.sh -r fof.txt -T
++run_discoSnp++.sh -r fof.txt -T
+ if [ $? -ne 0 ] ; then
+        echo "*** Default option FAILURE:"
+        echo "*** discoSnp failure"


=====================================
debian/patches/fix_scripts.patch
=====================================
@@ -0,0 +1,11 @@
+Author: Andreas Tille <tille at debian.org>
+Last-Update: Mon, 21 Jan 2019 09:01:19 +0100
+Description: Add missing shebang line
+
+--- a/scripts_RAD/discoRAD_finalization.sh
++++ b/scripts_RAD/discoRAD_finalization.sh
+@@ -1,3 +1,4 @@
++#!/bin/bash
+ # REQUIRES:
+ ## short_read_connector: instaleld and compiled: https://github.com/GATB/short_read_connector
+ ## quick_hierarchical_clustering compiled: 


=====================================
debian/patches/path_to_readme_file_names.patch
=====================================
@@ -34,6 +34,23 @@ Description: There is no point in delivering read_file_names in /usr/bin
  
  useref=""
  genome=""
+@@ -463,14 +463,14 @@ echo -e "\t#############################
+ 
+ T="$(date +%s)"
+ if [ -f "$src_file" ]; then
+-    cmd="$EDIR/scripts_RAD/discoRAD_finalization.sh ${kissprefix}_coherent.fa $short_read_connector_path" 
++    cmd="/usr/share/discosnp/scripts_RAD/discoRAD_finalization.sh ${kissprefix}_coherent.fa $short_read_connector_path" 
+     echo $cmd
+     $cmd
+     T="$(($(date +%s)-T))"
+     echo "RAD clustering per locus time in seconds: ${T}"
+ else
+     echo "IF YOU WANT TO CLUSTERIZE RESULTS, RUN: "
+-    echo "  $EDIR/scripts_RAD/discoRAD_finalization.sh ${kissprefix}_coherent.fa short_read_connector_path"
++    echo "  /usr/share/discosnp/scripts_RAD/discoRAD_finalization.sh ${kissprefix}_coherent.fa short_read_connector_path"
+     echo "  With short_read_connector_path indicating the directory containing short_read_connector.sh command "
+ fi
+ 
 --- a/run_discoSnp++.sh
 +++ b/run_discoSnp++.sh
 @@ -54,7 +54,7 @@ paired=""
@@ -61,6 +78,24 @@ Description: There is no point in delivering read_file_names in /usr/bin
  
  useref=""
  genome=""
+@@ -491,7 +491,7 @@ echo -e "\t#################### CREATE V
+ echo -e "\t###############################################################"
+ 
+ if [ -z "$genome" ]; then #  NO reference genome use, vcf creator mode 1
+-    vcfCreatorCmd="$EDIR/scripts/run_VCF_creator.sh -p ${kissprefix}_coherent.fa -o ${kissprefix}_coherent.vcf"
++    vcfCreatorCmd="/usr/share/discosnp/scripts/run_VCF_creator.sh -p ${kissprefix}_coherent.fa -o ${kissprefix}_coherent.vcf"
+     echo $vcfCreatorCmd
+     $vcfCreatorCmd
+     if [ $? -ne 0 ]
+@@ -500,7 +500,7 @@ if [ -z "$genome" ]; then #  NO referenc
+         exit 1
+     fi
+ else # A Reference genome is provided, vcf creator mode 2
+-    vcfCreatorCmd="$EDIR/scripts/run_VCF_creator.sh $bwa_path_option -G $genome $bwa_path_option -p ${kissprefix}_coherent.fa -o ${kissprefix}_coherent.vcf  -I $option_cores_post_analysis $e"
++    vcfCreatorCmd="/usr/share/discosnp/scripts/run_VCF_creator.sh $bwa_path_option -G $genome $bwa_path_option -p ${kissprefix}_coherent.fa -o ${kissprefix}_coherent.vcf  -I $option_cores_post_analysis $e"
+     echo $vcfCreatorCmd
+     $vcfCreatorCmd
+ 
 --- a/scripts_RAD/discoRAD_finalization.sh
 +++ b/scripts_RAD/discoRAD_finalization.sh
 @@ -61,7 +61,7 @@ cmd="${short_read_connector_directory}/s


=====================================
debian/patches/series
=====================================
@@ -2,3 +2,6 @@ use_debian_packaged_gatb-core.patch
 no_install_to_wrong_dir.patch
 path_to_readme_file_names.patch
 spelling.patch
+fix_scripts.patch
+adapt_test_scripts.patch
+2to3.patch


=====================================
debian/rules
=====================================
@@ -7,13 +7,14 @@ include /usr/share/dpkg/default.mk
 
 
 %:
-	dh $@
+	dh $@ --with python3
 
 override_dh_install:
 	dh_install
 	mkdir -p debian/$(DEB_SOURCE)/usr/lib/$(DEB_SOURCE)/bin
 	mv debian/$(DEB_SOURCE)/usr/bin/read_file_names			debian/$(DEB_SOURCE)/usr/lib/$(DEB_SOURCE)/bin
 	mv debian/$(DEB_SOURCE)/usr/bin/quick_hierarchical_clustering	debian/$(DEB_SOURCE)/usr/lib/$(DEB_SOURCE)/bin
-	for pl in `grep -Rl -e '#![[:space:]]*/bin/python' -e '#![[:space:]]*python' debian/*/usr/*` ; do \
+	rm -rf debian/$(DEB_SOURCE)/usr/share/discosnp/scripts/jenkins
+	for pl in `grep -Rl -e '#![[:space:]]*/bin/python' -e '#![[:space:]]*/usr/bin/env *python' debian/*/usr/*` ; do \
 	    sed -i '1s?^#!.*python?#!/usr/bin/python3?' $${pl} ; \
 	done


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


=====================================
debian/tests/run-unit-test
=====================================
@@ -0,0 +1,17 @@
+#!/bin/bash
+set -e
+
+pkg=discosnp
+
+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}/test/* $AUTOPKGTEST_TMP
+
+cd $AUTOPKGTEST_TMP
+gunzip ref_discoRes_k_31_c_auto_D_100_P_1_b_0_coherent*.gz
+chmod +x simple_test.sh
+
+./simple_test.sh



View it on GitLab: https://salsa.debian.org/med-team/discosnp/compare/c63c254996fc9d8b17ccad008e264cbc6c459cdc...9ea19bd4b311bfa1f46a197890ab55f503cc1be7

-- 
View it on GitLab: https://salsa.debian.org/med-team/discosnp/compare/c63c254996fc9d8b17ccad008e264cbc6c459cdc...9ea19bd4b311bfa1f46a197890ab55f503cc1be7
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/20190123/2bb1346f/attachment-0001.html>


More information about the debian-med-commit mailing list