@@ -936,7 +936,7 @@ private void checkVcfAnnotationsAndSamples(File vcfInput, boolean skipAnnotation
936936
937937 if (!skipAnnotationChecks )
938938 {
939- for (String info : Arrays .asList ("CADD_PH " , "OMIM_PHENO" , "CLN_ALLELE " , "AF" , "mGAPV" ))
939+ for (String info : Arrays .asList ("CADD_Score " , "OMIM_PHENO" , "CLN_SIG " , "AF" , "mGAPV" ))
940940 {
941941 if (!header .hasInfoLine (info ))
942942 {
@@ -1032,7 +1032,7 @@ private void inspectAndSummarizeVcf(JobContext ctx, File vcfInput, GeneToNameTra
10321032 File interestingVariantTable = getVariantTableName (ctx , vcfInput );
10331033 try (VCFFileReader reader = new VCFFileReader (vcfInput ); CloseableIterator <VariantContext > it = reader .iterator (); CSVWriter writer = new CSVWriter (PrintWriters .getPrintWriter (interestingVariantTable ), '\t' , CSVWriter .NO_QUOTE_CHARACTER ))
10341034 {
1035- writer .writeNext (new String []{"Chromosome" , "Position" , "Reference" , "Allele" , "Source" , "Reason" , "Description" , "Overlapping Gene(s)" , "OMIM Entries" , "OMIM Phenotypes" , "AF" , "Identifier" , "CADD_PH " });
1035+ writer .writeNext (new String []{"Chromosome" , "Position" , "Reference" , "Allele" , "Source" , "Reason" , "Description" , "Overlapping Gene(s)" , "OMIM Entries" , "OMIM Phenotypes" , "AF" , "Identifier" , "CADD_Score " });
10361036 while (it .hasNext ())
10371037 {
10381038 Set <List <String >> queuedLines = new LinkedHashSet <>();
@@ -1659,7 +1659,29 @@ else if (af != null)
16591659 }
16601660 }
16611661
1662- Object cadd = vc .getAttribute ("CADD_PH" );
1662+ Object cadd = null ;
1663+ if (allele != null && !allele .contains ("," ) && vc .hasAttribute ("CADD_Score" ))
1664+ {
1665+ List <Object > cadds = vc .getAttributeAsList ("CADD_Score" );
1666+ int i = 0 ;
1667+ for (Allele a : vc .getAlternateAlleles ())
1668+ {
1669+ if (allele .equals (a .getBaseString ()))
1670+ {
1671+ if (i < cadds .size ())
1672+ {
1673+ af = cadds .get (i );
1674+ break ;
1675+ }
1676+ else
1677+ {
1678+ log .error ("alleles and CADD values not same length for " + vc .getContig () + " " + vc .getStart () + ". " + vc .getAttributeAsString ("CADD_Score" , "" ));
1679+ }
1680+ }
1681+
1682+ i ++;
1683+ }
1684+ }
16631685
16641686 queuedLines .add (Arrays .asList (vc .getContig (), String .valueOf (vc .getStart ()), vc .getReference ().getDisplayString (), allele , source , reason , (description == null ? "" : description ), StringUtils .join (overlappingGenes , ";" ), StringUtils .join (omimIds , ";" ), StringUtils .join (omimPhenotypes , ";" ), af == null ? "" : af .toString (), identifier == null ? "" : identifier , cadd == null ? "" : cadd .toString ()));
16651687 }
0 commit comments