Skip to content

Commit

Permalink
Merge branch 'release/1.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
dbolotin committed Jun 16, 2015
2 parents f923c39 + b3fb38a commit 101f3ea
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 8 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<groupId>com.milaboratory</groupId>
<artifactId>mitools</artifactId>
<version>1.0</version>
<version>1.0.1</version>
<packaging>jar</packaging>
<name>MiTools</name>
<url>http://milaboratory.com/</url>
Expand Down Expand Up @@ -94,12 +94,12 @@
<dependency>
<groupId>com.milaboratory</groupId>
<artifactId>milib</artifactId>
<version>1.0</version>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>com.milaboratory</groupId>
<artifactId>milib</artifactId>
<version>1.0</version>
<version>1.0.1</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY, isGetterVisibility = JsonAutoDetect.Visibility.NONE,
getterVisibility = JsonAutoDetect.Visibility.NONE)
@Serializable(asJson = true)
public final class MergerParameters {
public final class MergerParameters implements java.io.Serializable{
final int minimalOverlap;
final double minimalIdentity;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
import static com.milaboratory.core.sequence.SequencesUtils.mismatchCount;
import static java.lang.Math.*;

public final class MismatchOnlyPairedReadMerger implements Processor<PairedRead, PairedReadMergingResult> {
public final class MismatchOnlyPairedReadMerger implements Processor<PairedRead, PairedReadMergingResult>,
java.io.Serializable {
public static final int DEFAULT_MAX_SCORE_VALUE = 45;
final int minOverlap;
final double maxMismatchesPart;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import com.milaboratory.core.io.sequence.PairedRead;
import com.milaboratory.core.sequence.NSequenceWithQuality;

public class PairedReadMergingResult {
public class PairedReadMergingResult implements java.io.Serializable {
private static final int MATCH_SCORE = 2;
private static final int MISMATCH_SCORE = -5;

Expand Down Expand Up @@ -78,4 +78,37 @@ public int getErrors() {
int score() {
return (overlap - errors) * MATCH_SCORE + errors * MISMATCH_SCORE;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;

PairedReadMergingResult that = (PairedReadMergingResult) o;

if (overlap != that.overlap) return false;
if (errors != that.errors) return false;
if (!originalRead.equals(that.originalRead)) return false;
return overlappedSequence.equals(that.overlappedSequence);

}

@Override
public int hashCode() {
int result = originalRead.hashCode();
result = 31 * result + overlappedSequence.hashCode();
result = 31 * result + overlap;
result = 31 * result + errors;
return result;
}

@Override
public String toString() {
return "PairedReadMergingResult{" +
"originalRead=" + originalRead +
", overlappedSequence=" + overlappedSequence +
", overlap=" + overlap +
", errors=" + errors +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import cc.redberry.primitives.Filter;
import com.milaboratory.core.io.sequence.SingleRead;

public class ReadLengthFilter implements Filter<SingleRead> {
public class ReadLengthFilter implements Filter<SingleRead>, java.io.Serializable {
final int minLength;

public ReadLengthFilter(int minLength) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import java.util.concurrent.atomic.AtomicLong;

public final class SequenceTrimmer implements Processor<SingleRead, SingleRead> {
public final class SequenceTrimmer implements Processor<SingleRead, SingleRead>, java.io.Serializable {
final int qualityToTrimm;
final boolean trimmLeft, trimmRight;
final AtomicLong trimmedNucleotidesLeft = new AtomicLong(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.milaboratory.mitools.merger;

import com.milaboratory.core.io.sequence.PairedRead;
import com.milaboratory.core.io.sequence.SingleReadImpl;
import com.milaboratory.core.io.util.TestUtil;
import com.milaboratory.core.sequence.NSequenceWithQuality;
import com.milaboratory.core.sequence.NucleotideSequence;
import com.milaboratory.core.sequence.SequenceQuality;
import org.junit.Test;

/**
* Created by poslavsky on 15/04/15.
*/
public class PairedReadMergingResultTest {
@Test
public void test1() throws Exception {
PairedReadMergingResult se = new PairedReadMergingResult(new PairedRead(
new SingleReadImpl(12, new NSequenceWithQuality(new NucleotideSequence("atgc"), new SequenceQuality("++++")), "x"),
new SingleReadImpl(12, new NSequenceWithQuality(new NucleotideSequence("atgc"), new SequenceQuality("++++")), "x")),
new NSequenceWithQuality(new NucleotideSequence("atgc"), new SequenceQuality("++++")), 12, 3);
TestUtil.assertJavaSerialization(se);
}
}

0 comments on commit 101f3ea

Please sign in to comment.