1212
Bug fix: count start coord in fragment length · seqcode/seqcode-core@5b86aa2 · GitHub
Skip to content

Commit 5b86aa2

Browse files
committed
Bug fix: count start coord in fragment length
1-based coordinates should be end - start + 1 when computing fragment length
1 parent 0c3e903 commit 5b86aa2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/org/seqcode/deepseq/StrandedPair.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ public Point getMidpoint(){
5252
public int getFragmentSize(){
5353
if(!sameChrom)
5454
return -1;
55-
else if((r1Coordinate<r2Coordinate && r1Strand=='+' && r2Strand=='-') || (r2Coordinate<r1Coordinate && r2Strand=='+' && r1Strand=='-')){
56-
return Math.abs(r2Coordinate-r1Coordinate);
55+
else if((r1Coordinate<=r2Coordinate && r1Strand=='+' && r2Strand=='-') || (r2Coordinate<=r1Coordinate && r2Strand=='+' && r1Strand=='-')){
56+
return Math.abs(r2Coordinate-r1Coordinate)+1;
5757
}else{
5858
return -1;
5959
}

0 commit comments

Comments
 (0)