protected List<String> getValuesToValidate(List<String> rawValues) { return rawValues.stream() .map(value -> { value = isNegated(value) ? removeNegation(value) : value; String[] strings = VariantQueryUtils.splitOperator(value); boolean withComparisionOperator = strings[0] != null; if (withComparisionOperator) { value = strings[0]; } return value; }) .collect(Collectors.toList()); }
private DBObject[] getFileFilterDBObjects(String key, List<String> filterValues) { DBObject[] regexList = new DBObject[filterValues.size()]; for (int i = 0; i < filterValues.size(); i++) { String filter = filterValues.get(i); boolean negated = isNegated(filter); if (negated) { filter = removeNegation(filter); } if (filter.contains(VCFConstants.FILTER_CODE_SEPARATOR) || filter.equals(VCFConstants.PASSES_FILTERS_v4)) { if (!negated) { regexList[i] = new BasicDBObject(key, filter); } else { regexList[i] = new BasicDBObject(key, new BasicDBObject("$ne", filter)); } } else { if (!negated) { regexList[i] = new BasicDBObject(key, new BasicDBObject("$regex", filter)); } else { regexList[i] = new BasicDBObject(key, new BasicDBObject("$not", Pattern.compile(filter))); } } } return regexList; }
public Integer getStudyId(Object studyObj, boolean skipNegated, Map<String, Integer> studies) { Integer studyId; if (studyObj instanceof Integer) { studyId = ((Integer) studyObj); } else { String studyName = studyObj.toString(); if (isNegated(studyName)) { //Skip negated studies if (skipNegated) { return null; } else { studyName = removeNegation(studyName); } } if (StringUtils.isNumeric(studyName)) { studyId = Integer.parseInt(studyName); } else { Integer value = studies.get(studyName); if (value == null) { throw VariantQueryException.studyNotFound(studyName, studies.keySet()); } studyId = value; } } if (!studies.containsValue(studyId)) { throw VariantQueryException.studyNotFound(studyId, studies.keySet()); } return studyId; }
String str = obj.toString(); if (isNegated(str)) { str = removeNegation(str);
S elem = values.iterator().next(); if (elem instanceof String && isNegated((String) elem)) { T mapped = map.apply((S) removeNegation((String) elem)); if (mapped instanceof Collection) { auxBuilder.and(key).notIn(mapped); T mapped = map.apply((S) removeNegation((String) elem)); if (mapped instanceof Collection) { listNotIs.addAll(((Collection) mapped));
boolean negated = isNegated(filter); if (negated) { filter = removeNegation(filter); boolean negated = false; if (isNegated(cohort)) { cohort = removeNegation(cohort); negated = true; genotype = removeNegation(genotype);
String sampleStr = sampleObj.toString(); if (isNegated(sampleStr)) { sampleStr = removeNegation(sampleStr);
} else { sampleIds = samples.stream() .map(sample -> isNegated(sample) ? removeNegation(sample) : sample) .map(sample -> studyConfigurationManager.getSampleId(sample, studyConfiguration)).collect(Collectors.toList()); file = isNegated(file) ? removeNegation(file) : file; Integer fileId = StudyConfigurationManager.getFileIdFromStudy(file, studyConfiguration); if (fileId == null) {
return null; } else { fileStr = removeNegation(fileStr);
if (defaultGenotypes.contains(removeNegation(genotype))) { canFilterSampleByFile = true; defaultGenotypeNegated = true; boolean negated = isNegated(genotype); if (negated) { genotype = removeNegation(genotype);