SEQanswers

SEQanswers (http://seqanswers.com/forums/index.php)
-   Bioinformatics (http://seqanswers.com/forums/forumdisplay.php?f=18)
-   -   samtools c++ api (http://seqanswers.com/forums/showthread.php?t=8217)

wokai001 12-03-2010 01:59 PM

samtools c++ api
 
I would like to read and write bam files within c++. For that I downloaded the source code files and tried to get the SAMtools Example c program running.

Upon compiling I get an Error message

../src/samtools/bam_reheader.c: In function ‘bam_reheader’:
../src/samtools/bam_reheader.c:28: error: ‘BGZF’ has no member named ‘x’

In "bam_reheader" I found:
Code:

// line 10: BGZF *fp;
#ifdef _USE_KNETFILE
        while ((len = knet_read(in->x.fpr, buf, BUF_SIZE)) > 0)
#else
        while (!feof(in->file) && (len = fread(buf, 1, BUF_SIZE, in->file)) > 0)
#endif
                fwrite(buf, 1, len, fp->x.fpw);          // this is line 28

where line 28 obviously is not affected by the definition of _USE_KNETFILE.

Upon looking up the definition of BGZF which is located in "bgzf.h", I found the following:
Code:

#ifdef _USE_KNETFILE
        union {
                knetFile *fpr;
                FILE *fpw;
        } x;

So, when _USE_KNETFILE is not declared, the member x is not included in the declaration of BGZF but expected to exist later on. At first sight, this seems to be an error in the source code.

Did anyone else encounter this problem or does anyone know a solution?

Thanks very much.
Wolfgang

nilshomer 12-03-2010 11:02 PM

Try posting to the samtools help list: samtools-help@lists.sourceforge.net

wokai001 12-04-2010 01:01 AM

Sent a copy
 
Quote:

Originally Posted by nilshomer (Post 30698)
Try posting to the samtools help list: samtools-help@lists.sourceforge.net

Yes, I Found the SourceForge support Site with your remark.
Sent a copy of the post.

Thank you
Wolfgang


All times are GMT -8. The time now is 07:14 AM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2021, vBulletin Solutions, Inc.