From 7c9f503f143a28063bd7426a4654e79a5945448f Mon Sep 17 00:00:00 2001 From: Quickinline Date: Fri, 19 Mar 2021 18:35:42 +0100 Subject: [PATCH] fixed the massive problem small modifications --- .../__pycache__/components.cpython-38.pyc | Bin 6619 -> 6710 bytes projetsysteme/__pycache__/dna.cpython-38.pyc | Bin 2613 -> 2636 bytes projetsysteme/components.py | 5 ++++- projetsysteme/dna.py | 10 ++++++---- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/projetsysteme/__pycache__/components.cpython-38.pyc b/projetsysteme/__pycache__/components.cpython-38.pyc index 8f91783d41bd98041f99951a734fa7c600729d90..9d438faad11c7381f6e57b3ac657c2e7c6dc3f8d 100644 GIT binary patch delta 947 zcmZWn&1(}u6rb5mlieoSe18>%DCV%DC@Mwip^X)*tquK1v8=+n?ks6)vT0|hwUjL) zIVgf&<}4)QN$o)@J$Vy^{sm$b@4fg3c+r{Nq!b)@k9qI?-f!N={J6Y-MOlhQhXFgU zzgHiOlT4gVrU+PtL}&v9k$^-Lcp11a?7$tt6)<)o8luzk1vS`(5V(Pk zghKsWgbc4n`*)=ac7_mG1gb>e$fa9-r;fwDCz3Ub=!m75 zt>#+8YFhRni<4zq8)R+cKR}u4(N9-r7~&5ssj~k%r|X4?v9YDs%>K)qL+Nu2B4s+G zyz}cmmZ^okxY-@O?2%T=n4?bu2;Q(kf|JAVx?(f z`9=kMs}ai!6@RDFoZqK~XBlK$nq<2w-nKV!g_)|j9jdaa7pEri9Mv8y5)42*PCw^W2UT delta 828 zcmYk4%}*0S6u@V8+wCsxwuOFC4Y8s3f(O%`{ymjte3sU^Cx$XU$CV-DJn+Ob}?C3O5Vt|hbu zj5bT1hm00}jltxyn7>(|e1l*W3-CarV9JZ#dl>XKWOn5#bEA=(t#8qJa5LhruLR3Z z%}mh+_9}J}-(iQb6fUx_vG|3uw65Pb)-@XDJ$>$8GV#-gmg6Uv%Bp49)3qIgtkj6T zMwd7$>4X%`ZCc_Z6c$L#v)_YJ=>@pf7<-nu%04GX@FW{g4oCPlpYwzVl#D%?POuSa kh-C-A;R7Zmm-{P__`nIFL(mFaPrmH_Nfq`tIgW?_0S(s1o&W#< diff --git a/projetsysteme/__pycache__/dna.cpython-38.pyc b/projetsysteme/__pycache__/dna.cpython-38.pyc index 840eb59b66b29939ad91814a940d1a60f8443c90..cf469e562bb339c0f9c107a884c69ae2338e6f08 100644 GIT binary patch delta 517 zcmY+<%Ps^#6b9fr)z#JAOf!No#AVz^#67XI!Oljok;oWR;xZajGs`L#!UJea3*rd` z3Go0n))up}U@h?k&Jl^|PJOBKpHr#s`-Yc>a5)UC7(S10OKa(y@YR7z{O&v_yD-zW zL=Vv&KZ!5-yS;VCpzrp>J%=MY>*1QgReC@aD89=gun=*}ff=^rTngnVamB4uc8zlk z$}I?er(7#GnRSi$O`(|;Kp#?Ngb_+Mu@jzRI4=uamyLTV4gBxTr`Q$XB{)3AtSF8v zVWn|r*=oXiMj8)OSv&1p1B1VV_q*9&V#Se@&%3J$N W4^mu1)Dvl9fEXr5iOKjnIQs^+4{PrL delta 474 zcmYk&OD{t~6bJBg?#z8vTMd%7i1#BU9!25y8&Y;)8#xc_ z(ZDgbaVWKG$8@1XIx_$FAY?2Yv;6ryrW=K$WZaxzDDJ3y zxlpg`NshBjn(1KLiPz}9t~NGzD&K7xU-SR??GB&3RJ5DcIr)9YQ260>wRTYeRs!QF z>21Mw>ILeGOQ^adiagQ!9Z#K58N@qBZGp$SyGt7)J6U=nj6G?{8{^1u~ CE@FTH diff --git a/projetsysteme/components.py b/projetsysteme/components.py index 5f36327..f6210cb 100644 --- a/projetsysteme/components.py +++ b/projetsysteme/components.py @@ -59,7 +59,7 @@ def __init__(self, *args, **kwargs): def action_creer_adn(self): - n,result = QInputDialog.getInt(QWidget(), "Input Dialog", "Entrer la longueur:",0,0) + n,result = QInputDialog.getInt(QWidget(), "Input Dialog", "Entrer la longueur:",min=1) if result: if n>0: N=n @@ -157,7 +157,10 @@ def __init__(self, *args, **kwargs): textEdit.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) textEdit.setLineWrapMode(QTextEdit.NoWrap) singleWidth = textEdit.fontMetrics().boundingRect('A').width() + singleHeight = textEdit.fontMetrics().boundingRect('A').height() + textEdit.setFixedWidth(singleWidth*element[2]) + textEdit.setFixedHeight(singleHeight*3) setattr(self,'label_'+element[1], label) diff --git a/projetsysteme/dna.py b/projetsysteme/dna.py index 497b3cc..3fcb95d 100644 --- a/projetsysteme/dna.py +++ b/projetsysteme/dna.py @@ -80,12 +80,14 @@ def taux_codons(cls): @classmethod def masse(cls): from .acid_mass import amino_acid_abr, mass_amino_acid - if (len(cls.protein_chain)>0): + prot = cls.protein_chain.replace(' ','') + if (len(prot)>0): index = 0 l = [] - while index <= len(cls.protein_chain)-1: - if(len(cls.protein_chain[index:index+3]) == 3): - l.append(amino_acid_abr[cls.protein_chain[index:index+3]]) + while index <= len(prot)-1: + if(len(prot[index:index+3]) == 3): + + l.append(amino_acid_abr[prot[index:index+3]]) index += 3 prot_abr = ""