org.molgenis.data.Entity.getInt()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(125)

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

Entity.getInt介绍

暂无

代码示例

代码示例来源:origin: org.molgenis/molgenis-data-annotators

/**
 * Tabix is not always so precise. For example, the cmdline query
 * <p>
 * <pre>
 * tabix ExAC.r0.3.sites.vep.vcf.gz 1:1115548-1115548
 * </pre>
 * <p>
 * returns 2 variants:
 * <ul>
 * <li>"1 1115547 . CG C,TG"</li>
 * <li>"1 1115548 rs114390380 G A"</li>
 * </ul>
 * It is therefore needed to verify the position of the elements returned.
 */
private boolean positionMatches(Entity entity, int posFrom, int posTo)
{
  int entityPos = entity.getInt(VcfAttributes.POS);
  return entityPos >= posFrom && entityPos <= posTo;
}

代码示例来源:origin: org.molgenis/molgenis-settings

@Override
public Integer getInt(String attributeName) {
 return getEntity().getInt(attributeName);
}

代码示例来源:origin: org.molgenis/molgenis-ontology-core

@Override
public Integer getTermOccurrence(String term) {
 Entity entity = getTermFrequencyEntity(term);
 if (entity == null) return null;
 else return entity.getInt(OCCURRENCE);
}

代码示例来源:origin: org.molgenis/molgenis-data-validation

private static ConstraintViolation checkInt(
  Entity entity, Attribute attribute, EntityType entityType) {
 try {
  entity.getInt(attribute.getName());
  return null;
 } catch (Exception e) {
  return createConstraintViolation(entity, attribute, entityType);
 }
}

代码示例来源:origin: org.molgenis/molgenis-data-annotators

public static Location create(Entity entity)
  {
    return new AutoValue_Location(entity.getString(CHROM), entity.getInt(POS));
  }
}

代码示例来源:origin: org.molgenis/molgenis-data-annotators

builder.append(entity.getString(VcfAttributes.CHROM));
builder.append("\t");
builder.append(entity.getInt(VcfAttributes.POS));
builder.append("\t.\t");//ID
builder.append(entity.getString(VcfAttributes.REF));

代码示例来源:origin: org.molgenis/molgenis-data-annotators

private void setGoNLFrequencies(Entity entity, List<Entity> refMatches)
{
  String afs = null;
  String gtcs = null;
  if (hasAltAttribute(entity))
  {
    List<Entity> alleleMatches = computeAlleleMatches(entity, refMatches);
    if (alleleMatches.stream().anyMatch(Objects::nonNull))
    {
      afs = alleleMatches.stream()
                .map(gonl -> gonl == null ? "." : Double.toString(
                    Double.valueOf(gonl.getString(INFO_AC)) / gonl.getInt(INFO_AN)))
                .collect(Collectors.joining(","));
      //update GTC field to separate allele combinations by pipe instead of comma, since we use comma to separate alt allele info
      gtcs = alleleMatches.stream()
                .map(gonl -> gonl == null ? "." : gonl.getString(INFO_GTC).replace(",", "|"))
                .collect(Collectors.joining(","));
    }
  }
  entity.set(GONL_GENOME_AF, afs);
  entity.set(GONL_GENOME_GTC, gtcs);
}

代码示例来源:origin: org.molgenis/molgenis-data-annotators

if (entity.getInt(positionAttributeName) == pos)

代码示例来源:origin: org.molgenis/molgenis-data-annotators

@Override
public Query<Entity> createQuery(Entity entity)
{
  String chromosome = entity.getString(VcfAttributes.CHROM);
  Integer position = entity.getInt(VcfAttributes.POS);
  Locus locus = new Locus(chromosome, position);
  return createQuery(locus);
}

代码示例来源:origin: org.molgenis/molgenis-semantic-mapper

/**
 * Creates a fully reconstructed MappingProject from an Entity retrieved from the repository.
 *
 * @param mappingProjectEntity Entity with {@link MappingProjectMetaData} metadata
 * @return fully reconstructed MappingProject
 */
private MappingProject toMappingProject(Entity mappingProjectEntity) {
 String identifier = mappingProjectEntity.getString(MappingProjectMetaData.IDENTIFIER);
 String name = mappingProjectEntity.getString(MappingProjectMetaData.NAME);
 int depth = Optional.ofNullable(mappingProjectEntity.getInt(DEPTH)).orElse(3);
 List<Entity> mappingTargetEntities =
   Lists.newArrayList(
     mappingProjectEntity.getEntities(MappingProjectMetaData.MAPPING_TARGETS));
 List<MappingTarget> mappingTargets = mappingTargetRepo.toMappingTargets(mappingTargetEntities);
 return new MappingProject(identifier, name, depth, mappingTargets);
}

代码示例来源:origin: org.molgenis/molgenis-data-annotators

