Пример #1
0
 def setTranscriptConsequences(self, transcriptConsequences):
     ''' Expect transcriptConsequences as dict from JSON '''
     #		print "biomine::variant::vepvariant::setTranscriptConsequence"
     #if not transcriptConsequences:
     #	return
     for consequence in transcriptConsequences:  #list of dict's
         otherVar = vepconsequencevariant(parentVariant=self)
         otherVar.parseTranscriptConsequence(consequence)
         self.consequences.append(otherVar)
         if otherVar.canonical:
             self.gene = otherVar.gene
Пример #2
0
	def setTranscriptConsequences( self , transcriptConsequences ):
		''' Expect transcriptConsequences as dict from JSON '''
#		print "biomine::variant::vepvariant::setTranscriptConsequence"
		#if not transcriptConsequences:
		#	return
		try:
			for consequence in transcriptConsequences: #list of dict's
				otherVar = vepconsequencevariant( parentVariant=self )
				otherVar.parseTranscriptConsequence( consequence )
				self.consequences.append( otherVar )
				if otherVar.canonical:
					self.gene = otherVar.gene
		except:
			print( "BioMine Warning: Cannot set transcript consequences - no consequence for " + self.genomicVar() )
			pass
Пример #3
0
	def setTranscriptConsequences( self , transcriptConsequences ):
		''' Expect transcriptConsequences as dict from JSON '''
#		print "biomine::variant::vepvariant::setTranscriptConsequence"
		#if not transcriptConsequences:
		#	return
		try:
			for consequence in transcriptConsequences: #list of dict's
				otherVar = vepconsequencevariant( parentVariant=self )
				otherVar.parseTranscriptConsequence( consequence )
				self.consequences.append( otherVar )
				if otherVar.canonical:
					self.gene = otherVar.gene
		except:
			print( "BioMine Warning: Cannot set transcript consequences - no consequence for " + self.genomicVar() )
			pass
Пример #4
0
    def getCSQ(self, var, record, begin, end, ref, alt, alti, **kwargs):
        info = record.INFO
        csq = info.get('CSQ', "noCSQ")
        preVEP = []
        if not csq == "noCSQ":
            vepDone = True
            exacDone = True
            var.vepVariant = vepvariant()
            for thisCSQ in csq:
                values = thisCSQ.split("|")
                var.vcfInfo = values
                aas = [None, None]
                if self.getVCFKeyIndex(values,
                                       "Amino_acids"):  #8 => Amino_acids
                    aas = self.getVCFKeyIndex(values, "Amino_acids").split("/")
                    if len(aas) > 1:
                        aas[0] = mafvariant().convertAA(aas[0])
                        aas[1] = mafvariant().convertAA(aas[1])
                    else:
                        #28 => HGVSc
                        #29 => HGVSp
                        hgvsp = self.getVCFKeyIndex(values, "HGVSp").split(":")
                        changep = None
                        if len(hgvsp) > 1:
                            changep = re.match("p\.", hgvsp[1])
                        if changep:
                            aas = mafvariant().splitHGVSp(hgvsp[1])
                            aas[0] = mafvariant().convertAA(aas[0])
                            aas[2] = mafvariant().convertAA(aas[2])
                        else:
                            aas.append(None)
                            needVEP = True
                            preVEP.append(var)
                exons = [None, None]
                if self.getVCFKeyIndex(values, "EXON"):  #25 => EXON
                    exons = self.getVCFKeyIndex(values, "EXON").split("/")
                    if len(exons) == 1:
                        exons.append(None)
                introns = [None, None]
                if self.getVCFKeyIndex(values, "INTRON"):  #26 => INTRON
                    introns = self.getVCFKeyIndex(values, "INTRON").split("/")
                    if len(introns) == 1:
                        introns.append(None)
                siftStuff = [None, None]
                if self.getVCFKeyIndex(values, "SIFT"):
                    siftStuff = self.getVCFKeyIndex(values, "SIFT").split("(")
                    if len(siftStuff) == 1:
                        siftStuff.append(None)
                    else:
                        siftStuff[1] = siftStuff[1].rstrip(")")
                polyPhenStuff = [None, None]
                if self.getVCFKeyIndex(values, "PolyPhen"):
                    polyPhenStuff = self.getVCFKeyIndex(values,
                                                        "PolyPhen").split("(")
                    if len(polyPhenStuff) == 1:
                        polyPhenStuff.append(None)
                    else:
                        polyPhenStuff[1] = polyPhenStuff[1].rstrip(")")

                vcv = vepconsequencevariant( \
                 chromosome = record.CHROM , \
                 start = begin , \
                 stop = end , \
                 dbsnp = record.ID , \
                 reference = ref , \
                 alternate = alt , \
                 gene_id=self.getVCFKeyIndex( values , "Gene" ) , \
                 transcriptCodon=self.getVCFKeyIndex( values , "Feature" ) , \
                 consequence_terms=self.getVCFKeyIndex( values , "Consequence" ).split( "&" ) , \
                 positionCodon=self.getVCFKeyIndex( values , "cDNA_position" ) , \
                 positionPeptide=self.getVCFKeyIndex( values , "Protein_position" ) , \
                 referencePeptide=aas[0] , \
                 alternatePeptide=aas[1] , \
                 strand=self.getVCFKeyIndex( values , "STRAND" ) , \
                 gene=self.getVCFKeyIndex( values , "SYMBOL" ) , \
                 gene_symbol_source=self.getVCFKeyIndex( values , "SYMBOL_SOURCE" ) , \
                 hgnc_id=self.getVCFKeyIndex( values , "HGNC_ID" ) , \
                 biotype=self.getVCFKeyIndex( values , "BIOTYPE" ) , \
                 canonical=self.getVCFKeyIndex( values , "CANONICAL" ) , \
                 ccds=self.getVCFKeyIndex( values , "CCDS" ) , \
                 transcriptPeptide=self.getVCFKeyIndex( values , "ENSP" ) , \
                 predictionSIFT=siftStuff[0] , \
                 scoreSIFT=siftStuff[1] , \
                 predictionPolyphen=polyPhenStuff[0] , \
                 scorePolyphen=polyPhenStuff[1] , \
                 exon=exons[0] , \
                 totalExons=exons[1] , \
                 intron=introns[0] , \
                 totalIntrons=introns[1] , \
                )

                var.alleleFrequency = self.getVCFKeyIndex(values, "GMAF")
                var.vepVariant.consequences.append(vcv)
            self.determineMostSevere(var, **kwargs)
            self.setAlleleMeasures(var, info, **kwargs)
        return None