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

fix mouse selection in base alignment view

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@11939 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent 8e4bdfb6
No related branches found
No related tags found
No related merge requests found
...@@ -566,7 +566,7 @@ public class BamView extends JPanel ...@@ -566,7 +566,7 @@ public class BamView extends JPanel
g2.setColor(lightGrey); g2.setColor(lightGrey);
g2.fillRect(0, ypos-11, getPreferredSize().width, 11); g2.fillRect(0, ypos-11, getPreferredSize().width, 11);
drawSelectionRange(g2, pixPerBase, start, end); drawSelectionRange(g2, ALIGNMENT_PIX_PER_BASE, start, end);
g2.setColor(Color.black); g2.setColor(Color.black);
g2.drawString(refSeq, 0, ypos); g2.drawString(refSeq, 0, ypos);
} }
...@@ -576,7 +576,7 @@ public class BamView extends JPanel ...@@ -576,7 +576,7 @@ public class BamView extends JPanel
} }
} }
else else
drawSelectionRange(g2, pixPerBase, start, end); drawSelectionRange(g2, ALIGNMENT_PIX_PER_BASE, start, end);
boolean drawn[] = new boolean[readsInView.size()]; boolean drawn[] = new boolean[readsInView.size()];
...@@ -590,7 +590,7 @@ public class BamView extends JPanel ...@@ -590,7 +590,7 @@ public class BamView extends JPanel
SAMRecord thisRead = readsInView.get(i); SAMRecord thisRead = readsInView.get(i);
ypos+=11; ypos+=11;
drawSequence(g2, thisRead, pixPerBase, ypos, refSeq, refSeqStart); drawSequence(g2, thisRead, ypos, refSeq, refSeqStart);
drawn[i] = true; drawn[i] = true;
int thisEnd = thisRead.getAlignmentEnd(); int thisEnd = thisRead.getAlignmentEnd();
...@@ -604,7 +604,7 @@ public class BamView extends JPanel ...@@ -604,7 +604,7 @@ public class BamView extends JPanel
SAMRecord nextRead = readsInView.get(j); SAMRecord nextRead = readsInView.get(j);
if(nextRead.getAlignmentStart() > thisEnd+1) if(nextRead.getAlignmentStart() > thisEnd+1)
{ {
drawSequence(g2, nextRead, pixPerBase, ypos, refSeq, refSeqStart); drawSequence(g2, nextRead, ypos, refSeq, refSeqStart);
drawn[j] = true; drawn[j] = true;
thisEnd = nextRead.getAlignmentEnd(); thisEnd = nextRead.getAlignmentEnd();
if(thisEnd == 0) if(thisEnd == 0)
...@@ -633,7 +633,7 @@ public class BamView extends JPanel ...@@ -633,7 +633,7 @@ public class BamView extends JPanel
* @param ypos * @param ypos
*/ */
private void drawSequence(Graphics2D g2, SAMRecord samRecord, private void drawSequence(Graphics2D g2, SAMRecord samRecord,
float pixPerBase, int ypos, String refSeq, int refSeqStart) int ypos, String refSeq, int refSeqStart)
{ {
if (!samRecord.getReadPairedFlag() || // read is not paired in sequencing if (!samRecord.getReadPairedFlag() || // read is not paired in sequencing
samRecord.getMateUnmappedFlag() ) // mate is unmapped ) // mate is unmapped samRecord.getMateUnmappedFlag() ) // mate is unmapped ) // mate is unmapped
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment