-
Notifications
You must be signed in to change notification settings - Fork 153
Splitter part 1 #1509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Splitter part 1 #1509
Conversation
Itolstoganov
commented
Aug 4, 2025
- Barcode index structure
- Contracted graph structure
- Scaffold graph vertices can store either edges or paths
146bde1
to
77e3265
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments, overall good, though would be better to have some things fixed :)
@@ -0,0 +1,18 @@ | |||
############################################################################ | |||
# Copyright (c) 2019 Saint Petersburg State University |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let us use default copyright headers here and everywhere :)
typedef std::map<VertexId, std::unordered_set<ScaffoldVertex>>::value_type value_type; | ||
|
||
AdjacencyMap() = default; | ||
AdjacencyMap(const VertexId &vertex, const ScaffoldVertex &edge) : data_({{vertex, {edge}}}) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let us pass small things (e.g. VertexId
/ EdgeId
) by value – they are trivially copyable small things and we're outlining the methods, so there is no way these will be inlined.
typedef debruijn_graph::VertexId VertexId; | ||
typedef debruijn_graph::EdgeId EdgeId; | ||
typedef scaffold_graph::ScaffoldVertex ScaffoldVertex; | ||
typedef std::map<VertexId, std::unordered_set<ScaffoldVertex>>::const_iterator const_iterator; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd have a single typename for a map type and use dependent types from it. This way changing map type would require a single-line change.
ContractedGraph(ContractedGraph &&other) = default; | ||
|
||
void InsertVertex(const VertexId &vertex); | ||
void InsertEdge(const VertexId &head, const VertexId &tail, const ScaffoldVertex &edge); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See all comments above about AdjacencyMap
visited.insert(start); | ||
ScaffoldVertex curr_vertex = start; | ||
while(edge_to_next.find(curr_vertex) != edge_to_next.end()) { | ||
curr_vertex = edge_to_next.at(curr_vertex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use the value from the iterator to save on double lookups.
}; | ||
|
||
inline std::ostream& operator <<(std::ostream& os, const SimpleBarcodeInfo& info) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code style here and below
BarcodeId barcode; | ||
FrameBarcodeInfo info(number_of_frames_); | ||
BinRead(str, barcode, info); | ||
barcode_distribution_.insert({std::move(barcode), std::move(info)}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better use emplace
}; | ||
|
||
inline std::ostream& operator <<(std::ostream& os, const FrameBarcodeInfo& info) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above
} | ||
} | ||
INFO("Number of encountered barcodes: " << barcodes.size()); | ||
std::random_device rd; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can it be downsampled deterministically? This would yield different result on different platforms and on different seeds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty file?
… in BarcodeEncoder
b363cbd
to
61c4d37
Compare