Skip to content
Snippets Groups Projects
Commit 3bce8d27 authored by tjc's avatar tjc
Browse files

fix coverage for reads with gaps

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@14128 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent bcdebdbe
No related branches found
No related tags found
No related merge requests found
...@@ -43,6 +43,7 @@ import javax.swing.JMenuItem; ...@@ -43,6 +43,7 @@ import javax.swing.JMenuItem;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JPopupMenu; import javax.swing.JPopupMenu;
import net.sf.samtools.AlignmentBlock;
import net.sf.samtools.SAMRecord; import net.sf.samtools.SAMRecord;
public class CoveragePanel extends JPanel public class CoveragePanel extends JPanel
...@@ -147,8 +148,6 @@ import net.sf.samtools.SAMRecord; ...@@ -147,8 +148,6 @@ import net.sf.samtools.SAMRecord;
int offset = jamView.getSequenceOffset(thisRead.getReferenceName()); int offset = jamView.getSequenceOffset(thisRead.getReferenceName());
offset = offset - jamView.getBaseAtStartOfView(); offset = offset - jamView.getBaseAtStartOfView();
int length = thisRead.getReadLength();
String fileName; String fileName;
if(bamList.size() > 1) if(bamList.size() > 1)
fileName = bamList.get((Integer) thisRead.getAttribute("FL")); fileName = bamList.get((Integer) thisRead.getAttribute("FL"));
...@@ -164,11 +163,15 @@ import net.sf.samtools.SAMRecord; ...@@ -164,11 +163,15 @@ import net.sf.samtools.SAMRecord;
plots.put(fileName, coverage); plots.put(fileName, coverage);
} }
for(int j=0; j<length;j++) List<AlignmentBlock> blocks = thisRead.getAlignmentBlocks();
for(int j=0; j<blocks.size(); j++)
{ {
int bin = AlignmentBlock block = blocks.get(j);
(int)((thisRead.getAlignmentStart() + j + offset) / windowSize);
for(int k=0; k<block.getLength(); k++)
{
int pos = block.getReferenceStart() + k + offset;
int bin = pos/windowSize;
if(bin < 0 || bin > nBins-1) if(bin < 0 || bin > nBins-1)
continue; continue;
...@@ -184,6 +187,7 @@ import net.sf.samtools.SAMRecord; ...@@ -184,6 +187,7 @@ import net.sf.samtools.SAMRecord;
} }
} }
} }
}
int size = jamView.bamList.size(); int size = jamView.bamList.size();
if(includeCombined) if(includeCombined)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment