-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading example data from the wizard
- Loading branch information
1 parent
66f66e2
commit b3d636f
Showing
7 changed files
with
124 additions
and
2 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
cy-genexpi/sampleData/B.subtilis-germination (GSE6865) - used only.tsv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
ID_REF 0 5 10 15 20 25 30 40 50 60 70 80 90 100 | ||
sigA 65.02848915 126.4129103 4272.900479 5841.001338 3827.004813 4214.074196 3655.872395 3023.491903 2252.013874 771.2207189 1624.747711 1463.289999 2063.674901 1638.318343 | ||
sigB 61.94860972 37.89669158 668.1369332 862.2724645 701.8407961 1585.805369 2365.615687 3475.488365 11206.12601 3856.295791 3227.049517 2245.778613 2055.110141 1884.544308 | ||
dnaA 141.1416529 599.6596128 14776.3262 10631.07598 9554.734037 4408.279551 3439.540195 4630.653203 2886.288907 6463.05252 6051.176708 5845.051415 3942.786839 4463.624652 | ||
glnR 102.1821935 982.2864582 4617.832088 5992.73972 5341.391812 6472.018427 6774.975434 2661.456 3676.201168 2281.868597 3877.739034 4261.069892 3850.953533 2900.327297 | ||
tnrA 39.89123822 77.17170097 412.7144097 335.2282683 522.7582084 452.8847029 289.6165025 470.4833963 213.4863472 400.3172573 441.7235684 374.0273609 398.1035704 320.6820963 | ||
bmrR 76.79816847 49.45347518 357.1781456 286.0255073 385.0761604 302.9634616 187.1433534 398.1035704 276.0909905 232.3249038 155.9565138 124.4998333 154.9866347 190.282622 | ||
ctsR 77.54705027 382.9467541 2772.554299 1288.074211 827.1470363 933.8195615 922.8804737 1986.481992 2904.350793 2065.105828 1555.32461 1150.463901 1326.124031 1375.747508 |
72 changes: 72 additions & 0 deletions
72
cy-genexpi/src/main/java/cz/cas/mbu/cygenexpi/internal/tasks/LoadExampleDataTask.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package cz.cas.mbu.cygenexpi.internal.tasks; | ||
|
||
import java.io.File; | ||
import java.io.InputStream; | ||
import java.nio.file.CopyOption; | ||
import java.nio.file.Files; | ||
import java.nio.file.StandardCopyOption; | ||
|
||
import org.cytoscape.event.CyEventHelper; | ||
import org.cytoscape.io.read.CySessionReader; | ||
import org.cytoscape.io.read.CySessionReaderManager; | ||
import org.cytoscape.service.util.CyServiceRegistrar; | ||
import org.cytoscape.session.CySession; | ||
import org.cytoscape.session.CySessionManager; | ||
import org.cytoscape.session.events.SessionAboutToBeLoadedEvent; | ||
import org.cytoscape.session.events.SessionLoadCancelledEvent; | ||
import org.cytoscape.work.AbstractTask; | ||
import org.cytoscape.work.TaskMonitor; | ||
import org.cytoscape.work.Tunable; | ||
|
||
public class LoadExampleDataTask extends AbstractTask { | ||
@Tunable(description="<html>Current session (all networks and tables) will be lost.<br />Do you want to continue?</html>", | ||
params="ForceSetDirectly=true;ForceSetTitle=Open Session") | ||
public boolean approve; | ||
|
||
private final CyServiceRegistrar registrar; | ||
|
||
public LoadExampleDataTask(CyServiceRegistrar registrar) { | ||
super(); | ||
this.registrar = registrar; | ||
} | ||
|
||
@Override | ||
public void run(TaskMonitor taskMonitor) throws Exception { | ||
if(approve) | ||
{ | ||
CyEventHelper eventHelper = registrar.getService(CyEventHelper.class); | ||
eventHelper.fireEvent(new SessionAboutToBeLoadedEvent(this)); | ||
try { | ||
InputStream is = getClass().getResourceAsStream("/cz/cas/mbu/genexpi/example1_ds.cys"); | ||
File tempFile = File.createTempFile("cygenexpi_example", ".cys"); | ||
tempFile.deleteOnExit(); | ||
Files.copy(is, tempFile.toPath(),StandardCopyOption.REPLACE_EXISTING); | ||
|
||
CySessionReader reader = registrar.getService(CySessionReaderManager.class).getReader(tempFile.toURI(), tempFile.getName()); | ||
|
||
if (reader == null) | ||
{ | ||
throw new NullPointerException("Failed to find appropriate reader for example data."); | ||
} | ||
reader.run(taskMonitor); | ||
|
||
final CySession newSession = reader.getSession(); | ||
|
||
if (newSession == null) | ||
throw new NullPointerException("Example session could not be read."); | ||
|
||
CySessionManager sessionMgr = registrar.getService(CySessionManager.class); | ||
sessionMgr.setCurrentSession(newSession, "CyGenexpi example"); | ||
|
||
} | ||
catch(Exception ex) | ||
{ | ||
eventHelper.fireEvent(new SessionLoadCancelledEvent(this)); | ||
throw ex; | ||
} | ||
} | ||
|
||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.