Commit d44eca19 by Celine Mercier

Added the possibility to use standard input as input for sequence

datasets
parent 0c4c37d5
...@@ -223,7 +223,13 @@ fastaSeqCount seq_readAllSeq2(char *fileName, BOOL isStandardSeq, BOOL onlyATGC) ...@@ -223,7 +223,13 @@ fastaSeqCount seq_readAllSeq2(char *fileName, BOOL isStandardSeq, BOOL onlyATGC)
fastaSeqCount allseqs; fastaSeqCount allseqs;
int32_t discarded=0; int32_t discarded=0;
fp = file_open(fileName, TRUE); if ((fileName == NULL) || (strcmp(fileName, "-") == 0))
fp = stdin;
else
{
fp = file_open(fileName, TRUE);
exitIfEmptyFile(fp);
}
if (fp == NULL) if (fp == NULL)
{ {
...@@ -231,8 +237,6 @@ fastaSeqCount seq_readAllSeq2(char *fileName, BOOL isStandardSeq, BOOL onlyATGC) ...@@ -231,8 +237,6 @@ fastaSeqCount seq_readAllSeq2(char *fileName, BOOL isStandardSeq, BOOL onlyATGC)
exit(1); exit(1);
} }
exitIfEmptyFile(fp);
seqPtrAr = (fastaSeqPtr) util_malloc(slots*sizeof(fastaSeq), __FILE__, __LINE__); seqPtrAr = (fastaSeqPtr) util_malloc(slots*sizeof(fastaSeq), __FILE__, __LINE__);
seqPtr = seq_getNext(fp, " ", isStandardSeq, onlyATGC); seqPtr = seq_getNext(fp, " ", isStandardSeq, onlyATGC);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment