[med-svn] [Git][med-team/logol][master] 5 commits: New upstream version 1.7.8
Olivier Sallou
gitlab at salsa.debian.org
Wed Apr 4 14:43:06 BST 2018
Olivier Sallou pushed to branch master at Debian Med / logol
Commits:
50db23f5 by Olivier Sallou at 2018-04-04T13:32:58+00:00
New upstream version 1.7.8
- - - - -
e89726d6 by Olivier Sallou at 2018-04-04T13:33:00+00:00
Updated version 1.7.8 from 'upstream/1.7.8'
with Debian dir 957d74bf2aa367f09770cf1e94c77075d81fae9a
- - - - -
ece97fa4 by Olivier Sallou at 2018-04-04T13:34:29+00:00
new upstream release 1.7.8-1
- - - - -
85892d37 by Olivier Sallou at 2018-04-04T13:36:55+00:00
upload new upstream release 1.7.8
- - - - -
c5fa9610 by Olivier Sallou at 2018-04-04T13:41:53+00:00
remove old unused patches
- - - - -
13 changed files:
- CHANGELOG.txt
- build.xml
- debian/changelog
- debian/copyright
- − debian/patches/fix_pldoc
- − debian/patches/fix_pldoc2tex_generation
- − debian/patches/fix_swipl_module_declaration
- − debian/patches/harden_swipl_declarations
- prolog/logol.pl
- src/org/irisa/genouest/logol/SequenceAnalyser.java
- src/org/irisa/genouest/logol/test/GrammarTest.java
- + test/end_of_stream1.logol
- + test/end_of_stream2.logol
Changes:
=====================================
CHANGELOG.txt
=====================================
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,4 +1,6 @@
History:
+1.7.8: 03/04/18 O. Sallou - Detect process execution failure (out of memory, etc.) and display error message
+1.7.7: 08/12/17 O. Sallou - Fix *not* and *spacer* contraints when reaching end of sequence (last characters)
1.7.6: 07/12/17 O. Sallou - Fix endConstraint, was comparing end position + 1 instead of end position
1.7.5: 09/09/16 O. Sallou - Fix way to load characters from sequence file to increase performance
1.7.4: 08/01/16 O. Sallou - Fix multiexec error message display
=====================================
build.xml
=====================================
--- a/build.xml
+++ b/build.xml
@@ -10,7 +10,7 @@
target.dir=/path_where_files_should_be_installed
-->
- <property name="version" value="1.7.6" />
+ <property name="version" value="1.7.8" />
<condition property="ruby_path" value="${env.RUBY_PATH}"
else="">
=====================================
debian/changelog
=====================================
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+logol (1.7.8-1) unstable; urgency=medium
+
+ * New upstream release (bug fixes)
+
+ -- Olivier Sallou <osallou at debian.org> Wed, 04 Apr 2018 13:33:57 +0000
+
logol (1.7.6-1) unstable; urgency=medium
* New upstream release
=====================================
debian/copyright
=====================================
--- a/debian/copyright
+++ b/debian/copyright
@@ -2,17 +2,17 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: logol
Source: https://gforge.inria.fr/projects/logolexec
+Files: *
+Copyright: 2015 Olivier Sallou <olivier.sallou at irisa.fr>
+License: AGPL-3.0+
+ License can be found at https://www.gnu.org/licenses/agpl-3.0.html
+
Files: Doc/pldoc.sty
Copyright: 1985-2004 University of Amsterdam
License: LGPL-2+
On Debian systems, you can find the GNU Lesser General Public License in
the file /usr/share/common-licenses/LGPL-2
-Files: *
-Copyright: 2015 Olivier Sallou <olivier.sallou at irisa.fr>
-License: AGPL-3.0+
- License can be found at https://www.gnu.org/licenses/agpl-3.0.html
-
Files: debian/*
Copyright: 2011 Olivier Sallou <olivier.sallou at irisa.fr>
License: GPL-2+
=====================================
debian/patches/fix_pldoc deleted
=====================================
--- a/debian/patches/fix_pldoc
+++ /dev/null
@@ -1,16 +0,0 @@
-Subject: adapt to new swi-prolog
-Description: swipl doc generation changed and breaks
- current definition
-Author: Olivier Sallou <osallou at debian.org>
-Last-Updated: 2013-12-01
-Forwarded: yes
-Bug: 739916
-Upstream-Bug: https://gforge.inria.fr/tracker/index.php?func=detail&aid=16708&group_id=1318&atid=5219
---- a/tools/swidoc.pl
-+++ b/tools/swidoc.pl
-@@ -1,4 +1,4 @@
- :- use_module(library(doc_latex)).
--:- current_prolog_flag(argv,[_,_,_,_,Doc]),open('logol.tex',write,OS),latex_for_file(Doc,OS,[]),close(OS).
-+:- open('logol.tex',write,OS),latex_for_file('logoldoc.pl',OS,[]),close(OS).
-
- :-halt.
=====================================
debian/patches/fix_pldoc2tex_generation deleted
=====================================
--- a/debian/patches/fix_pldoc2tex_generation
+++ /dev/null
@@ -1,21 +0,0 @@
-Subject: generated tex by pldoc not supported by texlive
-Description: lpdoc generate tex file from prolog. Generated file
- fails to be converted with pdflatex since later releases.
- This patch modifies generated file to support pdf conversion.
-Author: Olivier Sallou <osallou at debian.org>
-Last-Updated: 2013-08-08
-Forwarded: yes
-Bug: 719079
---- a/tools/generate-doc.sh
-+++ b/tools/generate-doc.sh
-@@ -2,6 +2,10 @@
-
- sed 's/,\[assertions,basicmodes,functions,regtypes,hiord\]//' ../prolog/logol.pl > logoldoc.pl
- swipl -f swidoc.pl -- logoldoc.pl
-+
-+sed -i 's/makeindex/makeindex\n\\newenvironment{arguments}{\\textbf{Arguments} \\newline}{\\vspace*{0.5\\baselineskip}}/' logol.tex
-+sed -i 's/} &/}/g' logol.tex
-+
- pdflatex logol.tex
-
- rm logoldoc.pl
=====================================
debian/patches/fix_swipl_module_declaration deleted
=====================================
--- a/debian/patches/fix_swipl_module_declaration
+++ /dev/null
@@ -1,13 +0,0 @@
-Subject: fix module declaration for swipl, different from sicstus-prolog.
-Description: for swipl, default used in packaging, the module declaration is different. This patch fix this difference. Upstream manage both
-Forwarded: No
-Author: Olivier Sallou <osallou at debian.org>
-Last-Updated: 2013-10-07
---- a/prolog/logol.pl
-+++ b/prolog/logol.pl
-@@ -1,4 +1,4 @@
--:- module(logol,[writeFinalMatches/0,isMin/5,replaceMatch/4,appendMatch/3,getCounter/1,config/1,optimalmatch/5,matchstore/2,isMax/3,parseResults/2,checkAlphabetPercentage/3,mapListExact/2,mapListGlobal/2,mapListLocal/2,mapListLocal0/2,matchExist/2,mapModels/3,externalinterfacewithspacer/2,externalinterface/2,notpred_pos/6,between/3,notexact_pos/6,notexact/3,matchExist/1,mapModels/2,mapList/2,mydb/1,matchlist/2,isexactwithgaponly/5,isexactwithgaponly_pos/5,setParent/2,getParent/2,logData/2,logolMain/5,cut_sequence/3,isequal/2,isexact_pos/4,isexactwithgapanderror_pos/5,isexactwitherroronly_pos/5,spacer_withresult_pos/5,wordSize_pos/4,getPosition_pos/3,wordContent_pos/4,checkPosition_pos/4,anySpacer_pos/7,repeatPredicate_pos/14,testOverlap_pos/5,getsuffixmatch_pos/12,getWordContent/4,openSequenceStream/2,closeSequenceStream/0,getCharsFromPosition/3,getNChar/3,resetParamList/3,getKnownVariables/2,getPosition/3,myCost/4,getDistance/3,initResultFile/1,closeResultFile/1,getParentVariable/2,is4me/5,outputfile/1,writeallresult/2,maxsize/1,getresult/2,offset/1,setSequence/2,computeCost/2,getsuffixmatch/12,writeSequence/2,sequenceData/3,suffixmatch/9,repeatPredicate/14,anySpacer/5,anySpacer/7,any/2,isoverlap/5,morphism/3,spacer_withresult/5,isexact/3,isexact/4,isexact/5,isexactwithgapanderror/4,isexactwithgapanderror/5,isexactwitherroronly/4,isexactwitherroronly/5,matrix/3, iscompequal/2,getcomplement/2,getreversecomplement/2,applymorphism/4, checkCost/4,cost/4,parentalCost/4,varDefinition/5,saveVariable/8,getVariable/9,removeVariable/1,wordSize/3,wordSize/4,percent/3,percent2int/3,checkCost/4,checkCost/5,checkPosition/3,checkPosition/5,checkRelativePosition/4,getContent/3,getContent/4,pushResult/2,countAlphabet/4,isexactwithdistinctgapanderror_pos/7],[assertions,basicmodes,functions,regtypes,hiord]).
-+:- module(logol,[writeFinalMatches/0,isMin/5,replaceMatch/4,appendMatch/3,getCounter/1,config/1,optimalmatch/5,matchstore/2,isMax/3,parseResults/2,checkAlphabetPercentage/3,mapListExact/2,mapListGlobal/2,mapListLocal/2,mapListLocal0/2,matchExist/2,mapModels/3,externalinterfacewithspacer/2,externalinterface/2,notpred_pos/6,between/3,notexact_pos/6,notexact/3,matchExist/1,mapModels/2,mapList/2,mydb/1,matchlist/2,isexactwithgaponly/5,isexactwithgaponly_pos/5,setParent/2,getParent/2,logData/2,logolMain/5,cut_sequence/3,isequal/2,isexact_pos/4,isexactwithgapanderror_pos/5,isexactwitherroronly_pos/5,spacer_withresult_pos/5,wordSize_pos/4,getPosition_pos/3,wordContent_pos/4,checkPosition_pos/4,anySpacer_pos/7,repeatPredicate_pos/14,testOverlap_pos/5,getsuffixmatch_pos/12,getWordContent/4,openSequenceStream/2,closeSequenceStream/0,getCharsFromPosition/3,getNChar/3,resetParamList/3,getKnownVariables/2,getPosition/3,myCost/4,getDistance/3,initResultFile/1,closeResultFile/1,getParentVariable/2,is4me/5,outputfile/1,writeallresult/2,maxsize/1,getresult/2,offset/1,setSequence/2,computeCost/2,getsuffixmatch/12,writeSequence/2,sequenceData/3,suffixmatch/9,repeatPredicate/14,anySpacer/5,anySpacer/7,any/2,isoverlap/5,morphism/3,spacer_withresult/5,isexact/3,isexact/4,isexact/5,isexactwithgapanderror/4,isexactwithgapanderror/5,isexactwitherroronly/4,isexactwitherroronly/5,matrix/3, iscompequal/2,getcomplement/2,getreversecomplement/2,applymorphism/4, checkCost/4,cost/4,parentalCost/4,varDefinition/5,saveVariable/8,getVariable/9,removeVariable/1,wordSize/3,wordSize/4,percent/3,percent2int/3,checkCost/4,checkCost/5,checkPosition/3,checkPosition/5,checkRelativePosition/4,getContent/3,getContent/4,pushResult/2,countAlphabet/4,isexactwithdistinctgapanderror_pos/7],[]).
-
-
- /** <module> Logol Prolog API
=====================================
debian/patches/harden_swipl_declarations deleted
=====================================
--- a/debian/patches/harden_swipl_declarations
+++ /dev/null
@@ -1,16 +0,0 @@
-Author: Olivier Sallou <osallou at debian.org>
-Subject: swi-prolog raise error instead of warnings for undefined modules
-Description: swi-prolog raise an error for exported procedure not matching
- declared procedure.
- It also raises error on modules declared for sicstus prolog. Patch need to
- remove them (not needed for swi-prolog)
-Forwarded: yes
-Bug: https://gforge.inria.fr/tracker/index.php?func=detail&aid=16249&group_id=1318&atid=5219
---- a/prolog/logol.pl
-+++ b/prolog/logol.pl
-@@ -1,4 +1,4 @@
--:- module(logol,[writeFinalMatches/0,isMin/5,replaceMatch/4,appendMatch/3,getCounter/1,config/1,optimalmatch/5,matchstore/2,isMax/3,parseResults/2,checkAlphabetPercentage/3,mapListExact/2,mapListGlobal/2,mapListLocal/2,mapListLocal0/2,matchExist/2,mapModels/3,externalinterfacewithspacer/2,externalinterface/2,notpred_pos/6,between/3,notexact_pos/6,notexact/3,matchExist/1,mapModels/2,mapList/2,mydb/1,matchlist/2,isexactwithgaponly/5,isexactwithgaponly_pos/5,setParent/2,getParent/2,logData/2,logolMain/5,cut_sequence/3,isequal/2,isexact_pos/4,isexactwithgapanderror_pos/5,isexactwitherroronly_pos/5,spacer_withresult_pos/5,wordSize_pos/4,getPosition_pos/3,wordContent_pos/4,checkPosition_pos/4,anySpacer_pos/7,repeatPredicate_pos/14,testOverlap_pos/5,getsuffixmatch_pos/12,getWordContent/4,openSequenceStream/1,closeSequenceStream/0,getCharsFromPosition/3,getNChar/3,resetParamList/3,getKnownVariables/2,getPosition/3,myCost/4,getDistance/3,initResultFile/1,closeResultFile/1,getParentVariable/2,is4me/5,outputfile/1,writeallresult/2,maxsize/1,getresult/2,offset/1,setSequence/2,computeCost/2,getsuffixmatch/12,writeSequence/2,sequenceData/3,suffixmatch/9,repeatPredicate/14,anySpacer/5,anySpacer/7,any/2,isoverlap/5,morphism/3,spacer_withresult/5,isexact/3,isexact/4,isexact/5,isexactwithgapanderror/4,isexactwithgapanderror/5,isexactwitherroronly/4,isexactwitherroronly/5,matrix/3, iscompequal/2,getcomplement/2,getreversecomplement/2,applymorphism/4, checkCost/4,cost/4,parentalCost/4,varDefinition/5,saveVariable/7,saveVariableByRef/7,saveVariable/8,getVariable/9,removeVariable/1,wordSize/3,wordSize/4,percent/3,percent2int/3,checkCost/4,checkCost/5,checkPosition/3,checkPosition/5,checkRelativePosition/4,getContent/3,getContent/4,pushResult/2],[assertions,basicmodes,functions,regtypes,hiord]).
-+:- module(logol,[writeFinalMatches/0,isMin/5,replaceMatch/4,appendMatch/3,getCounter/1,config/1,optimalmatch/5,matchstore/2,isMax/3,parseResults/2,checkAlphabetPercentage/3,mapListExact/2,mapListGlobal/2,mapListLocal/2,mapListLocal0/2,matchExist/2,mapModels/3,externalinterfacewithspacer/2,externalinterface/2,notpred_pos/6,between/3,notexact_pos/6,notexact/3,matchExist/1,mapModels/2,mapList/2,mydb/1,matchlist/2,isexactwithgaponly/5,isexactwithgaponly_pos/5,setParent/2,getParent/2,logData/2,logolMain/5,cut_sequence/3,isequal/2,isexact_pos/4,isexactwithgapanderror_pos/5,isexactwitherroronly_pos/5,spacer_withresult_pos/5,wordSize_pos/4,getPosition_pos/2,wordContent_pos/4,checkPosition_pos/4,anySpacer_pos/7,repeatPredicate_pos/14,testOverlap_pos/5,getsuffixmatch_pos/12,getWordContent/4,openSequenceStream/2,closeSequenceStream/0,getCharsFromPosition/3,getNChar/3,resetParamList/3,getKnownVariables/2,getPosition/3,myCost/4,getDistance/3,initResultFile/1,closeResultFile/1,getParentVariable/2,is4me/5,outputfile/1,writeallresult/2,maxsize/1,getresult/2,offset/1,setSequence/2,computeCost/2,getsuffixmatch/12,writeSequence/2,sequenceData/3,suffixmatch/9,repeatPredicate/14,anySpacer/5,anySpacer/7,any/2,isoverlap/5,morphism/3,spacer_withresult/5,isexact/3,isexact/4,isexact/5,isexactwithgapanderror/4,isexactwithgapanderror/5,isexactwitherroronly/4,isexactwitherroronly/5,matrix/3, iscompequal/2,getcomplement/2,getreversecomplement/2,applymorphism/4, checkCost/4,cost/4,parentalCost/4,varDefinition/5,saveVariable/8,saveVariable/9,getVariable/9,removeVariable/1,wordSize/3,wordSize/4,percent/3,percent2int/3,checkCost/4,checkCost/5,checkPosition/3,checkPosition/5,checkRelativePosition/4,getContent/3,getContent/4,pushResult/2,countAlphabet/4,isexactwithdistinctgapanderror_pos/7],[]).
-
-
- /** <module> Logol Prolog API
=====================================
prolog/logol.pl
=====================================
--- a/prolog/logol.pl
+++ b/prolog/logol.pl
@@ -1013,7 +1013,8 @@ spacer_withresult([X|Y],Min, Max, Word, Z) :- (((Min=0,NewX=[X|Y]);(Min>0,cut_se
%spacer_withresult([X|Y],Min, Max, Z, Word) :- N is 0,((Min=0,Z=[X | Y]);(spacer_withresult([X|Y],N,Min,Max,Z,[], Word))).
% sub predicate, do not call directly
-spacer_withresult([], N, Min, Max, Z, Spacer, Word) :- fail.
+%spacer_withresult([], N, Min, Max, Z, Spacer, Word) :- fail.
+spacer_withresult([], N, Min, Max, Z, Spacer, Word) :- Word=Spacer.
% sub predicate, do not call directly
%spacer_withresult([X|Y],N, Min, Max, Z, Spacer, Word) :- Ninc is N+1,append(Spacer, [X], IncWord),((Ninc<Max,isalphabet(X), spacer_withresult(Y,Ninc,Min,Max,Z,IncWord, Word));(Ninc>=Min,Z = Y, Word=IncWord)).
spacer_withresult([X|Y],N, Min, Max, Z, Spacer, Word) :- (Z = [X |Y], Word=Spacer); (Ninc is N+1,append(Spacer, [X], IncWord),Ninc=<Max, spacer_withresult(Y,Ninc,Min,Max,Z,IncWord, Word)).
@@ -2459,7 +2460,7 @@ between(Min,Cur,Max,Value):-Cur=<Max,(Value=Cur;Next is Cur + 1,between(Min,Next
% Fix 1406
% Call predicate. If match, return last argument e.g. position, else return 0.
callpred(Pred,OutPos,Pos):- (Pred ,(Pred=..VarDef,nth0(OutPos,VarDef,Pos)));(Pos=0).
-notpred_pos(VarId,StartPos,Pred,Min,Max,Value):-random(Id),retractall(hasmatch(Id,_)),Pred=..VarDef,length(VarDef,Predlength),OutPos is Predlength - 1,PosMin is StartPos + Min, PosMax is StartPos + Max,!,between(StartPos,PosMax,Value),(callpred(Pred,OutPos,Pos) , ((\+hasmatch(Id,Pos) -> (assert(hasmatch(Id,Pos)));1=1),\+hasmatch(Id,Value),assert(hasmatch(Id,Value)))),Value>=PosMin.
+notpred_pos(VarId,StartPos,Pred,Min,Max,OutputPos):-random(Id),retractall(hasmatch(Id,_)),Pred=..VarDef,length(VarDef,Predlength),OutPos is Predlength - 1,PosMin is StartPos + Min, PosMax is StartPos + Max,!,between(StartPos,PosMax,Value),(callpred(Pred,OutPos,Pos) , ((\+hasmatch(Id,Pos) -> (assert(hasmatch(Id,Pos)));1=1),\+hasmatch(Id,Value),assert(hasmatch(Id,Value)))),Value>=PosMin,ValueLength is Value - StartPos,getCharsFromPosition(StartPos,ValueLength,FoundWord),length(FoundWord,FoundLength),FoundLength >= Min, FoundLength=<Max, OutputPos is StartPos+FoundLength.
% Test predicate to use with predicate requiring a position relative predicate as parameter.
=====================================
src/org/irisa/genouest/logol/SequenceAnalyser.java
=====================================
--- a/src/org/irisa/genouest/logol/SequenceAnalyser.java
+++ b/src/org/irisa/genouest/logol/SequenceAnalyser.java
@@ -22,7 +22,7 @@ import org.irisa.genouest.logol.utils.MySequence;
public class SequenceAnalyser extends Thread {
private static final Logger logger = Logger.getLogger(org.irisa.genouest.logol.SequenceAnalyser.class);
-
+
String executable=null;
String prologFile=null;
String savFile=null;
@@ -35,12 +35,12 @@ public class SequenceAnalyser extends Thread {
long sequenceId;
int status=0;
String msg=null;
-
+
String resultFileName=null;
String maxSolutions=null;
-
+
int minTreeIndex=2;
-
+
Sequence sequence=null;
@@ -54,18 +54,18 @@ public class SequenceAnalyser extends Thread {
endOffset=end;
sequenceId=0;
sequenceOffset=offset;
-
+
outputFile=output+".fasta";
logger.debug("output file = "+outputFile);
maxSolutions=max;
-
-
-
+
+
+
}
-
-
-
+
+
+
SequenceAnalyser(String exec,String proFile,String savFilePath,String sequence,String header,long start,long end,String output, String max,int offset) {
executable = exec;
prologFile=proFile;
@@ -77,7 +77,7 @@ public class SequenceAnalyser extends Thread {
endOffset=end;
sequenceId=0;
sequenceOffset=offset;
-
+
outputFile=output+".fasta";
logger.debug("output file = "+outputFile);
@@ -87,9 +87,9 @@ public class SequenceAnalyser extends Thread {
public void run() {
logger.debug("Start thread for file sequence "+sequenceId);
// read and save partial file
-
- long lv_startTime = System.currentTimeMillis();
-
+
+ long lv_startTime = System.currentTimeMillis();
+
try {
//rewriteSequence(sequenceFileName,outputFile,startOffset,endOffset);
File outFile = new File(outputFile);
@@ -101,7 +101,7 @@ public class SequenceAnalyser extends Thread {
BufferedReader br = new BufferedReader(new FileReader(outputFile));
headerFile = br.readLine();
br.close();
-
+
// Create a file if type is RNA or DNA so that external scripts know the type of sequence
if(Treatment.dataType==Constants.DNA || Treatment.dataType==Constants.RNA) {
FileWriter typeFile = new FileWriter(outputFile+".index.dna");
@@ -109,11 +109,11 @@ public class SequenceAnalyser extends Thread {
dnaos.write("dna/rna");
dnaos.close();
}
-
+
} catch (IOException e1) {
logger.error("Error while rewriting sequence file "+e1.getMessage());
}
-
+
//create tree
try {
createTree();
@@ -122,7 +122,7 @@ public class SequenceAnalyser extends Thread {
msg="Coudld not make tree for suffix array: "+e.getMessage();
return;
}
-
+
try {
callProgram();
} catch (IOException e) {
@@ -130,66 +130,66 @@ public class SequenceAnalyser extends Thread {
msg="Coudld not execute program: "+e.getMessage();
return;
}
-
+
long lv_endTime = System.currentTimeMillis();
-
+
logger.debug("Thread for "+outputFile+" terminated in "+(lv_endTime-lv_startTime));
-
+
}
-
+
@Deprecated
private void rewriteSequence(String sequenceFileName,String outputFile,long startOffset, long endOffset) throws IOException {
-
-
+
+
FileWriter out = new FileWriter(outputFile);
BufferedWriter bw = new BufferedWriter(out);
int record;
-
+
File wholeSequence = new File(sequenceFileName);
RandomAccessFile input = new RandomAccessFile(wholeSequence,"r");
-
-
-
+
+
+
long size=0;
-
+
bw.write(headerFile+"\n");
-
+
if(endOffset>startOffset) {
// reading in left to right
- input.seek(startOffset);
-
- while((size<(endOffset-startOffset)) && (record = input.read())!=-1) {
+ input.seek(startOffset);
+
+ while((size<(endOffset-startOffset)) && (record = input.read())!=-1) {
size++;
if(Character.isLetter(record)) {
-
+
bw.write(Character.toLowerCase(record));
}
- }
-
+ }
+
}
else {
- input.seek(startOffset-1);
+ input.seek(startOffset-1);
long pos=startOffset-1;
- while((size<(startOffset-endOffset)) && (record = input.read())!=-1) {
+ while((size<(startOffset-endOffset)) && (record = input.read())!=-1) {
size++;
pos--;
if(Character.isLetter(record)) {
bw.write(Character.toLowerCase(record));
}
input.seek(pos);
- }
-
-
+ }
+
+
}
-
+
bw.close();
input.close();
}
-
-
+
+
private void callProgram() throws IOException {
- Runtime runtime = Runtime.getRuntime();
+ Runtime runtime = Runtime.getRuntime();
long fileOffset= startOffset;
if(endOffset<startOffset) {
fileOffset = endOffset;
@@ -197,33 +197,38 @@ public class SequenceAnalyser extends Thread {
//long offset = sequenceOffset + fileOffset - headerFile.length();
//TODO CHECK offset is ok
long offset = sequenceOffset + fileOffset;
-
+
String parameters = " "+outputFile+" "+resultFileName+" "+maxSolutions+" "+offset+" "+headerFile.getBytes().length;
//FIXME to use global exe, add logol generated file as parameter and call logol.exe in prolog dir
parameters+=" "+prologFile+" "+savFile;
-
+
logger.debug("Call program with params: "+parameters);
-
+
Process logol = runtime.exec(executable+parameters);
try {
PrintStream os = new PrintStream(logol.getOutputStream());
os.println("");
os.flush();
-
+
StreamGobbler s1 = new StreamGobbler ("stdin", logol.getInputStream ());
StreamGobbler s2 = new StreamGobbler ("stderr", logol.getErrorStream ());
s1.start ();
s2.start ();
logger.debug("start program execution ");
logol.waitFor();
-
+ int status_code = logol.exitValue();
+ if(status_code != 0){
+ logger.error("Program exited with wrong status code: " + status_code);
+ throw new IOException("Program exited with wrong status code");
+ }
+
logger.debug("program is over, results are available in file "+resultFileName);
os.close();
} catch (InterruptedException e) {
logger.error("Error during execution "+ e.getMessage());
- }
-
+ }
+
}
private void createTree() throws IOException {
@@ -234,17 +239,17 @@ public class SequenceAnalyser extends Thread {
case 2: { lv_type="protein"; break; }
}
logger.debug("Create tree for "+outputFile);
-
+
String suffixPath="";
- if(Logol.getSuffixPath()!=null) {
+ if(Logol.getSuffixPath()!=null) {
suffixPath=Logol.getSuffixPath()+System.getProperty(Constants.FILESEPARATORPROPERTY);
logger.debug("Create tree with path: "+suffixPath);
}
else {
logger.warn("Path to suffix search tool is not set in system environment. Will try to execute directly but may fail if not in PATH of current user");
}
-
- Runtime runtime = Runtime.getRuntime();
+
+ Runtime runtime = Runtime.getRuntime();
String command = null;
switch(Logol.getSuffixTool()) {
case 0:
@@ -276,7 +281,7 @@ public class SequenceAnalyser extends Thread {
PrintStream os = new PrintStream(mkvtree.getOutputStream());
os.println("");
os.flush();
-
+
StreamGobbler s1 = new StreamGobbler ("stdin", mkvtree.getInputStream ());
StreamGobbler s2 = new StreamGobbler ("stderr", mkvtree.getErrorStream ());
s1.start ();
@@ -294,7 +299,7 @@ public class SequenceAnalyser extends Thread {
logger.error("could not create Tree "+ e.getMessage());
}
}
-
+
}
}
=====================================
src/org/irisa/genouest/logol/test/GrammarTest.java
=====================================
--- a/src/org/irisa/genouest/logol/test/GrammarTest.java
+++ b/src/org/irisa/genouest/logol/test/GrammarTest.java
@@ -2350,6 +2350,52 @@ public class GrammarTest {
}
}
+ @Test
+ public void testEndOfStream1() {
+
+ init();
+
+ Vector<String[]> result = new Vector<String[]>();
+ result.add(new String[] {"LogolVAR_1","32","38"});
+ result.add(new String[] {"LogolVAR_2","39","40"});
+ execute("test.fasta","end_of_stream1.logol");
+
+ try {
+ checkResult(result,0);
+ } catch (ParserConfigurationException e) {
+ fail(e.getMessage());
+ } catch (SAXException e) {
+ fail(e.getMessage());
+ } catch (IOException e) {
+ fail(e.getMessage());
+ } catch (TransformerException e) {
+ fail(e.getMessage());
+ }
+ }
+
+ @Test
+ public void testEndOfStream2() {
+
+ init();
+
+ Vector<String[]> result = new Vector<String[]>();
+ result.add(new String[] {"LogolVAR_1","32","38"});
+ result.add(new String[] {"LogolVAR_2","39","40"});
+ execute("test.fasta","end_of_stream2.logol");
+
+ try {
+ checkNoMatch(result,0);
+ } catch (ParserConfigurationException e) {
+ fail(e.getMessage());
+ } catch (SAXException e) {
+ fail(e.getMessage());
+ } catch (IOException e) {
+ fail(e.getMessage());
+ } catch (TransformerException e) {
+ fail(e.getMessage());
+ }
+ }
+
@Test
public void testRubyCassiopee() {
try {
=====================================
test/end_of_stream1.logol
=====================================
--- /dev/null
+++ b/test/end_of_stream1.logol
@@ -0,0 +1,6 @@
+def:{
+morphism(foo,a,g)
+}
+mod1()==>"ccaccat",!("taa"|"tga"|"tag"):{#[2,2]}
+
+mod1()==*>SEQ1
=====================================
test/end_of_stream2.logol
=====================================
--- /dev/null
+++ b/test/end_of_stream2.logol
@@ -0,0 +1,6 @@
+def:{
+morphism(foo,a,g)
+}
+mod1()==>"ccaccat",!("taa"|"tga"|"tag"):{#[3,3]}
+
+mod1()==*>SEQ1
View it on GitLab: https://salsa.debian.org/med-team/logol/compare/874d09b1227f4bf0b72d5f634e0797dc135656d0...c5fa9610279b633f0d332737226acc3a966cd095
---
View it on GitLab: https://salsa.debian.org/med-team/logol/compare/874d09b1227f4bf0b72d5f634e0797dc135656d0...c5fa9610279b633f0d332737226acc3a966cd095
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/debian-med-commit/attachments/20180404/097217cd/attachment-0001.html>
More information about the debian-med-commit
mailing list