return that.mapping == null;
}
// TODO: can simplify by asserting fromSeq is a dataset sequence
- return (this.fromSeq == that.fromSeq || (this.fromSeq != null
- && that.fromSeq != null
- && this.fromSeq.getDatasetSequence() != null && this.fromSeq
- .getDatasetSequence() == that.fromSeq
- .getDatasetSequence())) && this.mapping.equals(that.mapping);
+ return (this.fromSeq == that.fromSeq
+ || (this.fromSeq != null && that.fromSeq != null
+ && this.fromSeq.getDatasetSequence() != null
+ && this.fromSeq.getDatasetSequence() == that.fromSeq
+ .getDatasetSequence()))
+ && this.mapping.equals(that.mapping);
}
public SequenceI getFromSeq()
SequenceI fromSeq = (dnaseq.getDatasetSequence() == null) ? dnaseq
: dnaseq.getDatasetSequence();
- SequenceI toSeq = (aaseq.getDatasetSequence() == null) ? aaseq : aaseq
- .getDatasetSequence();
+ SequenceI toSeq = (aaseq.getDatasetSequence() == null) ? aaseq
+ : aaseq.getDatasetSequence();
/*
* if we already hold a mapping between these sequences, just add to it
* where highlighted regions go
*/
public void markMappedRegion(SequenceI seq, int index,
- SearchResults results)
+ SearchResultsI results)
{
int[] codon;
SequenceI ds = seq.getDatasetSequence();
{
SequenceI targetDs = target.getDatasetSequence() == null ? target
: target.getDatasetSequence();
- SequenceI queryDs = query.getDatasetSequence() == null ? query : query
- .getDatasetSequence();
+ SequenceI queryDs = query.getDatasetSequence() == null ? query
+ : query.getDatasetSequence();
if (targetDs == null || queryDs == null /*|| dnaToProt == null*/)
{
return null;
* Read off the mapped nucleotides (converting to position base 0)
*/
codonPos = MappingUtils.flattenRanges(codonPos);
- char[] dna = dnaSeq.getSequence();
int start = dnaSeq.getStart();
- result.add(new char[] { dna[codonPos[0] - start],
- dna[codonPos[1] - start], dna[codonPos[2] - start] });
+ char c1 = dnaSeq.getCharAt(codonPos[0] - start);
+ char c2 = dnaSeq.getCharAt(codonPos[1] - start);
+ char c3 = dnaSeq.getCharAt(codonPos[2] - start);
+ result.add(new char[] { c1, c2, c3 });
}
}
return result.isEmpty() ? null : result;
*/
protected int realiseWith(SequenceI seq, boolean doUpdate)
{
- SequenceI ds = seq.getDatasetSequence() != null ? seq
- .getDatasetSequence() : seq;
+ SequenceI ds = seq.getDatasetSequence() != null
+ ? seq.getDatasetSequence()
+ : seq;
int count = 0;
/*
{
int start = replacement.getStart();
int end = replacement.getEnd();
- boolean mappingOverlapsSequence = (mapStart >= start && mapStart <= end)
- || (mapEnd >= start && mapEnd <= end);
+ boolean mappingOverlapsSequence = (mapStart >= start
+ && mapStart <= end) || (mapEnd >= start && mapEnd <= end);
if (mappingOverlapsSequence)
{
return true;
}
/**
- * Returns the first mapping found that is between 'fromSeq' and 'toSeq', or null
- * if none found
+ * Returns the first mapping found that is between 'fromSeq' and 'toSeq', or
+ * null if none found
*
* @param fromSeq
* aligned or dataset sequence
{
SequenceI dssFrom = fromSeq.getDatasetSequence() == null ? fromSeq
: fromSeq.getDatasetSequence();
- SequenceI dssTo = toSeq.getDatasetSequence() == null ? toSeq : toSeq
- .getDatasetSequence();
+ SequenceI dssTo = toSeq.getDatasetSequence() == null ? toSeq
+ : toSeq.getDatasetSequence();
for (SequenceToSequenceMapping mapping : mappings)
{