Skip to content

Commit

Permalink
Adjust scale threshold at which insertions are shown.
Browse files Browse the repository at this point in the history
Remember last directory accessed in igvtools gui.
  • Loading branch information
jrobinso committed Mar 10, 2013
1 parent 1962f76 commit 98dd3ad
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/org/broad/igv/PreferenceManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public class PreferenceManager implements PropertyManager {
public static final String CHART_AUTOSCALE = "CHART.AUTOSCALE";
public static final String CHART_SHOW_DATA_RANGE = "CHART.SHOW_DATA_RANGE";

public static final String UNLOAD_ON_GENOME_CHANGE = "UNLOAD_ON_GENOME_CHANGE";

/**
* Added by Chantal Roth, June 25th 2012
*/
Expand Down Expand Up @@ -983,6 +985,7 @@ private void initDefaultValues() {
defaultValues.put(CHART_COLOR_TRACK_NAME, "true");
defaultValues.put(CHART_TRACK_HEIGHT_KEY, "40");
defaultValues.put(CHART_SHOW_ALL_HEATMAP, "false");
defaultValues.put(UNLOAD_ON_GENOME_CHANGE, "false");

defaultValues.put(SAM_SHOW_DUPLICATES, "false");
defaultValues.put(SAM_SHOW_SOFT_CLIPPED, "false");
Expand Down
4 changes: 2 additions & 2 deletions src/org/broad/igv/sam/AlignmentRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -648,8 +648,8 @@ private void drawAlignment(

}

// Render insertions if locScale ~ 0.25 (base level)
if (locScale < 0.25) {
// Render insertions if locScale < 1 bp / pixel (base level)
if (locScale < 1) {
drawInsertions(origin, rowRect, locScale, alignment, context);
}

Expand Down
27 changes: 27 additions & 0 deletions src/org/broad/igv/sam/AlignmentTrack.java
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,10 @@ class PopupMenu extends IGVPopupMenu {
addShowCoverageItem();
addLoadCoverageDataItem();

if(spliceJunctionTrack != null) {
addShowSpliceJuntionItem();
}

addSeparator();
TrackMenuUtils.addDisplayModeItems(tracks, this);

Expand Down Expand Up @@ -1844,6 +1848,29 @@ public void run() {
add(item);
}

private void addShowSpliceJuntionItem() {
final JMenuItem item = new JCheckBoxMenuItem("Show junction track");
item.setSelected(spliceJunctionTrack != null && spliceJunctionTrack.isVisible());
item.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent aEvt) {
UIUtilities.invokeOnEventThread(new Runnable() {

public void run() {
if (spliceJunctionTrack != null) {
spliceJunctionTrack.setVisible(item.isSelected());
refresh();
IGV.getInstance().repaintNamePanels();
}
}
});
}
});
item.setEnabled(spliceJunctionTrack != null);
add(item);
}


public void addLoadCoverageDataItem() {
// Change track height by attribute
final JMenuItem item = new JCheckBoxMenuItem("Load coverage data...");
Expand Down
7 changes: 7 additions & 0 deletions src/org/broad/igv/tools/IgvToolsGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public class IgvToolsGui extends JDialog {
PrintStream systemOutStream;
PrintStream systemErrStream;

static File lastDirectory;

IgvTools igvTools;

public IgvToolsGui() {
Expand Down Expand Up @@ -564,6 +566,10 @@ private File chooseFile() {
fileDialog = new JFileChooser();
// }

if(lastDirectory != null) {
fileDialog.setCurrentDirectory(lastDirectory);
}

fileDialog.setMultiSelectionEnabled(false);

boolean affective = PreferenceManager.getInstance().getAsBoolean(PreferenceManager.AFFECTIVE_ENABLE);
Expand All @@ -578,6 +584,7 @@ private File chooseFile() {
return null;
} else {
File selected = fileDialog.getSelectedFile();
lastDirectory = selected.isDirectory() ? selected : selected.getParentFile();
return selected;
}
}
Expand Down

0 comments on commit 98dd3ad

Please sign in to comment.