Bonjour à tous,
Je suis actuellement en train de coder un petit script qui va me comparer des p.values.
Si ma p.value est inférieure à un seuil donné alors mon programme me print cette p.value.
Le problème est que c'est p.values sont sous la forme suivante : 8.16e-01
Voici mon script :
import re
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 with open ("fypaque.txt", "r") as f1: for lignes1 in f1: lignes01=lignes1.rstrip("\n") NOM=re.search("^Reading sequence file (.+)",lignes01) PHI=re.search("^[PHI]+ .\w+.: (.+)",lignes01) if NOM: nomcore=NOM.group(1) if PHI: pvalue=PHI.group(1) if pvalue != '--': float(pvalue) if pvalue==8.16e-01: print (pvalue)
Et voici un extrait de mon fichier :
Reading sequence file mg_258.fma
Found 316 sequences of length 378
Alignment looks like a valid OTHER alignment.
Estimated diversity is (pairwise deletion - ignoring missing/ambig): 43.9%
Found 234 informative sites.
Writing alignment of informative sites to: Phi.inf.sites
Writing list of informative sites to: Phi.inf.list
Calculating all pairwise incompatibilities...
Done: 100.0%
Using a window size of 100 with k as 62
Calculating analytical mean and variance
**p-Value(s)**
----------
PHI (Normal): 8.16e-01
Reading sequence file mg_3190.fma
Found 27 sequences of length 88
Alignment looks like a valid OTHER alignment.
Estimated diversity is (pairwise deletion - ignoring missing/ambig): 56.8%
Found 61 informative sites.
Writing alignment of informative sites to: Phi.inf.sites
Writing list of informative sites to: Phi.inf.list
Calculating all pairwise incompatibilities...
Done: 100.0%
Using a window size of 100 with k as 69
Too few informative sites to use normal approximation.
Try doing a permutation test or increasing alignment length
Can also try decreasing windowsize.
**p-Value(s)**
----------
PHI (Normal): --
Reading sequence file mg_9999.fma
Found 6 sequences of length 60
Alignment looks like a valid OTHER alignment.
Estimated diversity is (pairwise deletion - ignoring missing/ambig): 0.0%
Found 0 informative sites.
Writing alignment of informative sites to: Phi.inf.sites
Writing list of informative sites to: Phi.inf.list
Calculating all pairwise incompatibilities...
100.0%
Using a window size of 100 with k as 1
Too few informative sites to use normal approximation.
Try doing a permutation test or increasing alignment length
Can also try decreasing windowsize.
**p-Value(s)**
----------
PHI (Normal): --
Mon soucis est le suivant : Je souhaite mettre un seuil de 0.01 (si les p.values sont inférieures à ce seuil alors je les print) or je ne sais pas comment écrire cette valeur dans python...Je ne sais même pas si ma regex considère mes p.values comme des chiffres...
J'espère que j'ai été assez clair et que vous pourrez m'aider...
D'avance merci.
Partager