@Override
public Entity next()
{
  if (effects.isEmpty())
  {
    // go to next source entity and get effects
    Entity sourceEntity = peekingSourceIterator.next();
    String chromosome = sourceEntity.getString(VcfAttributes.CHROM);
    Integer position = sourceEntity.getInt(VcfAttributes.POS);
    if (chromosome != null && position != null)
    {
      Entity snpEffEntity = getSnpEffEntity(snpEffResultIterator, chromosome, position);
      if (snpEffEntity != null)
      {
        effects.addAll(getSnpEffectsFromSnpEffEntity(sourceEntity, snpEffEntity,
            getTargetEntityType(sourceEMD)));
      }
      else
      {
        effects.add(getEmptyEffectsEntity(sourceEntity, getTargetEntityType(sourceEMD)));
      }
    }
    else
    {
      effects.add(getEmptyEffectsEntity(sourceEntity, getTargetEntityType(sourceEMD)));
    }
  }
  return effects.removeFirst();
}

代码示例来源:origin: org.molgenis/molgenis-omx-protocolmanager

if(entity.getInt("id") != null) this.setId(entity.getInt("id"));
else if(entity.getInt("id") != null) this.setId(entity.getInt("id"));
else if(strict) this.setId(entity.getInt("id")); // setting null is not an option due to function overloading
if( entity.getInt("observationsetflow_id") != null) this.setId(entity.getInt("observationsetflow_id"));
else if( entity.getInt("ObservationSetFlow_id") != null) this.setId(entity.getInt("ObservationSetFlow_id"));

代码示例来源:origin: org.molgenis/molgenis-data-annotators

/**
 * Returns the next entity containing SnpEff annotations if its Chrom and Pos match. This implementation works
 * because SnpEff always returns output in the same order as the input
 *
 * @param snpEffResultIterator the snpEff results
 * @param chromosome           chromosome for the entity that is being annotated
 * @param position             position for the entity that is being annotated
 * @return {@link Entity}
 */
private Entity getSnpEffEntity(PeekingIterator<Entity> snpEffResultIterator, String chromosome, int position)
{
  if (snpEffResultIterator.hasNext())
  {
    Entity entityCandidate = snpEffResultIterator.peek();
    if (chromosome.equals(entityCandidate.getString(VcfAttributes.CHROM)) && position == entityCandidate.getInt(
        VcfAttributes.POS) && entityCandidate.getString(SnpEffRunner.ANN) != null)
    {
      snpEffResultIterator.next();
      return entityCandidate;
    }
  }
  return null;
}

代码示例来源:origin: org.molgenis/molgenis-web

break;
case INT:
 result.addProperty(attributeName, entity.getInt(attributeName));
 break;
case LONG:

代码示例来源:origin: org.molgenis/molgenis-data-validation

private static ConstraintViolation checkRange(
  Entity entity, Attribute attr, EntityType entityType) {
 Range range = attr.getRange();
 Long value;
 switch (attr.getDataType()) {
  case INT:
   Integer intValue = entity.getInt(attr.getName());
   value = intValue != null ? intValue.longValue() : null;
   break;
  case LONG:
   value = entity.getLong(attr.getName());
   break;
  default:
   throw new RuntimeException(
     format("Range not allowed for data type [%s]", attr.getDataType().toString()));
 }
 if ((value != null)
   && ((range.getMin() != null && value < range.getMin())
     || (range.getMax() != null && value > range.getMax()))) {
  return createConstraintViolation(entity, attr, entityType);
 }
 return null;
}

代码示例来源:origin: org.molgenis/molgenis-js

break;
case INT:
 value = entity.getInt(attrName);
 break;
case LONG:

代码示例来源:origin: org.molgenis/molgenis-data-validation

return entity.getLong(attributeName);
case INT:
 return entity.getInt(attributeName);
case HYPERLINK:
case ENUM:

代码示例来源:origin: org.molgenis/molgenis-omx-protocolmanager

if(entity.getInt("id") != null) this.setId(entity.getInt("id"));
else if(entity.getInt("id") != null) this.setId(entity.getInt("id"));
else if(strict) this.setId(entity.getInt("id")); // setting null is not an option due to function overloading
if( entity.getInt("protocolflow_id") != null) this.setId(entity.getInt("protocolflow_id"));
else if( entity.getInt("ProtocolFlow_id") != null) this.setId(entity.getInt("ProtocolFlow_id"));

代码示例来源:origin: org.molgenis/molgenis-data-postgresql

: null;
case INT:
 return entity.getInt(attrName);
case LONG:
 return entity.getLong(attrName);

代码示例来源:origin: org.molgenis/molgenis-fair

break;
case INT:
 model.add(subject, predicate, valueFactory.createLiteral(objectEntity.getInt(name)));
 break;
case ENUM:

相关文章