org.opencb.opencga.storage.core.variant.adaptors.VariantQueryUtils.parseGenotypeFilter()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(70)

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

VariantQueryUtils.parseGenotypeFilter介绍

[英]Parse the genotype filter.
[中]解析基因型过滤器。

代码示例

代码示例来源:origin: opencb/opencga

@Override
protected QueryOperation getQueryOperation(String valuesStr) {
  Map<Object, List<String>> genotypesMap = new HashMap<>();
  return VariantQueryUtils.parseGenotypeFilter(valuesStr, genotypesMap);
}

代码示例来源:origin: opencb/opencga

@Override
protected List<String> splitValue(String valuesStr, QueryOperation queryOperation) {
  Map<Object, List<String>> genotypesMap = new LinkedHashMap<>();
  VariantQueryUtils.parseGenotypeFilter(valuesStr, genotypesMap);
  return genotypesMap.entrySet().stream().map(entry -> entry.getKey() + ":" + String.join(",", entry.getValue()))
      .collect(Collectors.toList());
}

代码示例来源:origin: opencb/opencga

samplesOperator = parseGenotypeFilter(query.getString(GENOTYPE.key()), genotypeMap);
samples = genotypeMap.keySet().stream().map(Object::toString).collect(Collectors.toList());

代码示例来源:origin: opencb/opencga

parseGenotypeFilter(query.getString(GENOTYPE.key()), map);

代码示例来源:origin: opencb/opencga

parseGenotypeFilter(query.getString(GENOTYPE.key()), map);
if (samples == null) {
  samples = new ArrayList<>(map.size());

代码示例来源:origin: opencb/opencga

QueryOperation queryOperation = VariantQueryUtils.parseGenotypeFilter(query.getString(key), genotypeSamples);
boolean addOperator = false;
if (MapUtils.isNotEmpty(genotypeSamples)) {

代码示例来源:origin: opencb/opencga

VariantQueryUtils.parseGenotypeFilter(query.getString(GENOTYPE.key()), gtMap);
for (List<String> gts : gtMap.values()) {
  boolean valid = true;

代码示例来源:origin: opencb/opencga

private boolean doHBaseColumnIntersect(Query query, QueryOptions options) {
  return options.getBoolean("hbase_column_intersect", true)
      // && !options.getBoolean(VariantHadoopDBAdaptor.NATIVE)
      && (isValidParam(query, SAMPLE) && isSupportedQueryParam(query, SAMPLE)
      || isValidParam(query, FILE) && isSupportedQueryParam(query, FILE)
      || isValidParam(query, GENOTYPE) && isSupportedQueryParam(query, GENOTYPE)
      && parseGenotypeFilter(query.getString(GENOTYPE.key()), new HashMap<>()) != QueryOperation.OR);
}

代码示例来源:origin: opencb/opencga

@Test
public void testParseGenotypeFilter() throws Exception {
  @SuppressWarnings("unchecked")
  Map<String, List<String>> expected = new HashMap(new ObjectMap()
      .append("study:sample", Arrays.asList("1/1", "2/2"))
      .append("sample2", Arrays.asList("0/0", "2/2"))
      .append("sample3", Arrays.asList("0/0"))
      .append("study1:sample4", Arrays.asList("0/0", "2/2")));
  HashMap<Object, List<String>> map = new HashMap<>();
  assertEquals(VariantQueryUtils.QueryOperation.AND, parseGenotypeFilter("study:sample:1/1,2/2;sample2:0/0,2/2;sample3:0/0;study1:sample4:0/0,2/2", map));
  assertEquals(expected, map);
  map = new HashMap<>();
  // Check ends with operator
  assertEquals(VariantQueryUtils.QueryOperation.AND, parseGenotypeFilter("study:sample:1/1,2/2;sample2:0/0,2/2;sample3:0/0;study1:sample4:0/0,2/2;", map));
  assertEquals(expected, map);
  map = new HashMap<>();
  assertEquals(VariantQueryUtils.QueryOperation.OR, parseGenotypeFilter("study:sample:1/1,2/2,sample2:0/0,2/2,sample3:0/0,study1:sample4:0/0,2/2", map));
  assertEquals(expected, map);
  expected.put("sample3", Arrays.asList("!0/0"));
  map = new HashMap<>();
  assertEquals(VariantQueryUtils.QueryOperation.OR, parseGenotypeFilter("study:sample:1/1,2/2,sample2:0/0,2/2,sample3:!0/0,study1:sample4:0/0,2/2", map));
  assertEquals(expected, map);
  thrown.expect(VariantQueryException.class);
  parseGenotypeFilter("sample:1/1,2/2,sample2:0/0,2/2;sample3:0/0,2/2", map);
}

代码示例来源:origin: opencb/opencga

queryOperation = parseGenotypeFilter(query.getString(GENOTYPE.key()), map);

代码示例来源:origin: opencb/opencga

if (isValidParam(query, GENOTYPE)) {
  genotypeQueryOperation = parseGenotypeFilter(query.getString(GENOTYPE.key()), genotypesMap);

代码示例来源:origin: opencb/opencga

if (isValidParam(query, VariantQueryParam.GENOTYPE)) {
  HashMap<Object, List<String>> map = new HashMap<>();
  parseGenotypeFilter(query.getString(VariantQueryParam.GENOTYPE.key()), map);
    parseGenotypeFilter(query.getString(VariantQueryParam.GENOTYPE.key()), map);
    for (Object o : map.keySet()) {
      samples.add(o.toString());

代码示例来源:origin: opencb/opencga

parseGenotypeFilter(query.getString(GENOTYPE.key()), map);
Map.Entry<Object, List<String>> currentEntry = null;
for (Map.Entry<Object, List<String>> entry : map.entrySet()) {

代码示例来源:origin: opencb/opencga

if (isValidParam(query, GENOTYPE)) {
  String sampleGenotypes = query.getString(GENOTYPE.key());
  gtQueryOperation = parseGenotypeFilter(sampleGenotypes, genotypesFilter);

代码示例来源:origin: opencb/opencga

genotypeOperator = VariantQueryUtils.parseGenotypeFilter(query.getString(GENOTYPE.key()), map);

代码示例来源:origin: opencb/opencga

QueryOperation operation = VariantQueryUtils.parseGenotypeFilter(query.getString(GENOTYPE.key()), genotypesMap);

相关文章

微信公众号

最新文章

更多