git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-2674 Changed CigarArray constructor to use HiddenColumns iterator
[jalview.git]
/
src
/
jalview
/
ws
/
jws2
/
AbstractJabaCalcWorker.java
diff --git
a/src/jalview/ws/jws2/AbstractJabaCalcWorker.java
b/src/jalview/ws/jws2/AbstractJabaCalcWorker.java
index
8dc4bc5
..
26fe0a2
100644
(file)
--- a/
src/jalview/ws/jws2/AbstractJabaCalcWorker.java
+++ b/
src/jalview/ws/jws2/AbstractJabaCalcWorker.java
@@
-1,6
+1,6
@@
/*
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2)
- * Copyright (C) 2015 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
*
* This file is part of Jalview.
*
@@
-30,6
+30,7
@@
import jalview.datamodel.AnnotatedCollectionI;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
import jalview.gui.IProgressIndicator;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
import jalview.gui.IProgressIndicator;
+import jalview.schemes.ResidueProperties;
import jalview.workers.AlignCalcWorker;
import jalview.ws.jws2.dm.AAConSettings;
import jalview.ws.jws2.dm.JabaWsParamSet;
import jalview.workers.AlignCalcWorker;
import jalview.ws.jws2.dm.AAConSettings;
import jalview.ws.jws2.dm.JabaWsParamSet;
@@
-63,6
+64,11
@@
public abstract class AbstractJabaCalcWorker extends AlignCalcWorker
protected boolean submitGaps = true;
/**
protected boolean submitGaps = true;
/**
+ * by default, we filter out non-standard residues before submission
+ */
+ protected boolean filterNonStandardResidues = true;
+
+ /**
* Recover any existing parameters for this service
*/
protected void initViewportParams()
* Recover any existing parameters for this service
*/
protected void initViewportParams()
@@
-72,8
+78,10
@@
public abstract class AbstractJabaCalcWorker extends AlignCalcWorker
((jalview.gui.AlignViewport) alignViewport).setCalcIdSettingsFor(
getCalcId(),
new AAConSettings(true, service, this.preset,
((jalview.gui.AlignViewport) alignViewport).setCalcIdSettingsFor(
getCalcId(),
new AAConSettings(true, service, this.preset,
- (arguments != null) ? JabaParamStore
- .getJwsArgsfromJaba(arguments) : null), true);
+ (arguments != null)
+ ? JabaParamStore.getJwsArgsfromJaba(arguments)
+ : null),
+ true);
}
}
}
}
@@
-113,7
+121,7
@@
public abstract class AbstractJabaCalcWorker extends AlignCalcWorker
public List<Option> getJabaArguments()
{
public List<Option> getJabaArguments()
{
- List<Option> newargs = new ArrayList<Option>();
+ List<Option> newargs = new ArrayList<>();
if (preset != null && preset instanceof JabaWsParamSet)
{
newargs.addAll(((JabaWsParamSet) preset).getjabaArguments());
if (preset != null && preset instanceof JabaWsParamSet)
{
newargs.addAll(((JabaWsParamSet) preset).getjabaArguments());
@@
-158,8
+166,8
@@
public abstract class AbstractJabaCalcWorker extends AlignCalcWorker
super(alignViewport, alignPanel);
}
super(alignViewport, alignPanel);
}
- public AbstractJabaCalcWorker(Jws2Instance service,
- AlignFrame alignFrame, WsParamSetI preset, List<Argument> paramset)
+ public AbstractJabaCalcWorker(Jws2Instance service, AlignFrame alignFrame,
+ WsParamSetI preset, List<Argument> paramset)
{
this(alignFrame.getCurrentView(), alignFrame.alignPanel);
this.guiProgress = alignFrame;
{
this(alignFrame.getCurrentView(), alignFrame.alignPanel);
this.guiProgress = alignFrame;
@@
-316,9
+324,8
@@
public abstract class AbstractJabaCalcWorker extends AlignCalcWorker
}
if (collectAnnotationResultsFor(rslt))
{
}
if (collectAnnotationResultsFor(rslt))
{
- jalview.bin.Cache.log
- .debug("Updating result annotation from Job " + rslt
- + " at " + service.getUri());
+ jalview.bin.Cache.log.debug("Updating result annotation from Job "
+ + rslt + " at " + service.getUri());
updateResultAnnotation(true);
ap.adjustAnnotationHeight();
}
updateResultAnnotation(true);
ap.adjustAnnotationHeight();
}
@@
-328,8
+335,8
@@
public abstract class AbstractJabaCalcWorker extends AlignCalcWorker
catch (JobSubmissionException x)
{
catch (JobSubmissionException x)
{
- System.err.println("submission error with " + getServiceActionText()
- + " :");
+ System.err.println(
+ "submission error with " + getServiceActionText() + " :");
x.printStackTrace();
calcMan.disableWorker(this);
} catch (ResultNotAvailableException x)
x.printStackTrace();
calcMan.disableWorker(this);
} catch (ResultNotAvailableException x)
@@
-438,8
+445,9
@@
public abstract class AbstractJabaCalcWorker extends AlignCalcWorker
AnnotatedCollectionI inputSeqs)
{
if (alignment == null || alignment.getWidth() <= 0
AnnotatedCollectionI inputSeqs)
{
if (alignment == null || alignment.getWidth() <= 0
- || alignment.getSequences() == null || alignment.isNucleotide() ? !nucleotidesAllowed
- : !proteinAllowed)
+ || alignment.getSequences() == null || alignment.isNucleotide()
+ ? !nucleotidesAllowed
+ : !proteinAllowed)
{
return null;
}
{
return null;
}
@@
-450,23
+458,24
@@
public abstract class AbstractJabaCalcWorker extends AlignCalcWorker
inputSeqs = alignment;
}
inputSeqs = alignment;
}
- List<compbio.data.sequence.FastaSequence> seqs = new ArrayList<compbio.data.sequence.FastaSequence>();
+ List<compbio.data.sequence.FastaSequence> seqs = new ArrayList<>();
int minlen = 10;
int ln = -1;
if (bySequence)
{
int minlen = 10;
int ln = -1;
if (bySequence)
{
- seqNames = new HashMap<String, SequenceI>();
+ seqNames = new HashMap<>();
}
gapMap = new boolean[0];
start = inputSeqs.getStartRes();
end = inputSeqs.getEndRes();
}
gapMap = new boolean[0];
start = inputSeqs.getStartRes();
end = inputSeqs.getEndRes();
- for (SequenceI sq : ((List<SequenceI>) inputSeqs.getSequences()))
+ for (SequenceI sq : (inputSeqs.getSequences()))
{
{
- if (bySequence ? sq.findPosition(end + 1)
- - sq.findPosition(start + 1) > minlen - 1 : sq.getEnd()
- - sq.getStart() > minlen - 1)
+ if (bySequence
+ ? sq.findPosition(end + 1)
+ - sq.findPosition(start + 1) > minlen - 1
+ : sq.getEnd() - sq.getStart() > minlen - 1)
{
String newname = SeqsetUtils.unique_name(seqs.size() + 1);
// make new input sequence with or without gaps
{
String newname = SeqsetUtils.unique_name(seqs.size() + 1);
// make new input sequence with or without gaps
@@
-491,7
+500,14
@@
public abstract class AbstractJabaCalcWorker extends AlignCalcWorker
}
for (int apos : sq.gapMap())
{
}
for (int apos : sq.gapMap())
{
- gapMap[apos] = true; // aligned.
+ char sqc = sq.getCharAt(apos);
+ if (!filterNonStandardResidues
+ || (sq.isProtein() ? ResidueProperties.aaIndex[sqc] < 20
+ : ResidueProperties.nucleotideIndex[sqc] < 5))
+ {
+ gapMap[apos] = true; // aligned and real amino acid residue
+ }
+ ;
}
}
else
}
}
else
@@
-524,8
+540,8
@@
public abstract class AbstractJabaCalcWorker extends AlignCalcWorker
FastaSequence sq = seqs.get(p);
int l = sq.getSequence().length();
// strip gapped columns
FastaSequence sq = seqs.get(p);
int l = sq.getSequence().length();
// strip gapped columns
- char[] padded = new char[realw], orig = sq.getSequence()
- .toCharArray();
+ char[] padded = new char[realw],
+ orig = sq.getSequence().toCharArray();
for (int i = 0, pp = 0; i < realw; pp++)
{
if (gapMap[pp])
for (int i = 0, pp = 0; i < realw; pp++)
{
if (gapMap[pp])