From 67ccd2181d46c1864e4ecb02d6d757faccb01161 Mon Sep 17 00:00:00 2001 From: Meng Wang Date: Wed, 17 Apr 2019 16:31:15 +0800 Subject: [PATCH 1/3] minPathogenicScore could be equal --- charger/chargervariant.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charger/chargervariant.py b/charger/chargervariant.py index 5c044a3..3c78c83 100644 --- a/charger/chargervariant.py +++ b/charger/chargervariant.py @@ -539,7 +539,7 @@ def compositeScore( self , **kwargs ): minLikelyPathogenicScore = kwargs[ 'scoresMap' ][ 'minLikelyPathogenicScore' ] maxBenignScore = kwargs[ 'scoresMap' ][ 'maxBenignScore' ] maxLikelyBenignScore = kwargs[ 'scoresMap' ][ 'maxLikelyBenignScore' ] - if self.chargerScore > minPathogenicScore: + if self.chargerScore >= minPathogenicScore: self.setAsPathogenic( **kwargs ) elif self.chargerScore >= minLikelyPathogenicScore: self.setAsLikelyPathogenic( **kwargs ) From ed33c67bbcf66f336139ffecae67ac4ddf9a789d Mon Sep 17 00:00:00 2001 From: Meng Wang Date: Wed, 17 Apr 2019 16:34:54 +0800 Subject: [PATCH 2/3] fix HGVSc override would result in wrong genomic ref and alt for minus strand --- charger/charger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charger/charger.py b/charger/charger.py index c244508..12939d2 100644 --- a/charger/charger.py +++ b/charger/charger.py @@ -914,7 +914,7 @@ def getMacClinVarTSV( self , tsvfile ): clinical = { "description" : description , "review_status" : status } , \ trait = { fields[-1] : fields[header.index("all_traits")] } ) var.setStopFromReferenceAndAlternate( ) - var.splitHGVSc( fields[header.index("hgvs_c")] , override = True ) + var.splitHGVSc( fields[header.index("hgvs_c")] ) var.splitHGVSp( fields[header.index("hgvs_p")] ) #var.printVariant( "," ) #print( var.proteogenomicVar( ) ) From 133ab983392e40b2e722ba3b617276df7068d912 Mon Sep 17 00:00:00 2001 From: Meng Wang Date: Fri, 16 Aug 2019 10:46:19 +0800 Subject: [PATCH 3/3] Fix coordinate in getMacClinVarTSV --- charger/charger.py | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/charger/charger.py b/charger/charger.py index 909844a..26ee1f7 100644 --- a/charger/charger.py +++ b/charger/charger.py @@ -903,25 +903,42 @@ def getMacClinVarTSV( self , tsvfile ): for line in macFile: fields = ( line.rstrip( ) ).split( "\t" ) [ description , status ] = self.parseMacPathogenicity( header, fields ) # no need to specify which fields here anymore; parseMacPathogenicity now knows which specific columns to look for + pos = int(fields[header.index("pos")]) + ref = fields[header.index("ref")] + alt = fields[header.index("alt")] + if len(ref) == 1 and len(alt) > 1: # insertion + ref = '-' + alt = alt[1:] + start = pos + stop = pos + 1 + elif len(ref) > 1 and len(alt) == 1: # deletion + ref = ref[1:] + alt = '-' + start = pos + 1 + stop = pos + len(ref) + else: # snv + start = pos + stop = pos if len(header) > 27: # if yes, file is in the new format var = clinvarvariant( chromosome = fields[header.index("chrom")] , \ - start = fields[header.index("pos")] , \ - reference = fields[header.index("ref")] , \ - alternate = fields[header.index("alt")] , \ + start = start , \ + stop = stop , \ + reference = ref , \ + alternate = alt , \ uid = fields[header.index("variation_id")], \ gene = fields[header.index("symbol")] , \ clinical = { "description" : description , "review_status" : status } , \ trait = { fields[header.index("xrefs")] : fields[header.index("all_traits")] } ) else: # file in the old format var = clinvarvariant( chromosome = fields[header.index("chrom")] , \ - start = fields[header.index("pos")] , \ - reference = fields[header.index("ref")] , \ - alternate = fields[header.index("alt")] , \ + start = start , \ + stop = stop , \ + reference = ref , \ + alternate = alt , \ uid = fields[header.index("measureset_id")], \ gene = fields[header.index("symbol")] , \ clinical = { "description" : description , "review_status" : status } , \ trait = { fields[-1] : fields[header.index("all_traits")] } ) - var.setStopFromReferenceAndAlternate( ) var.splitHGVSc( fields[header.index("hgvs_c")] ) var.splitHGVSp( fields[header.index("hgvs_p")] ) #var.printVariant( "," )