Skip to content

Commit

Permalink
Added a port command for getting information about the currently load…
Browse files Browse the repository at this point in the history
…ed genome
  • Loading branch information
ubuntolog committed Jul 18, 2023
1 parent 337d8cc commit 117a29e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/main/java/org/broad/igv/batch/CommandExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.broad.igv.feature.Range;
import org.broad.igv.feature.RegionOfInterest;
import org.broad.igv.feature.Strand;
import org.broad.igv.feature.genome.GenomeListItem;
import org.broad.igv.feature.genome.GenomeManager;
import org.broad.igv.logging.LogManager;
import org.broad.igv.logging.Logger;
Expand All @@ -50,6 +51,7 @@
import org.broad.igv.ui.IGV;
import org.broad.igv.ui.action.OverlayTracksMenuAction;
import org.broad.igv.ui.color.ColorUtilities;
import org.broad.igv.ui.commandbar.GenomeListManager;
import org.broad.igv.ui.panel.FrameManager;
import org.broad.igv.ui.util.MessageUtils;
import org.broad.igv.ui.util.SnapshotUtilities;
Expand Down Expand Up @@ -135,6 +137,20 @@ public String execute(String commandLine) {
result = load(param1, args.size() > 2 ? args.subList(2, args.size()) : null);
} else if (cmd.equalsIgnoreCase("genome") && args.size() > 1) {
result = genome(param1);
} else if (cmd.equalsIgnoreCase("currentGenome")) {
result = "";
if (GenomeManager.getInstance().getCurrentGenome() == null) {
return result;
}
String id = GenomeManager.getInstance().getCurrentGenome().getId();
if (id != null)
{
GenomeListItem item = GenomeListManager.getInstance().getGenomeListItem(id);
if (item != null) {
result = item.getPath();
}
}
return result;
} else if (cmd.equalsIgnoreCase("new") || cmd.equalsIgnoreCase("reset") || cmd.equalsIgnoreCase("clear")) {
igv.newSession();
} else if (cmd.equalsIgnoreCase("region")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static Collection<Collection<String>> loadChrAliases(String path) {
return loadChrAliases(br);
} catch (IOException e) {
log.error("Error loading chr alias table", e);
MessageUtils.showMessage("<html>Error loading chromosome alias table. Aliases will not be avaliable<br>" +
MessageUtils.showMessage("<html>Error loading chromosome alias table. Aliases will not be available<br>" +
e.toString());
return null;
} finally {
Expand Down

0 comments on commit 117a29e

Please sign in to comment.