本文整理了Java中org.opencb.opencga.storage.core.variant.adaptors.VariantQueryUtils.parseConsequenceType()
方法的一些代码示例,展示了VariantQueryUtils.parseConsequenceType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。VariantQueryUtils.parseConsequenceType()
方法的具体详情如下:
包路径:org.opencb.opencga.storage.core.variant.adaptors.VariantQueryUtils
类名称:VariantQueryUtils
方法名:parseConsequenceType
暂无
代码示例来源:origin: opencb/opencga
/**
* Build an OR/AND-condition with all consequence types from the input list. It uses the VariantDBAdaptorUtils
* to parse the consequence type (accession or term) into an integer.
*
* @param cts List of consequence types
* @param op Boolean operator (OR / AND)
* @return OR/AND-condition string
*/
private String buildConsequenceTypeOrAnd(List<String> cts, String op) {
StringBuilder sb = new StringBuilder();
for (String ct : cts) {
if (sb.length() > 0) {
sb.append(op);
}
sb.append("soAcc:\"").append(VariantQueryUtils.parseConsequenceType(ct)).append("\"");
}
return sb.toString();
}
代码示例来源:origin: opencb/opencga
/**
* Build the condition: genes AND cts.
*
* @param genes List of genes
* @param cts List of consequence types
* @return OR/AND condition string
*/
private String buildGeneAndConsequenceType(List<String> genes, List<String> cts) {
// in the VariantSearchModel the (gene AND ct) is modeled in the field: geneToSoAcc:gene_ct
// and if there are multiple genes and consequence types, we have to build the combination of all of them in a OR expression
StringBuilder sb = new StringBuilder();
for (String gene: genes) {
for (String ct: cts) {
if (sb.length() > 0) {
sb.append(" OR ");
}
sb.append("geneToSoAcc:\"").append(gene).append("_").append(VariantQueryUtils.parseConsequenceType(ct))
.append("\"");
}
}
return sb.toString();
}
代码示例来源:origin: opencb/opencga
@Test
public void testParseSO() throws Exception {
assertEquals(1587, parseConsequenceType("stop_gained"));
assertEquals(1587, parseConsequenceType("1587"));
assertEquals(1587, parseConsequenceType("SO:00001587"));
}
代码示例来源:origin: opencb/opencga
@Test
public void testParseWrongSONumber2() throws Exception {
thrown.expect(VariantQueryException.class);
parseConsequenceType("SO:9999999");
}
代码示例来源:origin: opencb/opencga
@Test
public void testParseWrongSOTerm() throws Exception {
thrown.expect(VariantQueryException.class);
parseConsequenceType("wrong_so");
}
代码示例来源:origin: opencb/opencga
@Test
public void testParseWrongSONumber() throws Exception {
thrown.expect(VariantQueryException.class);
parseConsequenceType("9999999");
}
代码示例来源:origin: opencb/opencga
for (String gene : genes) {
for (String so : soList) {
int soNumber = parseConsequenceType(so);
gnSoSet.add(VariantAnnotationToPhoenixConverter.buildGeneSO(gene, soNumber));
代码示例来源:origin: opencb/opencga
for (SequenceOntologyTerm sequenceOntologyTerm : consequenceType.getSequenceOntologyTerms()) {
String accession = sequenceOntologyTerm.getAccession();
int so = parseConsequenceType(accession);
addNotNull(soList, so);
代码示例来源:origin: opencb/opencga
for (String gene : variantQueryXref.getGenes()) {
for (String so : soList) {
int soNumber = parseConsequenceType(so);
gnSo.add(DocumentToVariantAnnotationConverter.buildGeneSO(gene, soNumber));
内容来源于网络,如有侵权,请联系作者删除!