-
Notifications
You must be signed in to change notification settings - Fork 2
/
scanfoldmenu.patch
157 lines (150 loc) · 7.93 KB
/
scanfoldmenu.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
diff --git a/src/main/java/org/broad/igv/track/TrackLoader.java b/src/main/java/org/broad/igv/track/TrackLoader.java
index f09591e39..f87d019b6 100644
--- a/src/main/java/org/broad/igv/track/TrackLoader.java
+++ b/src/main/java/org/broad/igv/track/TrackLoader.java
@@ -76,6 +76,8 @@ import org.broad.igv.renderer.MutationRenderer;
import org.broad.igv.renderer.PointsRenderer;
import org.broad.igv.sam.*;
import org.broad.igv.sam.reader.IndexNotFoundException;
+import org.broad.igv.scanfold.ScanfoldlessDBNLoader;
+import org.broad.igv.scanfold.VarnaLoader;
import org.broad.igv.tdf.TDFDataSource;
import org.broad.igv.tdf.TDFReader;
import org.broad.igv.ui.IGV;
@@ -207,6 +209,10 @@ public class TrackLoader {
loadMutFile(locator, newTracks, genome); // Must be tried before ".maf" test below
} else if (format.equals("maf")) {
loadMultipleAlignmentTrack(locator, newTracks, genome);
+ } else if (format.equals("scanfoldlessdbn")) {
+ ScanfoldlessDBNLoader.loadFofnTwo(locator, newTracks, genome);
+ } else if (format.equals("scanfoldvarna")) {
+ VarnaLoader.loadFofn(locator, genome);
} else {
//if a url, try htsget
boolean isHtsget = tryHtsget(locator, newTracks, genome);
diff --git a/src/main/java/org/broad/igv/ui/IGVMenuBar.java b/src/main/java/org/broad/igv/ui/IGVMenuBar.java
index 4d46a5a26..2c7ec796d 100644
--- a/src/main/java/org/broad/igv/ui/IGVMenuBar.java
+++ b/src/main/java/org/broad/igv/ui/IGVMenuBar.java
@@ -62,6 +62,10 @@ import org.broad.igv.util.HttpUtils;
import org.broad.igv.util.LongRunningTask;
import org.broad.igv.util.blat.BlatClient;
import org.broad.igv.util.encode.EncodeFileBrowser;
+import org.broad.igv.feature.Strand;
+import org.broad.igv.scanfold.RNAFoldGui;
+import org.broad.igv.scanfold.RNAStructureGui;
+import org.broad.igv.scanfold.ScanFoldGui;
import javax.swing.*;
import javax.swing.event.MenuEvent;
@@ -173,6 +177,7 @@ public class IGVMenuBar extends JMenuBar implements IGVEventObserver {
menus.add(createViewMenu());
menus.add(createTracksMenu());
menus.add(createRegionsMenu());
+ menus.add(createScanfoldMenu());
refreshToolsMenu();
menus.add(toolsMenu);
@@ -437,7 +442,7 @@ public class IGVMenuBar extends JMenuBar implements IGVEventObserver {
menuAction.setToolTipText("Load a FASTA, .json, or .genome file...");
menuItems.add(MenuAndToolbarUtils.createMenuItem(menuAction));
- // Download genome from server
+ // Download genome from server
menuAction = new MenuAction("Select Hosted Genome...", null) {
@Override
public void actionPerformed(ActionEvent event) {
@@ -1221,4 +1226,46 @@ public class IGVMenuBar extends JMenuBar implements IGVEventObserver {
return menuItem;
}
+
+ private JMenu createScanfoldMenu() {
+ List<JComponent> menuItems = new ArrayList<JComponent>();
+ MenuAction extrasMenuAction = new MenuAction("ScanFold");
+ MenuAction scanfoldMenuAction = new MenuAction("Run ScanFold on visible region...", null, 0) {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ final ReferenceFrame defaultFrame = FrameManager.getDefaultFrame();
+ String chr = defaultFrame.getChrName();
+ int start = (int) defaultFrame.getOrigin();
+ int end = (int) defaultFrame.getEnd();
+ String sequence = ScanFoldGui.extractSequence(GenomeManager.getInstance().getCurrentGenome(), chr, start, end, Strand.NONE);
+ ScanFoldGui.launch(chr, start, sequence, false, "main");
+ }
+ };
+ menuItems.add(MenuAndToolbarUtils.createMenuItem(scanfoldMenuAction));
+ MenuAction rnafoldMenuAction = new MenuAction("Run RNAFold on visible region...", null, 0) {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ final ReferenceFrame defaultFrame = FrameManager.getDefaultFrame();
+ String chr = defaultFrame.getChrName();
+ int start = (int) defaultFrame.getOrigin();
+ int end = (int) defaultFrame.getEnd();
+ String sequence = RNAFoldGui.extractSequence(GenomeManager.getInstance().getCurrentGenome(), chr, start, end, Strand.NONE);
+ RNAFoldGui.launch(chr, start, sequence, false, "main");
+ }
+ };
+ menuItems.add(MenuAndToolbarUtils.createMenuItem(rnafoldMenuAction));
+ MenuAction rnastructureMenuAction = new MenuAction("Run RNAStructure on visible region...", null, 0) {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ final ReferenceFrame defaultFrame = FrameManager.getDefaultFrame();
+ String chr = defaultFrame.getChrName();
+ int start = (int) defaultFrame.getOrigin();
+ int end = (int) defaultFrame.getEnd();
+ String sequence = RNAStructureGui.extractSequence(GenomeManager.getInstance().getCurrentGenome(), chr, start, end, Strand.NONE);
+ RNAStructureGui.launch(chr, start, sequence, false, "main");
+ }
+ };
+ menuItems.add(MenuAndToolbarUtils.createMenuItem(rnastructureMenuAction));
+ return MenuAndToolbarUtils.createMenu(menuItems, extrasMenuAction);
+ }
}
diff --git a/src/main/java/org/broad/igv/ui/panel/RegionOfInterestPanel.java b/src/main/java/org/broad/igv/ui/panel/RegionOfInterestPanel.java
index c329652b7..f85131be2 100644
--- a/src/main/java/org/broad/igv/ui/panel/RegionOfInterestPanel.java
+++ b/src/main/java/org/broad/igv/ui/panel/RegionOfInterestPanel.java
@@ -35,6 +35,9 @@ import org.broad.igv.util.blat.BlatClient;
import org.broad.igv.feature.RegionOfInterest;
import org.broad.igv.feature.genome.Genome;
import org.broad.igv.feature.genome.GenomeManager;
+import org.broad.igv.scanfold.RNAFoldGui;
+import org.broad.igv.scanfold.RNAStructureGui;
+import org.broad.igv.scanfold.ScanFoldGui;
import org.broad.igv.ui.IGV;
import org.broad.igv.util.LongRunningTask;
import org.broad.igv.util.NamedRunnable;
@@ -204,7 +207,39 @@ public class RegionOfInterestPanel extends JPanel {
}
popupMenu.add(item);
+ item = new JMenuItem("Run ScanFold on selected region...");
+ item.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ Genome genome = GenomeManager.getInstance().getCurrentGenome();
+ String sequence = ScanFoldGui.extractSequence(genome, roi.getChr(), roi.getStart(), roi.getEnd(), Strand.NONE);
+ ScanFoldGui.launch(roi.getChr(), roi.getStart(), sequence, false, "roi");
+ }
+ });
+ popupMenu.add(item);
+
+ item = new JMenuItem("Run RNAFold on selected region...");
+ item.addActionListener(new ActionListener() {
+
+ public void actionPerformed(ActionEvent e) {
+ Genome genome = GenomeManager.getInstance().getCurrentGenome();
+ String sequence = RNAFoldGui.extractSequence(genome, roi.getChr(), roi.getStart(), roi.getEnd(), Strand.NONE);
+ RNAFoldGui.launch(roi.getChr(), roi.getStart(), sequence, false, "roi");
+ }
+ });
+ popupMenu.add(item);
+
+ item = new JMenuItem("Run RNAStructure on selected region...");
+ item.addActionListener(new ActionListener() {
+
+ public void actionPerformed(ActionEvent e) {
+ Genome genome = GenomeManager.getInstance().getCurrentGenome();
+ String sequence = RNAStructureGui.extractSequence(genome, roi.getChr(), roi.getStart(), roi.getEnd(), Strand.NONE);
+ RNAStructureGui.launch(roi.getChr(), roi.getStart(), sequence, false, "roi");
+ }
+ });
+ popupMenu.add(item);
+
popupMenu.add(new JSeparator());
item = new JMenuItem("Delete");