Skip to content

Commit 9a82e73

Browse files
Add 2 arguments (gnomadGenome and gnomadExome) to modify gnomAD format
1 parent 6323744 commit 9a82e73

1 file changed

Lines changed: 50 additions & 22 deletions

File tree

wwwachab.pl

Lines changed: 50 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
##### wwwachab.pl ####
44

5-
# Author : Thomas Guignard 2022
5+
# Author : Thomas Guignard 2023
66

77
# Description :
88
# Create an User friendly Excel file from an MPA annotated VCF file.
@@ -24,7 +24,7 @@
2424
\n--outPrefix <output file prelifx (default = \"\")>
2525
\n--candidates <file with end-of-line separated gene symbols of interest (it will create more tabs, if '#myPathology' is present in the file, a 'myPathology' tab will be created) >
2626
\n--phenolyzerFile <phenolyzer output file suffixed by predicted_gene_scores (it will contribute to the final ranking and top50 genes will be added in METADATA tab) >
27-
\n--popFreqThr <allelic frequency threshold from 0 to 1 default=0.01 (based on gnomAD_genome_ALL) >
27+
\n--popFreqThr <allelic frequency threshold from 0 to 1 default=0.01 (based on gnomAD_genome_ALL or on the first field of gnomadGenome argument) >
2828
\n--trio (requires case dad and mum option to be filled, but if case dad and mum option are filled, trio mode is automatically activated)
2929
\n\t--case <index_sample_name> (required with trio option)
3030
\n\t--dad <father_sample_name> (required with trio option)
@@ -51,9 +51,11 @@
5151
\n--genemap2File <OMIM genemap2 file (it will help to annotate OMIM genes in poor coverage file ) >
5252
\n--skipCaseWT (only if trio mode is activated, it will skip variant if case genotype is 0/0 )
5353
\n--hideACMG (ACMG tab will be empty but information will be reported in the gene comment)
54+
\n--gnomadGenome <comma separated list of gnomad genome annotation fields that will be displayed as gnomAD comments. First field of the list will be filtered regarding to popFreqThr argument, and it will be considered as column name, but it must be different from the exome one. (default fields are hard-coded gnomAD_genome_ALL like) >
55+
\n--gnomadExome <comma separated list of gnomad exome annotation fields that will be displayed as gnomAD comments. First field of the list will be treated as column name, but it must be different from the genome one. (default fields are hard-coded gnomAD_exome_ALL like) >
5456
\n\n-v|--version < return version number and exit > ";
5557

56-
my $versionOut = "achab version www:1.0.6";
58+
my $versionOut = "achab version www:1.0.7";
5759

5860
#################################### VARIABLES INIT ########################
5961

@@ -181,6 +183,13 @@
181183
my @poorCoverage_List;
182184
my %poorCoverage_variant;
183185

186+
#adapt gnomAD names
187+
my $gnomadGenome_names = "";
188+
my @gnomadGenome_List;
189+
my $gnomadGenomeColumn = "gnomAD_genome_ALL";
190+
my $gnomadExome_names = "";
191+
my @gnomadExome_List;
192+
my $gnomadExomeColumn = "gnomAD_exome_ALL";
184193

185194
my $hideACMG;
186195

@@ -231,8 +240,10 @@
231240
"genemap2File:s" => \$genemap2_File,
232241
"skipCaseWT" => \$skipCaseWT,
233242
"hideACMG" => \$hideACMG,
234-
"help|h" => \$help,
235-
"version|v" => \$version);
243+
"gnomadGenome:s" => \$gnomadGenome_names,
244+
"gnomadExome:s" => \$gnomadExome_names,
245+
"help|h" => \$help,
246+
"version|v" => \$version);
236247

237248

238249

@@ -350,6 +361,18 @@
350361
}
351362
}
352363

364+
#gnomad names
365+
if ($gnomadGenome_names ne ""){
366+
chomp $gnomadGenome_names;
367+
@gnomadGenome_List = split(/,/ , $gnomadGenome_names);
368+
$gnomadGenomeColumn = $gnomadGenome_List[0];
369+
}
370+
if ($gnomadExome_names ne ""){
371+
chomp $gnomadExome_names;
372+
@gnomadExome_List = split(/,/ , $gnomadExome_names);
373+
$gnomadExomeColumn = $gnomadExome_List[0];
374+
}
375+
353376

354377

355378
#Samples subset
@@ -933,8 +956,8 @@
933956
$dicoColumnNbr{'Phenolyzer'}= 2; #Phenolyzer raw score + comment Normalized score
934957
$dicoColumnNbr{'Gene.'.$refGene}= 3; #Gene Name + comment LOEUF / Function_description / tissue specificity
935958
$dicoColumnNbr{'Phenotypes.'.$refGene}= 4; #OMIM + comment Disease_description
936-
$dicoColumnNbr{'gnomAD_genome_ALL'}= 5; #Pop Freq + comment ethny
937-
$dicoColumnNbr{'gnomAD_exome_ALL'}= 6; #as well
959+
$dicoColumnNbr{$gnomadGenomeColumn}= 5; #Pop Freq + comment ethny
960+
$dicoColumnNbr{$gnomadExomeColumn}= 6; #as well
938961
$dicoColumnNbr{'CLNSIG'}= 7; #CLinvar
939962
$dicoColumnNbr{'InterVar_automated'}= 8; #+ comment ACMG status
940963
$dicoColumnNbr{'SecondHit-CNV'}= 9; #TODO
@@ -1129,27 +1152,33 @@
11291152

