Problem With Fasta Parser
1
0
Entering edit mode
12.0 years ago
TwoFaces ▴ 10

I'm looking for an existing C++ program which can parse FASTA files, and i've found this one: http://lh3lh3.users.sourceforge.net/parsefastq.shtml

the problem is that it requires a .seq file, while i've got a .fasta file, and when I give input .fasta file, nothing happens.

someone has used the program with a .fasta file?

thanks

fasta parser • 2.4k views
ADD COMMENT
2
Entering edit mode

I just compiled and ran the code without problems on a FASTA file with the suffix .fa. I don't think the suffix is the issue. Are you sure you have a valid FASTA file?

ADD REPLY
0
Entering edit mode

Yes, i use the standard human hg19.fasta, plus i've got the .fasta.fai, but i don't know how to use it.

ADD REPLY
0
Entering edit mode

FASTQ format is NOT the same as FASTA format

ADD REPLY
0
Entering edit mode

If I remember correctly, that library is supposed to work with either type.

ADD REPLY
0
Entering edit mode

I initially thought that too, but the web page states that kseq.h parses "both FASTA and FASTQ format, and even a mixture of FASTA and FASTQ records in one file."

ADD REPLY
0
Entering edit mode

then that code doesn't work with a .FASTA file...

ADD REPLY
0
Entering edit mode

Yes it does, as I stated in my first comment.

ADD REPLY
0
Entering edit mode

So, i ran it with "nameofprogram file.fasta" and returns "return value -1".

ADD REPLY
0
Entering edit mode

the problem is that when i insert the fasta, fp = NULL ( fp = gzopen(argv[1], "r"); ), and in zlib.h says that "gzopen returns NULL if the file could not be opened or if there was insufficient memory to allocate the (de)compression state"

ADD REPLY
2
Entering edit mode
12.0 years ago
brentp 24k

What you linked to is more of an API, not a program.

What are you trying to do?

There are commandline tools for dealing with sequence files here (from the same author, using the library you linked to).

ADD COMMENT
0
Entering edit mode

i would like to extract the name of chromosome and the relative bases, for all the fasta file(22 chromosomes).

for example

"chr1

AACTTAGCCC......

chr2

CCAAAATCGG......

.... "

but i need the code, because then i' ve to working with the information to compare with a bam file.

ADD REPLY

Login before adding your answer.

Traffic: 1471 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6