Skip to content

Commit 2f50155

Browse files
committed
Sequence.getReverse() has been changed to getInverse() to avoid confusion.
git-svn-id: http://code.open-bio.org/repos/biojava/biojava-live/trunk@8393 7c6358e6-4a41-0410-a743-a5b2a554c398
1 parent 7faa208 commit 2f50155

File tree

15 files changed

+101
-17
lines changed

15 files changed

+101
-17
lines changed

biojava3-alignment/src/main/java/org/biojava3/alignment/SimpleAlignedSequence.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ private void setLocation(List<Step> steps) {
372372

373373
@Override
374374
//TODO Needs to implements
375-
public SequenceView<C> getReverse() {
375+
public SequenceView<C> getInverse() {
376376
throw new UnsupportedOperationException("Not supported yet.");
377377
}
378378
}

biojava3-core/src/main/java/org/biojava3/core/sequence/DNASequence.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@
2929
import org.biojava3.core.sequence.template.CompoundSet;
3030
import org.biojava3.core.sequence.template.ProxySequenceReader;
3131
import org.biojava3.core.sequence.template.SequenceMixin;
32+
import org.biojava3.core.sequence.template.SequenceView;
3233
import org.biojava3.core.sequence.transcription.Frame;
3334
import org.biojava3.core.sequence.transcription.TranscriptionEngine;
35+
import org.biojava3.core.sequence.views.ComplementSequenceView;
36+
import org.biojava3.core.sequence.views.ReversedSequenceView;
3437

3538
/**
3639
*
@@ -83,6 +86,27 @@ public int getGCCount() {
8386
return SequenceMixin.countGC(this);
8487
}
8588

89+
/**
90+
* Returns a Sequence which runs in the current reverse order
91+
*/
92+
public SequenceView<NucleotideCompound> getReverse() {
93+
return new ReversedSequenceView<NucleotideCompound>(this);
94+
}
95+
96+
/**
97+
* Returns a Sequence which will complement every base
98+
*/
99+
public SequenceView<NucleotideCompound> getComplement() {
100+
return new ComplementSequenceView<NucleotideCompound>(this);
101+
}
102+
103+
/**
104+
* Delegates to {@link #getInverse() } for the reverse complement
105+
*/
106+
public SequenceView<NucleotideCompound> getReverseComplement() {
107+
return getInverse();
108+
}
109+
86110
/**
87111
* @return the dnaType
88112
*/

biojava3-core/src/main/java/org/biojava3/core/sequence/RNASequence.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ public RNASequence(ProxySequenceReader<NucleotideCompound> proxyLoader,
5656
}
5757

5858
public SequenceView<NucleotideCompound> getReverseComplement() {
59-
return new ComplementSequenceView<NucleotideCompound>(getReverse());
59+
return new ComplementSequenceView<NucleotideCompound>(getInverse());
6060
}
6161

62-
public SequenceView<NucleotideCompound> getReverse() {
62+
public SequenceView<NucleotideCompound> getInverse() {
6363
return new ReversedSequenceView<NucleotideCompound>(this);
6464
}
6565

biojava3-core/src/main/java/org/biojava3/core/sequence/loader/SequenceFileProxyLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public int countCompounds(C... compounds) {
198198
}
199199

200200
@Override
201-
public SequenceView<C> getReverse() {
201+
public SequenceView<C> getInverse() {
202202
return SequenceMixin.reverse(this);
203203
}
204204
}

biojava3-core/src/main/java/org/biojava3/core/sequence/loader/StringProxySequenceReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public int countCompounds(C... compounds) {
138138
}
139139

140140
@Override
141-
public SequenceView<C> getReverse() {
141+
public SequenceView<C> getInverse() {
142142
return SequenceMixin.reverse(this);
143143
}
144144
}

biojava3-core/src/main/java/org/biojava3/core/sequence/loader/UniprotProxySequenceReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public List<C> getAsList() {
134134
}
135135

136136
@Override
137-
public SequenceView<C> getReverse() {
137+
public SequenceView<C> getInverse() {
138138
return SequenceMixin.reverse(this);
139139
}
140140

biojava3-core/src/main/java/org/biojava3/core/sequence/storage/ArrayListSequenceReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public int countCompounds(C... compounds) {
157157
}
158158

159159
@Override
160-
public SequenceView<C> getReverse() {
160+
public SequenceView<C> getInverse() {
161161
return SequenceMixin.reverse(this);
162162
}
163163
}

biojava3-core/src/main/java/org/biojava3/core/sequence/storage/BitSequenceReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public SequenceView<C> getSubSequence(Integer start, Integer end) {
153153
}
154154

155155
@Override
156-
public SequenceView<C> getReverse() {
156+
public SequenceView<C> getInverse() {
157157
return SequenceMixin.reverse(this);
158158
}
159159

biojava3-core/src/main/java/org/biojava3/core/sequence/storage/JoiningSequenceReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ public SequenceView<C> getSubSequence(Integer start, Integer end) {
296296
}
297297

298298
@Override
299-
public SequenceView<C> getReverse() {
299+
public SequenceView<C> getInverse() {
300300
return SequenceMixin.reverse(this);
301301
}
302302
}

biojava3-core/src/main/java/org/biojava3/core/sequence/storage/SingleCompoundSequenceReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public Iterator<C> iterator() {
155155
}
156156

157157
@Override
158-
public SequenceView<C> getReverse() {
158+
public SequenceView<C> getInverse() {
159159
return SequenceMixin.reverse(this);
160160
}
161161
}

0 commit comments

Comments
 (0)