Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion R/plotdamage.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ print.args<-function(args,des){
# NULL is an non-optional argument, NA is an optional argument with no default, others are the default arguments
args<-list(file=NULL,outfile=NA,type=1)
#if no argument are given prints the need arguments and the optional ones with default
des<-list(file=" The damage file, typicaly called meta.res.gz",outfile="name of output file",type="type=1 -r 1,type=1 -r 0 in ./metaDMG-cpp getdamage [maybe not used here yet]")
des<-list(file=" The damage file, typicaly called meta.bdamage.gz",outfile="name of output file",type="type=1 -r 1,type=1 -r 0 in ./metaDMG-cpp getdamage [maybe not used here yet]")

######################################
#######get arguments and add to workspace
Expand Down
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,34 @@ Top-level and subcommand help:
./metaDMG-cpp <subcommand> -h
```

## Filter existing bdamage output
`filter_bdamage` creates a subset of an existing `.bdamage.gz` file and (when available) matching `.stat.gz` and `.rlens.gz` files.

Important ID semantics:
- For `lca` output, IDs are taxids.
- For `getdamage --run_mode 1`, IDs are BAM reference offsets (tid), not taxids.

Basic usage:
```
./metaDMG-cpp filter_bdamage in.bdamage.gz --id 11 --out_prefix subset
```

Taxonomic expansion with descendants (from nodes):
```
./metaDMG-cpp filter_bdamage in.bdamage.gz --id 11 --out_prefix subset --nodes nodes.dmp.gz
```
This includes taxid `11` and all descendants of `11` from `nodes.dmp.gz`.

Resolve by reference/accession:
```
./metaDMG-cpp filter_bdamage in.bdamage.gz --resolve ref2 --bam reads.bam --out_prefix subset
./metaDMG-cpp filter_bdamage in.bdamage.gz --resolve ACC123 --acc2tax acc2taxid.map.gz --out_prefix subset
```

Companion files (`stat` and `rlens`):
- Auto-detected by prefix when omitted: `X.bdamage.gz` -> `X.stat.gz` and `X.rlens.gz`.
- Can be set explicitly: `--stat file.stat.gz --rlens file.rlens.gz`.

## Damage analysis (non-taxonomically assigned)
metaDMG-cpp calculates substitutions between reads and reference sequences. It can operate in two modes:

Expand Down
Loading
Loading