Commit d65f86f9 authored by Eric Coissac's avatar Eric Coissac

--no commit message

--no commit message
parent 1f4142b5
......@@ -108,7 +108,7 @@ uint32_t readPairedFastq(char* dest,
if ((readLength & 1) ==0)
{
readLength--;
fprintf(stderr,"Read length adjusted to %d",readLength);
fprintf(stderr,"Read length adjusted to %d\n",readLength);
}
forwardLength16 = round16(readLength);
......@@ -126,22 +126,26 @@ uint32_t readPairedFastq(char* dest,
// we read the forward sequence
do {
// Skip the too short reads
for (forwardLength = readFastq(dest,forward,maxsize);
forwardLength>0 && forwardLength<readLength;
forwardLength = readFastq(dest,forward,maxsize))
// skip the reverse read and take the next forward
reverseLength = readFastq(dest,reverse,maxsize);
// If readLength is not specify set up it from the length of the first sequence
if (forwardLength16==0)
{
readLength = forwardLength;
/* If the read length is even then shorten it by one base */
if ((forwardLength & 1) ==0)
if ((readLength & 1) ==0)
{
forwardLength--;
fprintf(stderr,"Read length adjusted to %d",forwardLength);
readLength--;
fprintf(stderr,"Read length adjusted to %d\n",readLength);
}
forwardLength16 = round16(forwardLength);
forwardLength16 = round16(readLength);
if (forwardLength16*2 > maxsize)
return 0;
......@@ -158,29 +162,22 @@ uint32_t readPairedFastq(char* dest,
reverseLength > 0 &&
reverseLength < readLength );
// No more sequences
if (forwardLength==0 || reverseLength==0)
return 0;
if (readLength > 0 && forwardLength > readLength)
if ((forwardLength >= readLength) && (reverseLength >= readLength)) {
for (c=dest+readLength;
c < rdest;
c++) *c=0;
if (readLength > 0 && reverseLength > readLength)
for (c=rdest+readLength;
c < (dest+maxsize);
c++) *c=0;
if (readLength==0 && forwardLength!=reverseLength)
return 0;
}
// we return the length of one read
if (readLength > 0)
return readLength;
else
return forwardLength;
return readLength;
}
......
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