From b73803fa8b4147f69ee779ed7c318bd0cce588af Mon Sep 17 00:00:00 2001 From: Tobias Rausch Date: Wed, 5 Jun 2024 14:54:37 +0200 Subject: [PATCH] fix empty seq --- src/padlock.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/padlock.h b/src/padlock.h index 498f806..53062ec 100644 --- a/src/padlock.h +++ b/src/padlock.h @@ -401,9 +401,13 @@ namespace dicey ofile << gRegions[refIndex][i].strand << '\t'; ofile << c.chrname[refIndex] << ':' << gRegions[refIndex][i].start + 1 << '-' << gRegions[refIndex][i].end + 1 << '\t'; ofile << arm1 << '-' << arm2 << '\t'; - ofile << c.spacerleft << '\t' << c.anchor << '\t'; + if (c.spacerleft.size()) ofile << c.spacerleft << '\t'; + else ofile << "n.a." << '\t'; + if (c.anchor.size()) ofile << c.anchor << '\t'; + else ofile << "n.a." << '\t'; ofile << geneInfo[gRegions[refIndex][i].lid].barcode << '\t'; - ofile << c.spacerright << '\t'; + if (c.spacerright.size()) ofile << c.spacerright << '\t'; + else ofile << "n.a." << '\t'; ofile << padlock << '\t'; ofile << arm1TM << '\t' << arm2TM << '\t' << barTM << '\t' << probeTM << '\t'; ofile << arm1GC << '\t' << arm2GC << '\t' << barGC << '\t' << probeGC << std::endl; @@ -420,10 +424,13 @@ namespace dicey rcfile << "\"" << gRegions[refIndex][i].strand << "\", "; rcfile << "\"" << c.chrname[refIndex] << ':' << gRegions[refIndex][i].start + 1 << '-' << gRegions[refIndex][i].end + 1 << "\", "; rcfile << "\"" << arm1 << '-' << arm2 << "\", "; - rcfile << "\"" << c.spacerleft << "\", "; - rcfile << "\"" << c.anchor << "\", "; + if (c.spacerleft.size()) rcfile << "\"" << c.spacerleft << "\", "; + else rcfile << "\"n.a.\", "; + if (c.anchor.size()) rcfile << "\"" << c.anchor << "\", "; + else rcfile << "\"n.a.\", "; rcfile << "\"" << geneInfo[gRegions[refIndex][i].lid].barcode << "\", "; - rcfile << "\"" << c.spacerright << "\", "; + if (c.spacerright.size()) rcfile << "\"" << c.spacerright << "\", "; + else rcfile << "\"n.a.\", "; rcfile << "\"" << padlock << "\", "; rcfile << "\"" << arm1TM << "\", "; rcfile << "\"" << arm2TM << "\", ";