use of javafx.scene.control.TableView in project jvarkit by lindenb.
the class BamStage method createSamFlagTable.
private TableView<SamFlagRow> createSamFlagTable() {
final TableView<SamFlagRow> table = new TableView<>();
table.getColumns().add(makeColumn("Flag", O -> O.flag.name()));
table.getColumns().add(makeColumn("Status", param -> param.flag.isSet(param.record.getFlags()) ? "\u2611" : "\u2610"));
table.setPlaceholder(new Label("No SAM flag."));
return table;
}
use of javafx.scene.control.TableView in project jvarkit by lindenb.
the class BamStage method createReadGroupPane.
private Tab createReadGroupPane(final SAMFileHeader header) {
final TableView<SAMReadGroupRecord> table = new TableView<>(header == null ? FXCollections.observableArrayList() : FXCollections.observableArrayList(header.getReadGroups()));
table.getColumns().add(makeColumn("ID", G -> G.getId()));
table.getColumns().add(makeColumn("Sample", G -> G.getSample()));
table.getColumns().add(makeColumn("Center", G -> G.getSequencingCenter()));
table.getColumns().add(makeColumn("Platform", G -> G.getPlatform()));
table.getColumns().add(makeColumn("PlatformModel", G -> G.getPlatformModel()));
table.getColumns().add(makeColumn("PlatformUnit", G -> G.getPlatformUnit()));
table.getColumns().add(makeColumn("MedianInsertSize", G -> G.getPredictedMedianInsertSize()));
table.getColumns().add(makeColumn("Desc", G -> G.getDescription()));
table.getColumns().add(makeColumn("PU", G -> G.getPlatformUnit()));
table.getColumns().add(makeColumn("Lib", G -> G.getLibrary()));
table.getColumns().add(makeColumn("Run-Date", G -> G.getRunDate()));
final Tab tab = new Tab("ReadGroups", table);
tab.setClosable(false);
table.setPlaceholder(new Label("No BAM read-greoup."));
return tab;
}
use of javafx.scene.control.TableView in project jvarkit by lindenb.
the class VcfStage method buildVepTableRow.
private TableView<VepPredictionParser.VepPrediction> buildVepTableRow(final VepPredictionParser parser) {
final TableView<VepPredictionParser.VepPrediction> table = new TableView<>();
if (parser.isValid()) {
for (final String col : parser.getCategories()) {
table.getColumns().add(makeColumn(col, P -> P.get(col)));
}
}
table.setPlaceholder(new Label("No VEP prediction available"));
return table;
}
use of javafx.scene.control.TableView in project jvarkit by lindenb.
the class VcfStage method buildVariantTable.
/**
* build table of variants
*/
private TableView<VariantContext> buildVariantTable() {
final TableView<VariantContext> table = new TableView<>();
table.getColumns().add(makeColumn("CHROM", V -> V.getContig()));
table.getColumns().add(formatIntegerColumn(makeColumn("POS", V -> V.getStart())));
table.getColumns().add(makeColumn("ID", V -> V.hasID() ? V.getID() : null));
table.getColumns().add(makeColumn("REF", V -> allele2stringConverter.apply(V.getReference())));
table.getColumns().add(makeColumn("ALT", V -> V.getAlternateAlleles().stream().map(A -> allele2stringConverter.apply(A)).collect(Collectors.joining(","))));
table.getColumns().add(makeColumn("FILTER", V -> V.getFilters().stream().collect(Collectors.joining(","))));
table.getColumns().add(makeColumn("QUAL", V -> V.hasLog10PError() ? V.getPhredScaledQual() : null));
table.setPlaceholder(new Label("No Variant."));
final ContextMenu ctxMenu = new ContextMenu();
MenuItem menuItem = new MenuItem("dbSNP...");
menuItem.setOnAction(AE -> {
final VariantContext ctx = table.getSelectionModel().getSelectedItem();
if (ctx == null || !ctx.hasID() || !ctx.getID().matches("rs[0-9]+"))
return;
// http://stackoverflow.com/questions/16604341
VcfStage.this.owner.getHostServices().showDocument("https://www.ncbi.nlm.nih.gov/snp/" + ctx.getID().substring(2));
});
ctxMenu.getItems().add(menuItem);
ctxMenu.getItems().addAll(super.buildItemsForContextMenu());
for (final String build : new String[] { "human" }) {
menuItem = new MenuItem("Prediction Ensembl REST [" + build + "]");
menuItem.setOnAction(AE -> {
final VariantContext ctx = table.getSelectionModel().getSelectedItem();
if (ctx == null)
return;
for (final Allele a : ctx.getAlternateAlleles()) {
if (a.isReference())
continue;
if (a.isSymbolic())
continue;
if (a.isNoCall())
continue;
VcfStage.this.owner.getHostServices().showDocument("http://rest.ensembl.org/vep/" + build + "/region/" + JfxNgs.ContigToEnseml.apply(ctx.getContig()) + "%3A" + ctx.getStart() + "-" + ctx.getEnd() + "%3A1%2F" + a.getDisplayString() + "?content-type=text%2Fxml");
}
});
ctxMenu.getItems().add(menuItem);
}
for (final String database : new String[] { "Exac", "gnomAD" }) {
menuItem = new MenuItem("Open Variant (ALT) in " + database + " ... ");
menuItem.setOnAction(AE -> {
final VariantContext ctx = table.getSelectionModel().getSelectedItem();
if (ctx == null)
return;
for (final Allele a : ctx.getAlternateAlleles()) {
if (a.isReference())
continue;
if (a.isSymbolic())
continue;
if (a.isNoCall())
continue;
VcfStage.this.owner.getHostServices().showDocument("http://" + database.toLowerCase() + ".broadinstitute.org/variant/" + JfxNgs.ContigToEnseml.apply(ctx.getContig()) + "-" + ctx.getStart() + "-" + ctx.getReference().getDisplayString() + "-" + a.getDisplayString());
}
});
ctxMenu.getItems().add(menuItem);
}
table.setContextMenu(ctxMenu);
return table;
}
use of javafx.scene.control.TableView in project jvarkit by lindenb.
the class VcfStage method buildInfoHeaderTab.
/**
* build a table describing the INFO column
*/
private Tab buildInfoHeaderTab(final VCFHeader header) {
final TableView<VCFInfoHeaderLine> table = new TableView<>(FXCollections.observableArrayList(header.getInfoHeaderLines()));
table.getColumns().add(makeColumn("ID", F -> F.getID()));
table.getColumns().add(makeColumn("Type", F -> F.getType() == null ? null : F.getType().name()));
table.getColumns().add(makeColumn("Count", F -> F.isFixedCount() ? F.getCount() : null));
table.getColumns().add(makeColumn("Description", F -> F.getDescription()));
final Tab tab = new Tab("INFO", table);
tab.setClosable(false);
table.setPlaceholder(new Label("No INFO defined."));
return tab;
}
Aggregations