[EMBOSS] Problem writing sequence files

Kim Rutherford kmr at sanger.ac.uk
Wed Aug 20 13:28:30 UTC 2003


Hi.  I'm trying to write a sequence to a named file.  I tried this:

      AjPFile seqout_file = ajFileNewOut(seqout_name);
      AjPSeqout named_seqout = ajSeqoutNewF(seqout_file);

      AjPStr format_str = ajStrNew();
      ajStrAssC(&format_str, "embl");

      ajSeqOutSetFormat(named_seqout, format_str);

      ajSeqWrite(named_seqout, subseq);


I get a segmentation fault and this backtrace:

#0  0x1200b27a0 in ajFmtPrintF (file=0x0, 
    fmt=0x1400172ce "ID   %-10.10S standard; DNA; UNC; %d BP.\n")
    at ajfmt.c:1118
#1  0x12008c6a4 in seqWriteEmbl (outseq=0x140057840) at ajseqwrite.c:1956
#2  0x120087ae4 in ajSeqWrite (outseq=0x140057840, seq=0x140057700)
    at ajseqwrite.c:540
#3  0x120019c10 in splitter_write (default_seqout=0x140057ac0, 
    subseq=0x140057700, start=0, end=1139, seq=0x140048f00, 
    seqout_name=0x14008b4a0) at splitter.c:179
#4  0x120019dd8 in splitter_ProcessChunk (seqout=0x140057ac0, seq=0x140048f00, 
    start=0, end=1139, outseq_name=0x14008b4a0) at splitter.c:207
#5  0x120019844 in main (argc=4, argv=0x11fffc018) at splitter.c:87


It appears that named_seqout->File is null and ajSeqWrite() is
expecting it to be non-null.  Should I be calling a function other than
ajSeqoutNewF() to create the AjPSeqout object (ie. named_seqout)?

I'd appreciate if someone could let me know what I'm doing wrong or
point me to some example code that does something similar.

Thanks in advance,
Kim.



More information about the EMBOSS mailing list