Skip to content

Commit

Permalink
minor fixes utgcns, properly handle skip bases in layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
skoren committed Jul 24, 2024
1 parent f1cfd2a commit f405dd3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/stores/tgTig.H
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public:
uint32 deltaLength(void) { return(_deltaLen); };

// Set everything. This is to be used by unitigger.
void set(uint32 id, uint32 anchor, int32 ahang, int32 bhang, int32 bgn, int32 end) {
void set(uint32 id, uint32 anchor, int32 ahang, int32 bhang, int32 bgn, int32 end, uint32 askip = 0, uint32 bskip = 0) {

_objID = id;

Expand All @@ -130,8 +130,8 @@ public:
_ahang = ahang;
_bhang = bhang;

_askip = 0;
_bskip = 0;
_askip = askip;
_bskip = bskip;

_min = std::min(bgn, end);
_max = std::max(bgn, end);
Expand Down
2 changes: 1 addition & 1 deletion src/utgcns/layoutToPackage.C
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ loadVerkkoLayouts(sqCache *reads,
if (readMap)
fprintf(readMap, "%10u %10u %s\n", id, tig->tigID(), W[0]);

ch->set(id, pa, askp, bskp, bgn, end);
ch->set(id, pa, 0, 0, bgn, end, askp, bskp);
ch->skipConsensus(ignore);

if ((W.numWords() < 3) || (W.numWords() > 5))
Expand Down
5 changes: 2 additions & 3 deletions src/utgcns/unitigConsensus.C
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ alignEdLib(dagAlignment &aln,
int32 tigend = std::min((int32)tiglen, (int32)floor(utgpos.max() + padding));

if (verbose)
fprintf(stderr, "alignEdLib()-- align read %7u padding %d maxpad %d eRate %.4f at %9d-%-9d\n", utgpos.ident(), padding, maxpad, bandErrRate, tigbgn, tigend);
fprintf(stderr, "alignEdLib()-- align read %7u padding %7u maxpad %7u eRate %.4f at %9d-%-9d\n", utgpos.ident(), padding, maxpad, bandErrRate, tigbgn, tigend);

if (tigend < tigbgn) {
fprintf(stderr, "alignEdLib()-- WARNING: tigbgn %d > tigend %d - tiglen %d utgpos %d-%d padding %d\n",
Expand Down Expand Up @@ -1182,8 +1182,7 @@ unitigConsensus::findCoordinates(char algorithm_, u32toRead &reads_) {

// Decide on where to align this read and the expected quality.

int32 maxpad = (_tig->getChild(ii)->isLowQuality() == true) ? MAX_PADDING : MAX_PADDING; // Pad low-quality reads by at most
int32 padding = std::min(maxpad, (int32)ceil(readlen * 0.05)); // 2.5Kbp, high-quality by only 250bp.
int32 padding = std::min(MAX_PADDING, (int32)ceil(readlen * 0.05));

int32 bandpad[9] = { 1 * padding, 5 * padding, MAX_PADDING_MULT * padding,
1 * padding, 5 * padding, MAX_PADDING_MULT * padding,
Expand Down

0 comments on commit f405dd3

Please sign in to comment.