[gt-users] how to access GtGenomeNode content from stream?

David Ellinghaus d.ellinghaus at ikmb.uni-kiel.de
Mon Apr 20 18:00:56 CEST 2009


Dear genometools developers,

I try to get familiar with the genometools and would like to implement a 
stream in genometools
simply reading huge tables from input files line by line.
I wrote something like that for my  new "tools/gt_fam.c":

  GtNodeStream *fam_in_stream;
  GtGenomeNode *gn;

  /* create a fam input stream */
  fam_in_stream = 
gt_fam_in_stream_new(gt_str_get(arguments->str_file_selection));

  /* pull the FAM files through the stream and free them afterwards */
  while (!(had_err = gt_node_stream_next(fam_in_stream, &gn, err)) && gn) {
   
    (1) How to get the information from gn ?

    gt_genome_node_delete(gn);
  }

  /* free */
  gt_node_stream_delete(fam_in_stream);


I adapted my own source code in "extended/fam_in_stream.c" from your 
file "extended/bed_in_stream.c."
Unfortunately, I don't know how to access my parsed value (fam_id) from 
each line which must be in GtGenomeNode gn.
I have structures very similar to the ones in "extended/bed_in_stream.c":

struct GtFAMInStream {
  const GtNodeStream parent_instance;
  GtFAMParser *fam_parser;
  GtQueue *genome_node_buffer;
  char *filename;
  bool file_processed;
};

struct GtFAMParser {
  GtStr *fam_id;      /* this is read once per line */
};


Is there any possibility to cast the gn to access my string fam_id in 
each line?


Thanks a lot in advance
Best regards
David


-- 
David Ellinghaus
Institute for Clinical Molecular Biology
Christian-Albrechts-University Campus Kiel
House 6, Arnold-Heller-Str.3
D-24105 Kiel, Germany

Email:  d.ellinghaus at ikmb.uni-kiel.de
Phone:  +49-(0)431-597-1963
FAX  :  +49-(0)431-597-1842



More information about the gt-users mailing list