Skip to content

Commit

Permalink
Added metrics output for single-end input data.
Browse files Browse the repository at this point in the history
  • Loading branch information
caherzee committed Feb 9, 2022
1 parent 848f5b9 commit 130732d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions filters/mark-optical-duplicates.go
Original file line number Diff line number Diff line change
Expand Up @@ -525,9 +525,11 @@ func MarkOpticalDuplicates(reads *sam.Sam, pairs *sync.Map, opticalPixelDistance
}

func calculateDerivedDuplicateMetrics(ctr *DuplicatesCtr) {
ctr.estimatedLibrarySize = estimateLibrarySize(ctr.ReadPairsExamined-ctr.ReadPairOpticalDuplicates, ctr.ReadPairsExamined-ctr.ReadPairDuplicates)
if ctr.ReadPairsExamined > 0 { // do not compute these metrics for single-end reads
ctr.estimatedLibrarySize = estimateLibrarySize(ctr.ReadPairsExamined-ctr.ReadPairOpticalDuplicates, ctr.ReadPairsExamined-ctr.ReadPairDuplicates)
ctr.histogram = histogramRoi(ctr)
}
ctr.percentDuplication = float64(ctr.UnpairedReadDuplicates+ctr.ReadPairDuplicates*2) / float64(ctr.UnpairedReadsExamined+ctr.ReadPairsExamined*2)
ctr.histogram = histogramRoi(ctr)
}

func f(x, c, n float64) float64 {
Expand Down Expand Up @@ -619,6 +621,8 @@ func PrintDuplicatesMetrics(metrics, commandLine string, ctrs map[string]*Duplic
for library, ctr := range ctrs {
if ctr.ReadPairsExamined > 0 {
fmt.Fprintf(file, "%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\t%s\t%v\n", library, ctr.UnpairedReadsExamined, ctr.ReadPairsExamined, ctr.SecondaryOrSupplementaryReads, ctr.UnmappedReads, ctr.UnpairedReadDuplicates, ctr.ReadPairDuplicates, ctr.ReadPairOpticalDuplicates, formatFloat(ctr.percentDuplication), ctr.estimatedLibrarySize)
} else {
fmt.Fprintf(file, "%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\t%s\n", library, ctr.UnpairedReadsExamined, ctr.ReadPairsExamined, ctr.SecondaryOrSupplementaryReads, ctr.UnmappedReads, ctr.UnpairedReadDuplicates, ctr.ReadPairDuplicates, ctr.ReadPairOpticalDuplicates, formatFloat(ctr.percentDuplication))
}
}
fmt.Fprintln(file)
Expand Down
2 changes: 1 addition & 1 deletion utils/programinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const (
ProgramName = "elprep"

// ProgramVersion is the version of the elprep binary
ProgramVersion = "5.1.1"
ProgramVersion = "5.1.2"

// ProgramURL is the repository for the elprep source code
ProgramURL = "http://github.com/exascience/elprep"
Expand Down

0 comments on commit 130732d

Please sign in to comment.