org.biomart.martservice.query.Query类的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中org.biomart.martservice.query.Query类的一些代码示例,展示了Query类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query类的具体详情如下:
包路径:org.biomart.martservice.query.Query
类名称:Query

Query介绍

暂无

代码示例

代码示例来源:origin: net.sf.taverna.t2.activities/biomart-activity

private void buildOutputPorts(List<Edit<?>> editList) {
  Map<String, OutputPort> newOutputMap = new HashMap<String, OutputPort>();
  Query query = biomartQuery.getQuery();
  List<Attribute> attributes = query.getAttributes();
  String formatter = query.getFormatter();
  if (formatter == null) {

代码示例来源:origin: uk.org.mygrid.taverna.processors/taverna-biomart-processor

Query query = new Query(biomartQuery.getQuery());
List<Filter> filters = query.getFilters();
for (Filter filter : filters) {
  String name = filter.getQualifiedName();
Object[] resultList = biomartQuery.getMartService().executeQuery(
    query);
if (biomartQuery.getQuery().getFormatter() == null) {
  Dataset dataset = biomartQuery.getQuery().getDatasets().get(0);
  results.put(dataset.getName(), new DataThing(resultList[0]));

代码示例来源:origin: net.sf.taverna.t2.ui-activities/biomart-activity-ui

@Override
protected String getRawTableRowsHtml() {
  MartQuery q = MartServiceXMLHandler.elementToMartQuery(getConfigBean(), null);
  String html="<tr><td>URL</td><td>"+q.getMartService().getLocation()+"</td></tr>";
  html+="<tr><td>Location</td><td>"+q.getMartDataset().getMartURLLocation().getDisplayName() + "</td></tr>";
  boolean firstFilter=true;
  for (Filter filter : q.getQuery().getFilters()) {
    html+=firstFilter ? "<tr><td>Filter</td><td>" : "<tr><td></td></td>";
    firstFilter=false;
    html+=filter.getName()+"</td></tr>";
  }
  boolean firstAttribute=true;
  for (Attribute attribute : q.getQuery().getAttributes()) {
    html+=firstAttribute ? "<tr><td>Attribute</td><td>" : "<tr><td></td><td>";
    firstAttribute=false;
    html+=attribute.getName()+"</td></tr>";
  }
  html+="<tr><td>Dataset</td><td>"+q.getMartDataset().getDisplayName()+"</td></tr>";
  return html;
}

代码示例来源:origin: net.sf.taverna.t2.activities/biomart-activity

private void buildInputPorts(List<Edit<?>> editList) {
  Map<String, ActivityInputPort> newInputMap = new HashMap<String, ActivityInputPort>();
  List<Filter> filters = biomartQuery.getQuery().getFilters();
  // Create new input ports corresponding to filters
  for (Filter filter : filters) {
    String name = filter.getQualifiedName() + "_filter";
    if (inputMap.containsKey(name)) {
      newInputMap.put(name, inputMap.remove(name));
    } else {
      ActivityInputPort inputPort = null;
      if (filter.isList()) {
        inputPort = edits.createActivityInputPort(name, 1, true,
            new ArrayList<Class<? extends ExternalReferenceSPI>>(),
            String.class);
      } else {
        inputPort = edits.createActivityInputPort(name, 0, true,
            new ArrayList<Class<? extends ExternalReferenceSPI>>(),
            String.class);
      }
      newInputMap.put(name, inputPort);
      editList.add(edits.getAddActivityInputPortEdit(this, inputPort));
      editList.add(createAddMimeTypeAnnotationEdit(inputPort, "text/plain"));
    }
  }
  //remove any ports still left in the map
  for (ActivityInputPort inputPort : inputMap.values()) {
    editList.add(edits.getRemoveActivityInputPortEdit(this, inputPort));
  }
  inputMap = newInputMap;
}

代码示例来源:origin: uk.org.mygrid.taverna.processors/taverna-biomart-processor

query.getQuery().addQueryListener(queryListener);

代码示例来源:origin: net.sf.taverna.t2.activities/biomart-activity-ui

@Override
protected String getRawTableRowsHtml() {
  MartQuery q = MartServiceXMLHandler.elementToMartQuery(getConfigBean(), null);
  String html="<tr><td>URL</td><td>"+q.getMartService().getLocation()+"</td></tr>";
  html+="<tr><td>Location</td><td>"+q.getMartDataset().getMartURLLocation().getDisplayName() + "</td></tr>";
  boolean firstFilter=true;
  for (Filter filter : q.getQuery().getFilters()) {
    html+=firstFilter ? "<tr><td>Filter</td><td>" : "<tr><td></td></td>";
    firstFilter=false;
    html+=filter.getName()+"</td></tr>";
  }
  boolean firstAttribute=true;
  for (Attribute attribute : q.getQuery().getAttributes()) {
    html+=firstAttribute ? "<tr><td>Attribute</td><td>" : "<tr><td></td><td>";
    firstAttribute=false;
    html+=attribute.getName()+"</td></tr>";
  }
  html+="<tr><td>Dataset</td><td>"+q.getMartDataset().getDisplayName()+"</td></tr>";
  return html;
}

代码示例来源:origin: net.sf.taverna.t2/biomart-activity

private void buildInputPorts() {
  List<Filter> filters = biomartQuery.getQuery().getFilters();
  // Create new input ports corresponding to filters
  for (Filter filter : filters) {
    String name = filter.getQualifiedName() + "_filter";
    if (filter.isList()) {
      addInput(name, 1, true,
          new ArrayList<Class<? extends ReferenceScheme<?>>>(),
          String.class);
    } else {
      addInput(name, 0, true,
          new ArrayList<Class<? extends ReferenceScheme<?>>>(),
          String.class);
    }
  }
}

代码示例来源:origin: net.sf.taverna.t2/biomart-activity

Query query = new Query(biomartQuery.getQuery());
List<Filter> filters = query.getFilters();
for (Filter filter : filters) {
  String name = filter.getQualifiedName();
if (biomartQuery.getQuery().getFormatter() == null) {
  if (STREAM_RESULTS) {
    final List<Attribute> attributes = biomartQuery
      .executeQuery(query);
  assert resultList.length == 1;
  Dataset dataset = biomartQuery.getQuery().getDatasets()
      .get(0);
  String outputName = dataset.getName();

代码示例来源:origin: net.sf.taverna.t2/biomart-activity

private void buildOutputPorts() {
  Query query = biomartQuery.getQuery();
  List<Attribute> attributes = query.getAttributes();
  String formatter = query.getFormatter();
  if (formatter == null) {
    // Create new output ports corresponding to attributes
    for (Attribute attribute : attributes) {
      String name = attribute.getQualifiedName();
      if (attribute.getAttributes() != null) {
        addOutput(name, 2, STREAM_RESULTS?1:2);
      } else {
        addOutput(name, 1, STREAM_RESULTS?0:1);
      }
    }
  } else if (attributes.size() > 0) {
    // create one port using the dataset name
    Attribute attribute = attributes.get(0);
    String name = attribute.getContainingDataset().getName();
    addOutput(name, 0, 0);
  }
}

代码示例来源:origin: uk.org.mygrid.taverna.processors/taverna-biomart-processor

private void buildInputPortsFromQuery() throws PortCreationException,
    DuplicatePortNameException {
  List filters = query.getQuery().getFilters();
  Set<String> filterNames = new HashSet<String>();

代码示例来源:origin: net.sf.taverna.t2.activities/biomart-activity

Query query = new Query(biomartQuery.getQuery());
List<Filter> filters = query.getFilters();
for (Filter filter : filters) {
  String name = filter.getQualifiedName();
if (biomartQuery.getQuery().getFormatter() == null) {
  if (STREAM_RESULTS) {
    final List<Attribute> attributes = biomartQuery
      .executeQuery(query);
  assert resultList.length == 1;
  Dataset dataset = biomartQuery.getQuery().getDatasets()
      .get(0);
  String outputName = dataset.getName();

代码示例来源:origin: uk.org.mygrid.taverna.processors/taverna-biomart-processor

private void buildOutputPortsFromQuery() throws PortCreationException,
    DuplicatePortNameException {
  List<Attribute> attributes = query.getQuery().getAttributes();
  Set<String> attributeNames = new HashSet<String>();
  String formatter = query.getQuery().getFormatter();
  if (formatter == null) {

相关文章