Skip to content

Commit

Permalink
allow .fna as FASTA file
Browse files Browse the repository at this point in the history
  • Loading branch information
sfchen committed May 19, 2020
1 parent db2af21 commit 595cba9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/fastareader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ FastaReader::FastaReader(string faFile, bool forceUpperCase)
mFilename = faFile;
mForceUpperCase = forceUpperCase;

if (ends_with(mFilename, ".fasta.gz") || ends_with(mFilename, ".fa.gz")){
if (ends_with(mFilename, ".fasta.gz") || ends_with(mFilename, ".fa.gz") || ends_with(mFilename, ".fna.gz")){
mZipFile = gzopen(mFilename.c_str(), "r");
mZipped = true;
}
else if(ends_with(mFilename, ".fasta") || ends_with(mFilename, ".fa")){
else if(ends_with(mFilename, ".fasta") || ends_with(mFilename, ".fa") || ends_with(mFilename, ".fna")){
mFile.open(mFilename.c_str(), ifstream::in);
mZipped = false;
} else {
error_exit("Not a FASTA file: " + mFilename);
error_exit("FASTA file should have a name (*.fasta, *.fa or *.fna) or (*.fasta.gz, *.fa.gz or *.fna.gz). Not a FASTA file: " + mFilename);
}

char c;
Expand Down

0 comments on commit 595cba9

Please sign in to comment.