Skip to content

Commit

Permalink
Merge branch 'CW-2182--fix-bug-in-summary' into 'dev'
Browse files Browse the repository at this point in the history
CW-2182 -- Fix bug in per-read summary

Closes CW-2182

See merge request epi2melabs/fastcat!23
  • Loading branch information
julibeg committed Jun 12, 2023
2 parents 99c7bc9 + 671425c commit dbb5539
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v0.11.1]
### Fixed
- Bug in `fastcat` per-read summary stats.

## [v0.11.0]
### Changed
- Bamstats can now be run without a BAM index.
Expand Down
18 changes: 9 additions & 9 deletions src/fastqcomments.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ read_meta create_read_meta(const kstring_t* comment) {
meta->barcode = "";
meta->ibarcode = 0;
meta->barcode_alias = "";
meta->start_time = "";
meta->start_time = "2000-01-01T00:00:00Z";
meta->read_number = 0;
meta->channel = 0;
meta->rest = xalloc(1, sizeof(kstring_t), "meta->rest");
Expand Down Expand Up @@ -57,32 +57,32 @@ read_meta parse_read_meta(kstring_t comment) {
ksprintf_with_opt_delim(meta->rest, " ", "%s", key);
} else {
if (!strcmp(key, "runid")) {
meta->runid = pch;
meta->runid = value;
ksprintf_with_opt_delim(meta->tags_str, "\t", "RD:Z:%s", value);
}
else if (!strcmp(key, "flow_cell_id")) {
meta->flow_cell_id = pch;
meta->flow_cell_id = value;
ksprintf_with_opt_delim(meta->tags_str, "\t", "FC:Z:%s", value);
}
else if (!strcmp(key, "barcode")) {
meta->barcode = pch;
meta->ibarcode = atoi(pch+7); // "unclassified" -> 0
meta->barcode = value;
meta->ibarcode = atoi(value+7); // "unclassified" -> 0
ksprintf_with_opt_delim(meta->tags_str, "\t", "BC:Z:%s", value);
}
else if (!strcmp(key, "barcode_alias")) {
meta->barcode_alias = pch;
meta->barcode_alias = value;
ksprintf_with_opt_delim(meta->tags_str, "\t", "BA:Z:%s", value);
}
else if (!strcmp(key, "read")) {
meta->read_number = atoi(pch);
meta->read_number = atoi(value);
ksprintf_with_opt_delim(meta->tags_str, "\t", "RN:i:%s", value);
}
else if (!strcmp(key, "ch")) {
meta->channel = atoi(pch);
meta->channel = atoi(value);
ksprintf_with_opt_delim(meta->tags_str, "\t", "CH:i:%s", value);
}
else if (!strcmp(key, "start_time")) {
meta->start_time = pch;
meta->start_time = value;
ksprintf_with_opt_delim(meta->tags_str, "\t", "ST:Z:%s", value);
} else {
// the word was an unknown key-value pair --> add `key=val` to rest
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

const char *argp_program_version = "0.11.0";
const char *argp_program_version = "0.11.1";

0 comments on commit dbb5539

Please sign in to comment.