Skip to content

Commit

Permalink
refine stdin/stdout modes
Browse files Browse the repository at this point in the history
  • Loading branch information
sfchen committed Aug 2, 2018
1 parent 2566394 commit 2552031
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 2 additions & 6 deletions src/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,13 @@ Options::Options(){
}

bool Options::isFastqFile(string filename) {
if(filename == "/dev/stdin" || filename=="/dev/stdout")
return true;
if(ends_with(filename, ".fq") || ends_with(filename, ".fastq") || ends_with(filename, ".fq.gz")|| ends_with(filename, ".fastq.gz"))
return true;

return false;
}

bool Options::isRfqFile(string filename) {
if(filename == "/dev/stdin" || filename=="/dev/stdout")
return true;
if(ends_with(filename, ".rfq") || ends_with(filename, ".rfq.xz"))
return true;

Expand Down Expand Up @@ -62,8 +58,8 @@ bool Options::validate() {
if(compressMode == true) {
if(!out2.empty())
error_exit("In compress mode, only one RFQ output file is allowed, but you specified <out2>");
if(!isRfqFile(out1))
error_exit("In compress mode, the output should be a RFQ file. Expect a .rfq file, but got " + out1);
//if(!isRfqFile(out1))
// error_exit("In compress mode, the output should be a RFQ file. Expect a .rfq file, but got " + out1);
if(isFastqFile(out1))
error_exit("In compress mode, the output should not be a FASTQ file. Expect a .rfq or .rfq.xz file, but got " + out1);
if(isRfqFile(in1))
Expand Down
4 changes: 2 additions & 2 deletions src/repaq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ void Repaq::decompress(){
RfqHeader* header = new RfqHeader();
header->read(input);

if(header->mFlags & BIT_PAIRED_END) {
/*if(header->mFlags & BIT_PAIRED_END) {
error_exit("The input RFQ file was encoded by paired-end FASTQ, you should specify <out1> and <out2>");
}
}*/

codec.setHeader(header);

Expand Down

0 comments on commit 2552031

Please sign in to comment.