1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
void afficher_paires_csv(char *str_file)
{
int k;
FILE* file;
file = fopen(str_file,"w");
fprintf(file, "Ecriture du fichier CSV\n");
for (k = 0; k < MAX_PAIRS; k++)
printf("%f, %c, %d, %.3s, %f, %f, %f, %c, %d, %.3s, %f, %f, %f\n", res_pair[k].dist, res_pair[k].r1->chain_id, res_pair[k].r1->res_seq, res_pair[k].r1->name, res_pair[k].r1->x, res_pair[k].r1->y, res_pair[k].r1->z, res_pair[k].r2->chain_id, res_pair[k].r2->res_seq, res_pair[k].r2->name, res_pair[k].r2->x, res_pair[k].r2->y, res_pair[k].r2->z);
}
int main(int argc, char **argv)
{
if (argc != 3) {
fprintf(stderr, "Utilisation : %s fichier_pdb methode_calcul_centres\n", argv[0]);
exit(1);
}
methode_calcul_centres = atoi(argv[2]);
if (methode_calcul_centres <= 0 || methode_calcul_centres > 3) {
fprintf(stderr, "Methodes de calcul des centres des residus: entre 1 et 3\n");
exit(1);
}
fprintf(stderr, "Lecture du fichier PDB : %s\n", argv[1]);
lire_pdb(argv[1]);
fprintf(stderr, "Construction des résidus\n");
//afficher_atomes();
construire_residus();
fprintf(stderr, "Construction des paires\n");
//afficher_residus();
construire_paires();
//afficher_paires();
afficher_paires_csv(argv []);
return 0;
} |