Skip to content

Commit

Permalink
Corrects size_t error with GFF coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Horsfield committed Jan 16, 2025
1 parent e37ce7a commit 5ad7473
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ typedef std::vector<std::vector<size_t>> NodeColourVector;
//a pair of start and end coordinates for an ORF across a node
typedef std::pair<unsigned int, unsigned int> indexPair;
// pair that describes the contig locations of an ORF, 1-indexed for contig id (first) and locations within contig (second)
typedef std::pair<size_t, std::pair<size_t, size_t>> ContigLoc;
typedef std::pair<size_t, std::pair<int, int>> ContigLoc;
// tuple holding ORF path ID, nodes traversed, node coordinates, coordinates in path, 5p and 3p coordinates
typedef std::pair<std::vector<int>, std::vector<indexPair>> ORFCoords;
// tuple containing a vector of nodeIDs, a vector of start,stop and length coordinates, length of an ORF, relative strand and score and strings for protein/DNA
Expand Down
4 changes: 2 additions & 2 deletions src/match_string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ std::pair<ContigLoc, bool> get_ORF_coords(const std::string& query,
if (query_loc >= 0)
{
// go through contig_locs to determine in which contig sequence sits
for (int i = 0; i < contig_locs.size(); i++)
for (size_t i = 0; i < contig_locs.size(); i++)
{
if (query_loc < contig_locs.at(i))
{
Expand All @@ -131,7 +131,7 @@ std::pair<ContigLoc, bool> get_ORF_coords(const std::string& query,
} else
{
// account for 1-indexing
size_t relative_loc = ((query_loc - 1) - contig_locs.at(i - 1));
int relative_loc = ((query_loc - 1) - contig_locs.at(i - 1));
contig_loc = {i + 1, {(relative_loc - 1), relative_loc + query.size()}};
}
break;
Expand Down

0 comments on commit 5ad7473

Please sign in to comment.