BandageNG icon indicating copy to clipboard operation
BandageNG copied to clipboard

Adding depth data to a graph

Open Adamtaranto opened this issue 1 year ago • 3 comments

Thanks for all your great work advancing this fork of Bandage.

I'm working with a Miniasm graph that does not have contig depth data stored in the gfa file and I'd like to add depth information calculated with another tool (i.e. Mosdepth).

  1. If I manually add this information into the gfa, what is the format of the tag where Bandage will look for depth data? I'm guessing this will be a tag on the Segment lines?

  2. As an alternative, it would be great to have an option to bulk import depth data from csv rather than having to use the "Change node depth" option on each individual contig. I see that I can make a custom field under "CSV data" but I'd prefer to explicitly add this info to the Depth field.

Adamtaranto avatar Jan 01 '24 22:01 Adamtaranto

I found the GFA tag name info on your wiki.

I'll add a slightly different question: If I have a BED file with coverage information for windows across a contig, is it possible to colour the intervals by their values?

It would be useful to have a kind of heatmap of read depth across a contig.

Adamtaranto avatar Jan 01 '24 22:01 Adamtaranto

Re depth tags: Unicycler seems to use dp as a depth tag instead of DP so is not picked up by BandageNG.

This can be fixed with: sed -i 's/dp:f/DP:f/g' Unicycler_asm.gfa

Can dp be added as a tag that Bandage looks for?

Adamtaranto avatar Jan 02 '24 00:01 Adamtaranto

Bandage-NG supports various options for specifying depths from GFA: https://github.com/asl/BandageNG/wiki/Custom-GFA-tags#node-depths

As GFA tags are case sensitive, dp and DP technically are different tags.

asl avatar Jan 02 '24 03:01 asl

Seeing as unicycler produced assemblies with dp, could you add that as a depth option?

Apparently, lowercase dp is used as it is not standardized in the GFA spec: see this thread.

Adamtaranto avatar Jan 08 '24 08:01 Adamtaranto

Seeing as unicycler produced assemblies with dp, could you add that as a depth option?

Yes, sure.

asl avatar Jan 09 '24 17:01 asl

Fixed in https://github.com/asl/BandageNG/commit/a57ef610054560c49b1036c1f81c0bdf70af0df2

asl avatar Jan 17 '24 21:01 asl