text: user174: In my gzipped VCF file I have many variants, and they report allele frequency such as:
  ##INFO=<ID=CAF,Number=.,Type=String,Description="An ordered, comma delimited list of allele frequencies based on 1000Genomes, starting with the reference allele followed by alternate alleles as ordered in the ALT column. Where a 1000Genomes alternate allele is not in the dbSNPs alternate allele set, the allele is added to the ALT column. The minor allele is the second largest value in the list, and was previuosly reported in VCF as the GMAF. This is the GMAF reported on the RefSNP and EntrezSNP pages and VariationReporter">
  
  and 
  CAF=0.5747,0.4253
  
  I would like to filter out the variants >= 1% allelle frequency. How do I do that? 
  
  user71: using vcffilterjdk:
  you want to keep the variant if there is no INFO/CAF.
  Otherwise, get All values of CAF as a String list (because it is declared as a string in the VCF header...), stream those data, skip the first value for REF , convert each string to double, you want to keep the variant if any allele is rare (< 0.01)
  java -jar dist/vcffilterjdk.jar -e 'return !variant.hasAttribute("CAF") || variant.variant.getAttributeAsStringList("CAF","1.0").stream().skip(1L).map(A->Double.parseDouble(A)).anyMatch(A->A<0.01);' input.vcf
  
  
original_text: 174: <p>In my gzipped VCF file I have many variants, and they report allele frequency such as:</p>
  
  <pre><code>##INFO=&lt;ID=CAF,Number=.,Type=String,Description="An ordered, comma delimited list of allele frequencies based on 1000Genomes, starting with the reference allele followed by alternate alleles as ordered in the ALT column. Where a 1000Genomes alternate allele is not in the dbSNPs alternate allele set, the allele is added to the ALT column. The minor allele is the second largest value in the list, and was previuosly reported in VCF as the GMAF. This is the GMAF reported on the RefSNP and EntrezSNP pages and VariationReporter"&gt;
  </code></pre>
  
  <p>and </p>
  
  <pre><code>CAF=0.5747,0.4253
  </code></pre>
  
  <p>I would like to filter out the variants >= 1% allelle frequency. How do I do that? </p>
   71: <p>using <strong><a href="http://lindenb.github.io/jvarkit/VcfFilterJdk.html" rel="nofollow noreferrer">vcffilterjdk</a></strong>:</p>
  
  <p>you want to keep the variant if there is no INFO/CAF.</p>
  
  <p>Otherwise, get All values of CAF <a href="https://samtools.github.io/htsjdk/javadoc/htsjdk/htsjdk/variant/variantcontext/VariantContext.html#getAttributeAsStringList-java.lang.String-java.lang.String-" rel="nofollow noreferrer">as a String list</a> (because it is declared as a string in the VCF header...), stream those data, skip the first value for REF , convert each string to double, you want to keep the variant if any allele is rare (&lt; 0.01)</p>
  
  <pre><code>java -jar dist/vcffilterjdk.jar -e 'return !variant.hasAttribute("CAF") || variant.variant.getAttributeAsStringList("CAF","1.0").stream().skip(1L).map(A-&gt;Double.parseDouble(A)).anyMatch(A-&gt;A&lt;0.01);' input.vcf
  </code></pre>
  