if (trim) {
if(header.clipQualRight < header.clipQualLeft){
- seq = "NNNN";
+ if (header.clipQualRight == 0) { //don't trim right
+ seq = seq.substr(header.clipQualLeft-1);
+ }else {
+ seq = "NNNN";
+ }
}
else if((header.clipQualRight != 0) && ((header.clipQualRight-header.clipQualLeft) >= 0)){
seq = seq.substr((header.clipQualLeft-1), (header.clipQualRight-header.clipQualLeft));
if (trim) {
if(header.clipQualRight < header.clipQualLeft){
- seq = "NNNN";
+ if (header.clipQualRight == 0) { //don't trim right
+ seq = seq.substr(header.clipQualLeft-1);
+ }else {
+ seq = "NNNN";
+ }
}
else if((header.clipQualRight != 0) && ((header.clipQualRight-header.clipQualLeft) >= 0)){
seq = seq.substr((header.clipQualLeft-1), (header.clipQualRight-header.clipQualLeft));
if (trim) {
if(header.clipQualRight < header.clipQualLeft){
- out << ">" << header.name << " xy=" << header.xy << endl;
- out << "0\t0\t0\t0";
+ if (header.clipQualRight == 0) { //don't trim right
+ out << ">" << header.name << " xy=" << header.xy << " length=" << (read.qualScores.size()-header.clipQualLeft) << endl;
+ for (int i = (header.clipQualLeft-1); i < read.qualScores.size(); i++) { out << read.qualScores[i] << '\t'; }
+ }else {
+ out << ">" << header.name << " xy=" << header.xy << endl;
+ out << "0\t0\t0\t0";
+ }
}
else if((header.clipQualRight != 0) && ((header.clipQualRight-header.clipQualLeft) >= 0)){
out << ">" << header.name << " xy=" << header.xy << " length=" << (header.clipQualRight-header.clipQualLeft) << endl;
//**********************************************************************************************************************
int SffInfoCommand::printFlowSeqData(ofstream& out, seqRead& read, Header& header) {
try {
+ if (header.clipQualRight == 0) { header.clipQualRight = read.flowgram.size(); }
+
if(header.clipQualRight > header.clipQualLeft){
int rightIndex = 0;
// get rest of line in case there is a primer name
while (!inOligos.eof()) {
char c = inOligos.get();
- if (c == 10 || c == 13){ break; }
+ if (c == 10 || c == 13 || c == -1){ break; }
else if (c == 32 || c == 9){;} //space or tab
else { group += c; }
}