2.0 years ago by
United States
when I run this , I get the following error
VCF=unzipped_vcf_file
awk '/^#CHROM/ {printf("##INFO=<id=maf,number=1,type=float,description=\"min allele="" frequency\"="">\n##INFO=<id=af,number=a,type=float,description=\"allele frequency\"="">\n");} {print}' $VCF |\
java -jar /sc/orga/projects/psychencode/kiran/jvarkit/dist/vcffilterjdk.jar -e 'VariantContextBuilder vcb = new VariantContextBuilder(variant); float ac = variant.getAttributeAsInt("AN",0); if(ac>0) { List<float> af = variant.getAttributeAsIntList("AC",0).stream().map(N->N/ac).collect(Collectors.toList());vcb.attribute("AF",af);vcb.attribute("MAF",af.stream().mapToDouble(X->X.floatValue()).min().orElse(-1.0) );} return vcb.make();' > temp.vcf
[DEBUG][VcfFilterJdk] Compiling :
1 import java.util.;
2 import java.util.stream.;
3 import java.util.function.;
4 import htsjdk.samtools.util.;
5 import htsjdk.variant.variantcontext.;
6 import htsjdk.variant.vcf.;
7 @javax.annotation.Generated(value="VcfFilterJdk",date="2019-02-21T17:30:17-0500")
8 public class VcfFilterJdkCustom1164653960 extends com.github.lindenb.jvarkit.tools.vcffilterjs.VcfFilterJdk.AbstractFilter {
9 public VcfFilterJdkCustom1164653960(final VCFHeader header) {
10 super(header);
11 }
12 @Override
13 public Object apply(final VariantContext variant) {
14 /* user's code starts here */
15 VariantContextBuilder vcb = new VariantContextBuilder(variant); float ac = variant.getAttributeAsInt("AN",0); if(ac>0) { List<float> af = variant.getAttributeAsIntList("AC",0).stream().map(N->N/ac).collect(Collectors.toList());vcb.attribute("AF",af);vcb.attribute("MAF",af.stream().mapToDouble(X->X.floatValue()).min().orElse(-1.0) );} return vcb.make();
16 /* user's code ends here */
17 }
18 }
[WARN][SnpEffPredictionParser]no INFO[EFF] or no description. This VCF was probably NOT annotated with SnpEff (old version). But it's not a problem if this tool doesn't need to access SnpEff Annotations.
[WARN][VepPredictionParser]NO INFO[CSQ] found in header. This VCF was probably NOT annotated with VEP. But it's not a problem if this tool doesn't need to access VEP Annotations.
[WARN][AnnPredictionParser]no INFO[ANN] or no description This VCF was probably NOT annotated with SnpEff(ANN version) . But it's not a problem if this tool doesn't need to access SnpEff Annotations.
[SEVERE][Launcher]Contig 22 does not have a length field.
htsjdk.tribble.TribbleException: Contig 22 does not have a length field.
at htsjdk.variant.vcf.VCFContigHeaderLine.getSAMSequenceRecord(VCFContigHeaderLine.java:80)
at htsjdk.variant.vcf.VCFHeader.getSequenceDictionary(VCFHeader.java:206)
at com.github.lindenb.jvarkit.util.picard.SAMSequenceDictionaryProgress.<init>(SAMSequenceDictionaryProgress.java:259)
at com.github.lindenb.jvarkit.tools.vcffilterjs.VcfFilterJdk.doVcfToVcf(VcfFilterJdk.java:800)
at com.github.lindenb.jvarkit.util.jcommander.Launcher.doVcfToVcf(Launcher.java:563)
at com.github.lindenb.jvarkit.util.jcommander.Launcher.doVcfToVcf(Launcher.java:583)
at com.github.lindenb.jvarkit.tools.vcffilterjs.VcfFilterJdk.doWork(VcfFilterJdk.java:826)
at com.github.lindenb.jvarkit.util.jcommander.Launcher.instanceMain(Launcher.java:736)
at com.github.lindenb.jvarkit.util.jcommander.Launcher.instanceMainWithExit(Launcher.java:894)
at com.github.lindenb.jvarkit.tools.vcffilterjs.VcfFilterJdk.main(VcfFilterJdk.java:841)
[INFO][Launcher]vcffilterjdk Exited with failure (-1)