[med-svn] [Git][med-team/mindthegap][master] 2 commits: Revert unintended changes to CMakeLists.txt and test scripts. Please always...

Andreas Tille gitlab at salsa.debian.org
Tue Jul 9 15:43:14 BST 2019



Andreas Tille pushed to branch master at Debian Med / mindthegap


Commits:
b72b9a4c by Andreas Tille at 2019-07-09T14:35:51Z
Revert unintended changes to CMakeLists.txt and test scripts.  Please always make sure to leave the original files unpatched when commiting

- - - - -
e121d92c by Andreas Tille at 2019-07-09T14:39:27Z
Automatic port to Python3 using 2to3

- - - - -


6 changed files:

- CMakeLists.txt
- + debian/patches/2to3.patch
- debian/patches/remove_unnecessary_installs.patch
- debian/patches/series
- test/simple_full_test.sh
- test/simple_test.sh


Changes:

=====================================
CMakeLists.txt
=====================================
@@ -71,7 +71,7 @@ SET (GATB_CORE_EXCLUDE_TESTS     1)
 SET (GATB_CORE_EXCLUDE_EXAMPLES  1)
 
 # GATB CORE
-# include (GatbCore)
+include (GatbCore)
 
 ################################################################################
 # TOOL
@@ -106,14 +106,11 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
 # we define the files to be compiled
 file (GLOB_RECURSE  ProjectFiles  src/*)
 
-include(GNUInstallDirs)
-LINK_DIRECTORIES ( /usr/${CMAKE_INSTALL_LIBDIR}/hdf5/serial )
-
 # we define the artifact to be built: the project binary
 add_executable        (${PROJECT_NAME}  src/main.cpp ${ProjectFiles})
 
 # we define which libraries to be linked with project binary
-target_link_libraries (${PROJECT_NAME} gatbcore hdf5)
+target_link_libraries (${PROJECT_NAME}  ${gatb-core-libraries})
 
 
 ################################################################################
@@ -148,12 +145,12 @@ SET (CPACK_SOURCE_IGNORE_FILES
 
 # We copy the project binary to the 'bin' directory
 INSTALL (TARGETS   ${PROJECT_NAME}                           DESTINATION bin)
-#INSTALL (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test          DESTINATION .)
-#INSTALL (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data          DESTINATION .)
+INSTALL (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test          DESTINATION .)
+INSTALL (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data          DESTINATION .)
 #INSTALL (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/doc           DESTINATION .)
-#INSTALL (FILES     ${CMAKE_CURRENT_SOURCE_DIR}/README.md     DESTINATION .)
-#INSTALL (FILES     ${CMAKE_CURRENT_SOURCE_DIR}/CHANGELOG.md     DESTINATION .)
-#INSTALL (FILES     ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE       DESTINATION .)
+INSTALL (FILES     ${CMAKE_CURRENT_SOURCE_DIR}/README.md     DESTINATION .)
+INSTALL (FILES     ${CMAKE_CURRENT_SOURCE_DIR}/CHANGELOG.md     DESTINATION .)
+INSTALL (FILES     ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE       DESTINATION .)
 
 # We include the "bin" tag into binary archive file name
 set (CPACK_PACKAGE_FILE_NAME  ${PROJECT_NAME}-${CPACK_PACKAGE_VERSION}-bin-${CMAKE_SYSTEM_NAME})


=====================================
debian/patches/2to3.patch
=====================================
@@ -0,0 +1,163 @@
+Author: Andreas Tille <tille at debian.org>
+Last-Update: Tue, 09 Jul 2019 16:38:42 +0200
+Description: Automatic port to Python3 via
+   2to3 --write --nobackups *.py
+
+--- a/test/scripts/generate_read.py
++++ b/test/scripts/generate_read.py
+@@ -11,24 +11,24 @@ import random
+ 
+ def usage():
+     '''Usage'''
+-    print "-----------------------------------------------------------------------------"
+-    print sys.argv[0]," : sub-sequence"
+-    print "-----------------------------------------------------------------------------"
+-    print "usage: ",sys.argv[0]," -f fasta_file -n numbre -l length"
+-    print "  -f: input fasta file"
+-    print "  -n: numbre of read you want(def : 1)"
+-    print "  -l: length of sub-sequence (def : 1)"
+-    print "  -h: help"
+-    print "-----------------------------------------------------------------------------"
++    print("-----------------------------------------------------------------------------")
++    print(sys.argv[0]," : sub-sequence")
++    print("-----------------------------------------------------------------------------")
++    print("usage: ",sys.argv[0]," -f fasta_file -n numbre -l length")
++    print("  -f: input fasta file")
++    print("  -n: numbre of read you want(def : 1)")
++    print("  -l: length of sub-sequence (def : 1)")
++    print("  -h: help")
++    print("-----------------------------------------------------------------------------")
+     sys.exit(2)
+ 
+ 
+ def main():
+     try:
+         opts, args = getopt.getopt(sys.argv[1:], "hf:n:l:", ["help", "fasta=", "num=", "len="])
+-    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)
+ 
+@@ -50,7 +50,7 @@ def main():
+             assert False, "unhandled option"
+ 
+     if fasta_file == 0 :
+-        print "Missing arguments"
++        print("Missing arguments")
+         usage()
+         return 2
+     
+@@ -71,11 +71,11 @@ def main():
+         sequence_len = len(sequence)
+         
+         if sequence_len == 0 :
+-            print "warning we didn't find fasta sequence in file."
++            print("warning we didn't find fasta sequence in file.")
+             return 1
+ 
+         if sequence_len < read_len :
+-            print "warning read length is upper than sequence length we can't generate read."
++            print("warning read length is upper than sequence length we can't generate read.")
+             return 1
+         
+         for i in range(num_loop) :
+@@ -83,8 +83,8 @@ def main():
+             while pos + read_len > sequence_len :
+                 pos = random.randint(0, sequence_len)
+ 
+-            print ">"+header+"_read"+str(i)+"_pos_"+str(pos)+":"+str(pos+read_len)
+-            print sequence[pos:pos+read_len]
++            print(">"+header+"_read"+str(i)+"_pos_"+str(pos)+":"+str(pos+read_len))
++            print(sequence[pos:pos+read_len])
+ 
+     return 0
+             
+--- a/test/scripts/make_deletions.py
++++ b/test/scripts/make_deletions.py
+@@ -10,29 +10,29 @@ import random
+ 
+ def usage():
+     '''Usage'''
+-    print "-----------------------------------------------------------------------------"
+-    print sys.argv[0]," : deletion simulator"
+-    print "-----------------------------------------------------------------------------"
+-    print "usage: ",sys.argv[0]," -g genome_file -o output [-n nb_del] [-m min_length] [-M max_length] [-s separator] [-N] [-b]"
+-    print "  -g: input fasta file containing the genome sequence(s)"
+-    print "  -o: file preffix for output files (.fasta : the new genome, .del.fasta : the deleted sequences, .del.txt : the positions of deletions)"
+-    print "  -n: number of deletions to generate, default=1"
+-    print "  -m: min size of the deletions (in bp), default = 100"
+-    print "  -M: max size of the deletions (in bp), default = 500"
+-    print "  -s: min distance between two consecutive deletions (in bp), default = 1, only positive separator are taken into account. For now it can not generate overlapping deletions."
+-    print "  -N: autorize N inside the deletion (but still not in the borders)"
+-    print "  -b: bed format for output of the positions of deletions (instead of .del.txt will be .del.bed)"
+-    print "  -h: help"
+-    print "-----------------------------------------------------------------------------"
++    print("-----------------------------------------------------------------------------")
++    print(sys.argv[0]," : deletion simulator")
++    print("-----------------------------------------------------------------------------")
++    print("usage: ",sys.argv[0]," -g genome_file -o output [-n nb_del] [-m min_length] [-M max_length] [-s separator] [-N] [-b]")
++    print("  -g: input fasta file containing the genome sequence(s)")
++    print("  -o: file preffix for output files (.fasta : the new genome, .del.fasta : the deleted sequences, .del.txt : the positions of deletions)")
++    print("  -n: number of deletions to generate, default=1")
++    print("  -m: min size of the deletions (in bp), default = 100")
++    print("  -M: max size of the deletions (in bp), default = 500")
++    print("  -s: min distance between two consecutive deletions (in bp), default = 1, only positive separator are taken into account. For now it can not generate overlapping deletions.")
++    print("  -N: autorize N inside the deletion (but still not in the borders)")
++    print("  -b: bed format for output of the positions of deletions (instead of .del.txt will be .del.bed)")
++    print("  -h: help")
++    print("-----------------------------------------------------------------------------")
+     sys.exit(2)
+ 
+ 
+ def main():
+     try:
+         opts, args = getopt.getopt(sys.argv[1:], "hg:n:o:m:M:s:Nb", ["help", "genome=", "num=", "output=", "min=", "max=", "sep=", "enableN", "bed"])
+-    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)
+ 
+@@ -71,14 +71,14 @@ def main():
+             assert False, "unhandled option"
+ 
+     if genome_file == 0 or output==0:
+-        print "Missing arguments"
++        print("Missing arguments")
+         usage()
+         sys.exit(2)
+     elif min_length<=0 or max_length<min_length:
+-        print "Error in parameters : deletion length must respect the following condition : 0 < min_length <= max_length"
++        print("Error in parameters : deletion length must respect the following condition : 0 < min_length <= max_length")
+         sys.exit(2)
+     elif nb_del<=0:
+-        print "Error in parameters : number of deletions should be greater than 0"
++        print("Error in parameters : number of deletions should be greater than 0")
+         sys.exit(2)
+     else:
+         
+@@ -155,7 +155,7 @@ def main():
+             nb_boucle+=1
+                 
+         if nb_ok < nb_del:
+-            print "Warning: too difficult to place ",str(nb_del)," deletions, only ",str(nb_ok)," placed"
++            print("Warning: too difficult to place ",str(nb_del)," deletions, only ",str(nb_ok)," placed")
+ 
+ #        print "placed deletions : "+str(nb_ok)
+ 
+--- a/test/scripts/make_snp_deletions.py
++++ b/test/scripts/make_snp_deletions.py
+@@ -204,7 +204,7 @@ def main():
+     seq_del_cpt = 0
+     del_cpt = 0
+     list_pos = list()
+-    for comment in comment2seq.keys():
++    for comment in list(comment2seq.keys()):
+         del_pos = 0
+         while seq_del_cpt < (len(comment2seq[comment]) / nuc_per_del):
+ 


=====================================
debian/patches/remove_unnecessary_installs.patch
=====================================
@@ -1,8 +1,6 @@
-Index: mindthegap-2.2.0/CMakeLists.txt
-===================================================================
---- mindthegap-2.2.0.orig/CMakeLists.txt
-+++ mindthegap-2.2.0/CMakeLists.txt
-@@ -145,12 +145,12 @@ SET (CPACK_SOURCE_IGNORE_FILES
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -148,12 +148,12 @@ SET (CPACK_SOURCE_IGNORE_FILES
  
  # We copy the project binary to the 'bin' directory
  INSTALL (TARGETS   ${PROJECT_NAME}                           DESTINATION bin)


=====================================
debian/patches/series
=====================================
@@ -1,3 +1,4 @@
 use_debian_packaged_gatb-core.patch
 remove_unnecessary_installs.patch
 modify_tests_for_autopkgtest.patch
+2to3.patch


=====================================
test/simple_full_test.sh
=====================================
@@ -1,5 +1,18 @@
 #! /bin/bash
 
+# look for MindTheGap binary. In devel mode, it's in ../build/bin directory.
+# In production mode, it's in ../bin directory.
+if [ -f "../bin/MindTheGap" ]
+then
+ bindir="../bin"
+elif [ -f "../build/bin/MindTheGap" ]
+then
+ bindir="../build/bin"
+else
+ echo "could not find a compiled MindTheGap binary"
+ exit 1
+fi
+
 RETVAL=0
 testDir="test-output"
 outputPrefix=$testDir/full-test
@@ -20,7 +33,7 @@ mkdir $testDir
 ################################################################################
 # we launch the find module
 ################################################################################
-MindTheGap find -in ../data/reads_r1.fastq,../data/reads_r2.fastq -ref ../data/reference.fasta -out $outputPrefix >$outputPrefix.out -nb-cores 1 2> /dev/null
+${bindir}/MindTheGap find -in ../data/reads_r1.fastq,../data/reads_r2.fastq -ref ../data/reference.fasta -out $outputPrefix >$outputPrefix.out -nb-cores 1 2> /dev/null
 
 ################################################################################
 # we check the results 
@@ -65,7 +78,7 @@ fi
 ################################################################################
 # we launch the fill module
 ################################################################################
-MindTheGap fill -graph $outputPrefix.h5 -bkpt $outputPrefix.breakpoints -out $outputPrefix -nb-cores 1 >>$outputPrefix.out 2> /dev/null
+${bindir}/MindTheGap fill -graph $outputPrefix.h5 -bkpt $outputPrefix.breakpoints -out $outputPrefix -nb-cores 1 >>$outputPrefix.out 2> /dev/null
 
 ################################################################################
 # we check the results 
@@ -104,7 +117,7 @@ fi
 ################################################################################
 # we launch the fill module in contig mode
 ################################################################################
-MindTheGap fill -in ../data/contig-reads.fasta.gz -contig ../data/contigs.fasta -abundance-min 3 -out $outputPrefix2 -nb-cores 1 >>$outputPrefix2.out 2> /dev/null
+${bindir}/MindTheGap fill -in ../data/contig-reads.fasta.gz -contig ../data/contigs.fasta -abundance-min 3 -out $outputPrefix2 -nb-cores 1 >>$outputPrefix2.out 2> /dev/null
 
 ################################################################################
 # we check the results


=====================================
test/simple_test.sh
=====================================
@@ -1,13 +1,26 @@
 #!/bin/bash
 
+# look for MindTheGap binary. In devel mode, it's in ../build/bin directory.
+# In production mode, it's in ../bin directory.
+if [ -f "../bin/MindTheGap" ]
+then
+ bindir="../bin"
+elif [ -f "../build/bin/MindTheGap" ]
+then
+ bindir="../build/bin"
+else
+ echo "could not find a compiled mindthegap binary"
+ exit 1
+fi
+
 testOK="true"
 
 run_test()
 {
     # param : reads_file ref_file true_result prefix
-    MindTheGap find -in $1 -ref $2 -kmer-size 31 -out output/$4_find $5 1> output/$4_find.out 2> output/$4_find.err
+    $bindir/MindTheGap find -in $1 -ref $2 -kmer-size 31 -out output/$4_find $5 1> output/$4_find.out 2> output/$4_find.err
 
-    MindTheGap fill -bkpt output/$4_find.breakpoints -graph output/$4_find.h5  -out output/$4_fill 1> output/$4_fill.out 2> output/$4_fill.err
+    $bindir/MindTheGap fill -bkpt output/$4_find.breakpoints -graph output/$4_find.h5  -out output/$4_fill 1> output/$4_fill.out 2> output/$4_fill.err
 
     tmp1=output/$4_fill.insertions.fasta.tmp
     tmp2=output/tmp2
@@ -32,7 +45,7 @@ run_test()
 run_test_vcf()
 {
 # param : reads_file ref_file true_result prefix
-	MindTheGap find -in $1 -ref $2 -kmer-size 31 -out output/$4_find $5 1> output/$4_find.out 2> output/$4_find.err
+	$bindir/MindTheGap find -in $1 -ref $2 -kmer-size 31 -out output/$4_find $5 1> output/$4_find.out 2> output/$4_find.err
 
 	sh compare_vcf.sh output/$4_find.othervariants.vcf  $3 1> /dev/null 2>&1
 



View it on GitLab: https://salsa.debian.org/med-team/mindthegap/compare/da2a77652843afbd7526dd8230045a4e01f6ec76...e121d92c882dcc233f51a87b3d220eb9367cf527

-- 
View it on GitLab: https://salsa.debian.org/med-team/mindthegap/compare/da2a77652843afbd7526dd8230045a4e01f6ec76...e121d92c882dcc233f51a87b3d220eb9367cf527
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/20190709/8d295380/attachment-0001.html>


More information about the debian-med-commit mailing list