Skip to content

Commit

Permalink
Fix gfa import
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris7 committed Oct 10, 2024
1 parent 7a075c1 commit bf3b1da
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/imports/gfa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ pub fn import_gfa(gfa_path: &FilePath, collection_name: &str, conn: &Connection)
Collection::create(conn, collection_name);
let block_group = BlockGroup::create(conn, collection_name, None, "");
let gfa: Gfa<String, (), ()> = Gfa::parse_gfa_file(gfa_path.to_str().unwrap());
let mut sequences_by_segment_id: HashMap<String, Sequence> = HashMap::new();
let mut node_ids_by_segment_id: HashMap<String, i64> = HashMap::new();
let mut sequences_by_segment_id: HashMap<&String, Sequence> = HashMap::new();
let mut node_ids_by_segment_id: HashMap<&String, i64> = HashMap::new();

for segment in &gfa.segments {
let input_sequence = segment.sequence.get_string(&gfa.sequence);
let sequence = Sequence::new()
.sequence_type("DNA")
.sequence(input_sequence)
.save(conn);
sequences_by_segment_id.insert(segment.id, sequence.clone());
sequences_by_segment_id.insert(&segment.id, sequence.clone());
let node_id = Node::create(conn, &sequence.hash, None);
node_ids_by_segment_id.insert(segment.id, node_id);
node_ids_by_segment_id.insert(&segment.id, node_id);
}

let mut edges = HashSet::new();
Expand Down

0 comments on commit bf3b1da

Please sign in to comment.