11301153
my $pLI_Comment = "pLI - the probability of being loss-of-function intolerant (intolerant of both heterozygous and homozygous lof variants)\npRec - the probability of being intolerant of homozygous, but not heterozygous lof variants\npNull - the probability of being tolerant of both heterozygous and homozygous lof variants";
11311154

1132-
my @CommentGnomadGenome = ('gnomAD_genome_ALL',
1155+
my @CommentGnomadGenome;
1156+
if ($gnomadGenome_names ne ""){
1157+
@CommentGnomadGenome = @gnomadGenome_List;
1158+
}else{
1159+
@CommentGnomadGenome = ('gnomAD_genome_ALL',
11331160
'gnomAD_genome_AFR',
11341161
'gnomAD_genome_AMR',
11351162
'gnomAD_genome_ASJ',
11361163
'gnomAD_genome_EAS',
11371164
'gnomAD_genome_FIN',
11381165
'gnomAD_genome_NFE',
11391166
'gnomAD_genome_OTH');
1167+
}
11401168

1141-
1142-
1143-
1144-
1145-
my @CommentGnomadExome = ('gnomAD_exome_ALL',
1169+
my @CommentGnomadExome;
1170+
if ($gnomadExome_names ne ""){
1171+
@CommentGnomadExome = @gnomadExome_List;
1172+
}else{
1173+
@CommentGnomadExome = ('gnomAD_exome_ALL',
11461174
'gnomAD_exome_AFR',
11471175
'gnomAD_exome_AMR',
11481176
'gnomAD_exome_ASJ',
11491177
'gnomAD_exome_EAS',
11501178
'gnomAD_exome_FIN',
11511179
'gnomAD_exome_NFE',
11521180
'gnomAD_exome_OTH');
1181+
}
11531182

11541183

11551184
my %CommentInterVar = (
@@ -1427,14 +1456,13 @@
14271456

14281457
#select only x% pop freq
14291458
#Use pop freq threshold as an input parameter (default = 1%)
1430-
next if(( $dicoInfo{'gnomAD_genome_ALL'} ne ".") && ($dicoInfo{'gnomAD_genome_ALL'} > $popFreqThr));
14311459

14321460
#convert gnomad freq "." to zero
1433-
if( $dicoInfo{'gnomAD_genome_ALL'} eq "."){
1434-
$dicoInfo{'gnomAD_genome_ALL'} = 0;
1461+
if( $dicoInfo{$gnomadGenomeColumn} eq "."){
1462+
$dicoInfo{$gnomadGenomeColumn} = 0;
14351463
}
1436-
if( $dicoInfo{'gnomAD_exome_ALL'} eq "."){
1437-
$dicoInfo{'gnomAD_exome_ALL'} = 0;
1464+
if( $dicoInfo{$gnomadExomeColumn} eq "."){
1465+
$dicoInfo{$gnomadExomeColumn} = 0;
14381466
}
14391467

14401468
#FILTERING according to newHope option and filterList option
@@ -1486,8 +1514,8 @@
14861514
#print "dicoInfo\t".$dicoInfo{$keys}."\n";
14871515
#print "keys\t".$keys."\n";
14881516
}else{
1489-
#check if custom INFO exists in VCF
1490-
if($dicoColumnNbr{$keys} > (16+$cmpt)){
1517+
#check if custom INFO exists in VCF or gnomad_genome or gnomad_exome names
1518+
if($dicoColumnNbr{$keys} > (16+$cmpt) || $dicoColumnNbr{$keys} == 5 || $dicoColumnNbr{$keys} == 6 ){
14911519
$finalSortData[$dicoColumnNbr{$keys}] = "INFO not found";
14921520
}
14931521
}
@@ -3411,8 +3439,8 @@ sub writeThisSheet {
34113439

34123440
$worksheet->write_row( $worksheetLine, 0, $hashTemp{'finalArray'} );
34133441
$worksheet->write_comment( $worksheetLine,$hashColumn{'MPA_ranking'}, $hashTemp{'commentMPAscore'} ,x_scale => 2, y_scale => 5 );
3414-
$worksheet->write_comment( $worksheetLine,$hashColumn{'gnomAD_genome_ALL'}, $hashTemp{'commentGnomADgenome'} ,x_scale => 3, y_scale => 2 );
3415-
$worksheet->write_comment( $worksheetLine,$hashColumn{'gnomAD_exome_ALL'}, $hashTemp{'commentGnomADexome'} ,x_scale => 3, y_scale => 2 );
3442+
$worksheet->write_comment( $worksheetLine,$hashColumn{$gnomadGenomeColumn}, $hashTemp{'commentGnomADgenome'} ,x_scale => 3, y_scale => 2 );
3443+
$worksheet->write_comment( $worksheetLine,$hashColumn{$gnomadExomeColumn}, $hashTemp{'commentGnomADexome'} ,x_scale => 3, y_scale => 2 );
34163444
$worksheet->write_comment( $worksheetLine,$hashColumn{'Genotype-'.$case}, $hashTemp{'commentGenotype'} ,x_scale => 2, y_scale => $hashTemp{'nbSample'} );
34173445
$worksheet->write_comment( $worksheetLine,$hashColumn{'Func.'.$refGene}, $hashTemp{'commentFunc'} ,x_scale => 3, y_scale => 3 );
34183446

0 commit comments

Comments
 (0)