Skip to content

Commit

Permalink
basic version of depth has been tested and works!
Browse files Browse the repository at this point in the history
  • Loading branch information
susan-garry committed Apr 24, 2024
1 parent e47375f commit ddb6c14
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 5 additions & 5 deletions flatgfa/src/cmds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,11 @@ pub fn depth(gfa: &flatgfa::FlatGFA) {
};
}
}
for seg in gfa.segs {
let seg_id: u32 = seg.name as u32;
match depths.get(&seg_id) {
Some(depth) => println!("{}\t{}", seg_id, depth),
None => println!("{}\t{}", seg_id, 0)
for (id, seg) in gfa.segs.iter().enumerate() {
let name: u32 = seg.name as u32;
match depths.get(&(id as u32)) {
Some(depth) => println!("{}\t{}", name, depth),
None => println!("{}\t{}", name, 0)
};
}
}
4 changes: 4 additions & 0 deletions flatgfa/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ enum Command {
Stats(cmds::Stats),
Position(cmds::Position),
Extract(cmds::Extract),
Depth(cmds::Depth),
}

fn main() -> Result<(), &'static str> {
Expand Down Expand Up @@ -126,6 +127,9 @@ fn main() -> Result<(), &'static str> {
let store = cmds::extract(&gfa, sub_args)?;
dump(&store.view(), &args.output);
}
Some(Command::Depth(_)) => {
cmds::depth(&gfa);
}
None => {
// Just emit the GFA or FlatGFA file.
dump(&gfa, &args.output);
Expand Down

0 comments on commit ddb6c14

Please sign in to comment.