Skip to content

Conversation

Itolstoganov
Copy link
Contributor

  • Barcode index structure
  • Contracted graph structure
  • Scaffold graph vertices can store either edges or paths

Copy link
Member

@asl asl left a 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
Copy link
Member

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}}}) {}
Copy link
Member

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;
Copy link
Member

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);
Copy link
Member

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);
Copy link
Member

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)
{
Copy link
Member

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)});
Copy link
Member

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)
{
Copy link
Member

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;
Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants