Skip to content
Snippets Groups Projects
Commit a645ad57 authored by tcarver's avatar tcarver
Browse files

fix for creating features from read peaks with concat sequences

parent a5f7f9d5
No related branches found
No related tags found
No related merge requests found
......@@ -166,6 +166,7 @@ class BamUtils
final String refName,
final int start,
final int end,
final int concatShift,
final int cnt[][],
final SAMRecordPredicate samRecordFlagPredicate,
final SAMRecordPredicate samRecordMapQPredicate)
......@@ -194,7 +195,7 @@ class BamUtils
int refStart = block.getReferenceStart();
for(int i=0; i<block.getLength(); i++)
{
int pos = refStart + i;
int pos = refStart + i + concatShift;
int bin = pos - start;
if(bin < 0 || bin > cnt.length-1)
continue;
......
......@@ -487,9 +487,20 @@ public class MappedReads
if( (start >= offset && start <= offset+len) ||
(stop >= offset && start <= offset+len) )
{
int thisStart = start-offset;
if(thisStart < 1)
thisStart = 1;
int thisEnd = stop-offset;
if(thisEnd > len)
thisEnd = len;
int concatShift = 0;
if(offset > start)
concatShift = offset-start;
cnt =
BamUtils.countOverRange(bamList.get(i), samFileReaderHash,
name, start-offset, stop-offset, cnt,
name, thisStart, thisEnd, concatShift, cnt,
samRecordFlagPredicate, samRecordMapQPredicate);
}
}
......@@ -498,7 +509,7 @@ public class MappedReads
{
cnt =
BamUtils.countOverRange(bamList.get(i), samFileReaderHash,
refSeq, start, stop, cnt,
refSeq, start, stop, 0, cnt,
samRecordFlagPredicate, samRecordMapQPredicate);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment