Exemplo n.º 1
0
static void
dump_info(GstVaapiDisplay *display)
{
    GArray *profiles, *formats;

    profiles = gst_vaapi_display_get_decode_profiles(display);
    if (!profiles)
        g_error("could not get VA decode profiles");

    print_profiles(profiles, "decoders");
    g_array_unref(profiles);

    profiles = gst_vaapi_display_get_encode_profiles(display);
    if (!profiles)
        g_error("could not get VA encode profiles");

    print_profiles(profiles, "encoders");
    g_array_unref(profiles);

    formats = gst_vaapi_display_get_image_formats(display);
    if (!formats)
        g_error("could not get VA image formats");

    print_formats(formats, "image");
    g_array_unref(formats);

    formats = gst_vaapi_display_get_subpicture_formats(display);
    if (!formats)
        g_error("could not get VA subpicture formats");

    print_formats(formats, "subpicture");
    g_array_unref(formats);

    dump_properties(display);
}
Exemplo n.º 2
0
/**
 * @brief Output the result of profile check.
 */
static void
BULKLOAD_PROFILE_PRINT()
{
	int		i;
	double	seconds[10];
	const char *GLOBALs[] = { "INIT", "READER", "WRITER", "RESET", "FLUSH", "MERGE", "INDEX", "REINDEX", "FINI" };
	const char *READERs[] = { "SOURCE", "PARSER" };
	const char *WRITERs[] = { "TOAST", "TABLE", "INDEX" };
	const char *MERGEs[] = { "UNIQUE", "INSERT", "TERM" };

	/* GLOBAL */
	i = 0;
	seconds[i++] = INSTR_TIME_GET_DOUBLE(prof_init);
	seconds[i++] = INSTR_TIME_GET_DOUBLE(prof_reader);
	seconds[i++] = INSTR_TIME_GET_DOUBLE(prof_writer);
	seconds[i++] = INSTR_TIME_GET_DOUBLE(prof_reset);
	seconds[i++] = INSTR_TIME_GET_DOUBLE(prof_flush);
	seconds[i++] = INSTR_TIME_GET_DOUBLE(prof_merge);
	seconds[i++] = INSTR_TIME_GET_DOUBLE(prof_index);
	seconds[i++] = INSTR_TIME_GET_DOUBLE(prof_reindex);
	seconds[i++] = INSTR_TIME_GET_DOUBLE(prof_fini);
	print_profiles("GLOBAL", i, GLOBALs, seconds);

	/* READER */
	i = 0;
	seconds[i++] = INSTR_TIME_GET_DOUBLE(prof_reader_source);
	seconds[i++] = INSTR_TIME_GET_DOUBLE(prof_reader_parser);
	print_profiles("READER", i, READERs, seconds);

	/* WRITER */
	i = 0;
	seconds[i++] = INSTR_TIME_GET_DOUBLE(prof_writer_toast);
	seconds[i++] = INSTR_TIME_GET_DOUBLE(prof_writer_table);
	seconds[i++] = INSTR_TIME_GET_DOUBLE(prof_writer_index);
	print_profiles("WRITER", i, WRITERs, seconds);

	/* MERGE */
	i = 0;
	seconds[i++] = INSTR_TIME_GET_DOUBLE(prof_merge_unique);
	seconds[i++] = INSTR_TIME_GET_DOUBLE(prof_merge_insert);
	seconds[i++] = INSTR_TIME_GET_DOUBLE(prof_merge_term);
	print_profiles("MERGE", i, MERGEs, seconds);
}
Exemplo n.º 3
0
//input first the fasta file, then the sample_1000.out file run on the fasta, then options
int main(int argc, char *argv[]) {
  int i,total,notcommon,most;
  char **mostfreq;
  FILE *fp;

  OUTPUT = DEF_OUTPUT;
  INPUT = NULL;
  NATIVE = NULL;
  FILTER = 0;
  NOISE = DEF_NOISE;
  MIN_HEL_LEN = DEF_MIN_HEL_LEN;
  //  THRESH_FREQ = DEF_THRESH_FREQ;
  THRESH_FREQ = 0;
  THRESH_COMMON = DEF_THRESH_COMMON;
  VERBOSE = 0;
  NUMFREQ = 0;
  NUMPROF = 0;
  PROF_FREQ = 0;
  //  PROF_FREQ = DEF_PROF_FREQ;
  NUMSTRUCTS = 0;
  THRESH_STRUCT = DEF_THRESH_STRUCT;
  LENGTH = 0;
  STATS = 0;
  GRAPH = 1;
  REP_STRUCT = 0;

  if (argc < 3) {
    fprintf(stderr,"Not enough arguments\n");
    exit(EXIT_FAILURE);
  }

  //OUTPUT = malloc(strlen(argv[1])+5);
  //sprintf(OUTPUT,"%s.dot",argv[1]);

  for (i = 3; i < argc; i++) {
    //printf("argv[%d] is %s\n",i,argv[i]);
    if (!strcmp(argv[i],"-f")) {
      FILTER = 1;
      if ((i + 1 <= argc - 1) && sscanf(argv[i+1],"%d",&NUMFREQ)) {
	//	sscanf(argv[i+1],"%s",val);
	//printf("val is %s and argv %s\n",val,argv[i+1]);
	NUMFREQ = atoi(argv[i+1]);
	i++;
      }
      else
	NUMFREQ = DEF_NUMFREQ;
    }
    else if (!strcmp(argv[i],"-z")) {
      if ((i + 1 <= argc - 1) && sscanf(argv[i+1],"%d",&NOISE)) {
	NOISE = atoi(argv[i+1]);
	i++;
      }
    }
    else if (!strcmp(argv[i],"-h")) {
      if ((i + 1 <= argc - 1) && sscanf(argv[i+1],"%f",&THRESH_FREQ)) {
	THRESH_FREQ = atof(argv[i+1]);
	if (THRESH_FREQ < 0 || THRESH_FREQ > 100) {
	  fprintf(stderr,"Error: invalid input %f for frequency threshold\n",THRESH_FREQ);
	  THRESH_FREQ = DEF_THRESH_FREQ;
	}
	i++;
      }
    }
    else if (!strcmp(argv[i],"-c")) {
      if ((i + 1 <= argc - 1) && sscanf(argv[i+1],"%f",&THRESH_COMMON)) {
	THRESH_COMMON = atof(argv[i+1]);
	if (THRESH_COMMON < 0.0 || THRESH_COMMON > 100.0) {
	  fprintf(stderr,"Error: invalid input %f for common threshold\n",THRESH_COMMON);
	  THRESH_COMMON = DEF_THRESH_COMMON;
	}
	i++;
      }
    }
    else if (!strcmp(argv[i],"-q")) {
      //PRUNE = 1;
      if ((i + 1 <= argc - 1) && sscanf(argv[i+1],"%d",&NUMPROF)) {
	NUMPROF = atoi(argv[i+1]);
	i++;
      }
    }
    else if (!strcmp(argv[i],"-p")) {
      if ((i + 1 <= argc - 1) && sscanf(argv[i+1],"%f",&PROF_FREQ)) {
	PROF_FREQ = atof(argv[i+1]);
	i++;
      }
    }
    else if (!strcmp(argv[i],"-l")) {
      if ((i + 1 <= argc - 1) && sscanf(argv[i+1],"%d",&MIN_HEL_LEN)) {
	MIN_HEL_LEN = atoi(argv[i+1]);
	i++;
      }
    }
    else if (!strcmp(argv[i],"-s")) {
      if ((i + 1 <= argc - 1) && sscanf(argv[i+1],"%d",&NUMSTRUCTS)) {
	NUMSTRUCTS = atoi(argv[i+1]);
	i++;
      }
    }
    else if (!strcmp(argv[i],"-t")) {
      if ((i + 1 <= argc - 1) && sscanf(argv[i+1],"%f",&THRESH_STRUCT)) {
	THRESH_STRUCT = atof(argv[i+1]);
	i++;
      }
    }
    else if (!strcmp(argv[i],"-o")) {
      if (i + 1 <= argc - 1) {
	OUTPUT = argv[i+1];
	i++;
      }
    }
    else if (!strcmp(argv[i],"-i")) {
      if (i + 1 <= argc - 1) {
	INPUT = argv[i+1];
	i++;
      }
    }
    else if (!strcmp(argv[i],"-n")) {
      if (i + 1 <= argc - 1) {
	NATIVE = argv[i+1];
	i++;
      }
    }
    else if (!strcmp(argv[i],"-v"))
      VERBOSE = 1;
    else if (!strcmp(argv[i],"-a"))
      STATS = 1;
    else if (!strcmp(argv[i],"-g"))
      GRAPH = 0;
    else if (!strcmp(argv[i],"-r"))
      REP_STRUCT = 1;
  }

  if (!(bp = hashtbl_create(HASHSIZE,NULL))) {
    fprintf(stderr, "ERROR: hashtbl_create() for bp failed");
    exit(EXIT_FAILURE);
  }
  
  if (!(marginals = hashtbl_create(HASHSIZE,NULL))) {
    fprintf(stderr, "ERROR: hashtbl_create() for marginals failed");
    exit(EXIT_FAILURE);
  }

  if (!(idhash = hashtbl_create(HASHSIZE,NULL))) {
    fprintf(stderr, "ERROR: hashtbl_create() for idhash failed");
    exit(EXIT_FAILURE);
  }

  if (!(binary = hashtbl_create(HASHSIZE,NULL))) {
    fprintf(stderr, "ERROR: hashtbl_create() for binary failed");
    exit(EXIT_FAILURE);
  }

  total = process_structs(argv[1],argv[2]);
  if (THRESH_FREQ==0) 
    THRESH_FREQ = set_h_dropoff(marginals, H_START);
  if (VERBOSE) {
    printf("Threshold to find frequent helices: %.1f\%\n",THRESH_FREQ);
    printf("Maximum number of frequent helices: ");
    if (NUMFREQ == 0)
      puts("no limit");
    else
      printf("%d\n",NUMFREQ);
    /*
      printf("Threshold to select frequent profiles: %.1f\%\n",PROF_FREQ);    
      printf("Maximum number of profiles: ");
      if (NUMPROF == 0)
      puts("no limit");
      else
      printf("%d\n",NUMPROF);
    */
    printf("Number of structures processed: %d\n",NUMSTRUCTS);
  }
  printf("Total number of equivalence helix classes: %d\n",total-1);
  if (VERBOSE)
    print_all_helices(total);
  
  //  make_graph(marginals,max,id,total,argv[1],fp);
  
  mostfreq = find_freq(total);
  printf("Total number of selected helices: %d\n",hashtbl_numkeys(freq));
  notcommon = make_profiles(argv[2]);
  printf("Total number of profiles: %d\n",hashtbl_numkeys(cluster));
  print_profiles();

  if (PROF_FREQ == 0) {
    PROF_FREQ = set_h_dropoff(cluster,P_START);
    if (VERBOSE)
      printf("setting p to %.1f\n",PROF_FREQ);
  }

  most = select_profiles(mostfreq,notcommon)-1;
  printf("Total number of selected profiles: %d\n",hashtbl_numkeys(cluster));
  if (hashtbl_numkeys(cluster) == 0)
    GRAPH = 0;
  if (hashtbl_numkeys(cluster) > 23 && GRAPH) {
    GRAPH = 0;
    printf("Total number of profiles above threshold %.1f is %d: disabling graph\n",PROF_FREQ,hashtbl_numkeys(cluster));
  }
  if (REP_STRUCT) {
    //fp = fopen("structures.out","w");
    //fprintf(fp,"Processing %s\n",argv[2]);
    find_consensus();
    print_consensus(argv[1]);
    //print_cluster(argv[1]);
    //fclose(fp);
  }
  if (GRAPH) {
    fp = fopen(OUTPUT,"w");
    insert_graph(fp,argv[1],most);  
    fputs("}",fp);
    fclose(fp);
  }
  hashtbl_destroy(bp);
  hashtbl_destroy(marginals);
  hashtbl_destroy(idhash);
  hashtbl_destroy(binary);
  hashtbl_destroy(freq);
  hashtbl_destroy(cluster);
  hashtbl_destroy(bracket);
  hashtbl_destroy(infreq);
  return 0;
}
Exemplo n.º 4
0
//input first the fasta file, then the sample_1000.out file run on the fasta, then options
int main(int argc, char *argv[]) {
  int i, h, minh,p;
  HASHTBL *deleteHash;
  FILE *fp;
  Set *set;
  Options *opt;

  if (argc < 3) {
    fprintf(stderr,"Not enough arguments\n");
    exit(EXIT_FAILURE);
  }

  set = make_Set(argv[2]);
  opt = set->opt;
  for (i = 3; i < argc; i++) {
    //printf("argv[%d] is %s\n",i,argv[i]);
    if (!strcmp(argv[i],"-h")) {
      if ((i + 1 <= argc - 1) && sscanf(argv[i+1],"%f",&(opt->HC_FREQ))) {
	opt->HC_FREQ = atof(argv[i+1]);
	if (opt->HC_FREQ < 0 || opt->HC_FREQ > 100) {
	  fprintf(stderr,"Error: invalid input %f for frequency threshold\n",opt->HC_FREQ);
	  opt->HC_FREQ = 0;
	}
	i++;
      }
    }
    else if (!strcmp(argv[i],"-p")) {
      if ((i + 1 <= argc - 1) && sscanf(argv[i+1],"%f",&(opt->PROF_FREQ))) {
	opt->PROF_FREQ = atof(argv[i+1]);
	if (opt->PROF_FREQ < 0 || opt->PROF_FREQ > 100) {
	  fprintf(stderr,"Error: invalid input %f for frequency threshold\n",opt->PROF_FREQ);
	  opt->PROF_FREQ = 0;
	}
	i++;
      }
    }
    else if (!strcmp(argv[i],"-c")) {
      if ((i + 1 <= argc - 1) && sscanf(argv[i+1],"%f",&(opt->COVERAGE))) {
	opt->COVERAGE = atof(argv[i+1]);
	i++;
      }
    }
    else if (!strcmp(argv[i],"-f")) {
      if ((i + 1 <= argc - 1) && sscanf(argv[i+1],"%d",&(opt->NUM_FHC))) {
	opt->NUM_FHC = atoi(argv[i+1]);
	i++;
      }
    }
    else if (!strcmp(argv[i],"-s")) {
      if ((i + 1 <= argc - 1) && sscanf(argv[i+1],"%d",&(opt->NUM_SPROF))) {
	opt->NUM_SPROF = atoi(argv[i+1]);
	i++;
      }
    }
    else if (!strcmp(argv[i],"-l")) {
      if ((i + 1 <= argc - 1) && sscanf(argv[i+1],"%d",&(opt->MIN_HEL_LEN))) {
	opt->MIN_HEL_LEN = atoi(argv[i+1]);
	i++;
      }
    }
    else if (!strcmp(argv[i],"-u")) {
      if ((i + 1 <= argc - 1) && sscanf(argv[i+1],"%d",&(opt->NUMSTRUCTS))) {
	opt->NUMSTRUCTS = atoi(argv[i+1]);
	i++;
      }
    }
    else if (!strcmp(argv[i],"-m")) {
      if (i + 1 <= argc - 1) {
	opt->PNOISE = atoi(argv[i+1]);
	i++;
      }
    }
    else if (!strcmp(argv[i],"-o")) {
      if (i + 1 <= argc - 1) {
	opt->OUTPUT = argv[i+1];
	i++;
      }
    }
    else if (!strcmp(argv[i],"-i")) {
      if (i + 1 <= argc - 1) {
	opt->INPUT = argv[i+1];
	i++;
      }
    }
    else if (!strcmp(argv[i],"-n")) {
      if (i + 1 <= argc - 1) {
	opt->NATIVE = argv[i+1];
	i++;
      }
    }
    else if (!strcmp(argv[i],"-k")) {
      if (i + 1 <= argc - 1) {
	opt->CYCLES = argv[i+1];
	i++;
      }
    }
    else if (!strcmp(argv[i],"-v"))
      opt->VERBOSE = 1;
    else if (!strcmp(argv[i],"-g"))
      opt->GRAPH = 0;
    else if (!strcmp(argv[i],"-r"))
      opt->REP_STRUCT = 1;
    else if (!strcmp(argv[i],"-t"))
      opt->TOPDOWN = 1;
    else if (!strcmp(argv[i],"-a"))
      opt->ALTTHRESH = 0;
  }

  input_seq(set,argv[1]);
  process_structs(set);
  reorder_helices(set);
  minh = print_all_helices(set);
  printf("Total number of helix classes: %d\n",set->hc_num);
  
  if (set->opt->TOPDOWN) {
    printf("Total number of extended profiles: %d\n",set->prof_num);
    h = top_down_h(set,minh);
    //if (set->opt->VERBOSE)
    printf("Number of featured helix classes: %d\n",h+1);
    find_freq(set);
    p = top_down_p(set,h);
    //if (set->opt->VERBOSE)
    printf("Number of selected profiles: %d\n",p+1);
    print_topdown_prof(set,h,p);
  } else {
    if (set->opt->NUM_FHC)
      set->opt->HC_FREQ = set_num_fhc(set);
    else if (set->opt->HC_FREQ==0) 
      set->opt->HC_FREQ = set_threshold(set,H_START);
    
    if (set->opt->VERBOSE) {
      printf("Threshold to find frequent helices: %.1f\%\n",set->opt->HC_FREQ);
      printf("Number of structures processed: %d\n",set->opt->NUMSTRUCTS);
    }
    
    find_freq(set);
    
    printf("Total number of featured helix classes: %d\n",set->num_fhc);
    make_profiles(set);
    
    printf("Total number of profiles: %d\n",set->prof_num);
    print_profiles(set);
    
    if (set->opt->NUM_SPROF)
      set->opt->PROF_FREQ = set_num_sprof(set);
    else if (set->opt->PROF_FREQ == 0) {
      set->opt->PROF_FREQ = set_p_threshold(set,P_START);
    }
    if (set->opt->VERBOSE)
      printf("setting p to %.1f\n",set->opt->PROF_FREQ);
    select_profiles(set);
    printf("Total number of selected profiles: %d\n",set->num_sprof);
  }