asl / BandageNG

a Bioinformatics Application for Navigating De novo Assembly Graphs Easily
GNU General Public License v3.0
112 stars 10 forks source link

Adding depth data to a graph #146

Closed Adamtaranto closed 8 months ago

Adamtaranto commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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?

asl commented 8 months ago

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.

Adamtaranto commented 8 months ago

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.

asl commented 8 months ago

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

Yes, sure.

asl commented 8 months ago

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