diff --git a/PEPPROr/R/PEPPROr.R b/PEPPROr/R/PEPPROr.R index f55ac1e..6b49323 100644 --- a/PEPPROr/R/PEPPROr.R +++ b/PEPPROr/R/PEPPROr.R @@ -552,17 +552,23 @@ calcFRiF <- function(bedFile, total, reads) { bedFile <- bedFile[order(-bedFile$bases),] } - bedFile <- bedFile[apply(bedFile != 0, 1, all),] + bedFile <- bedFile[bedFile$count > 0,] + if (nrow(bedFile) != 0) { + if (reads) { + bedFile <- cbind(bedFile, cumsum=cumsum(bedFile$count)) + } else { + bedFile <- cbind(bedFile, cumsum=cumsum(bedFile$bases)) + } - if (reads) { - bedFile <- cbind(bedFile, cumsum=cumsum(bedFile$count)) + bedFile <- cbind(bedFile, cumSize=cumsum(bedFile$size)) + bedFile <- cbind(bedFile, frip=bedFile$cumsum/as.numeric(total)) + bedFile <- cbind(bedFile, numfeats=as.numeric(1:nrow(bedFile))) } else { - bedFile <- cbind(bedFile, cumsum=cumsum(bedFile$bases)) + bedFile$cumsum = integer() + bedFile$frip = integer() + bedFile$numfeats = integer() } - - bedFile <- cbind(bedFile, cumSize=cumsum(bedFile$size)) - bedFile <- cbind(bedFile, frip=bedFile$cumsum/as.numeric(total)) - bedFile <- cbind(bedFile, numfeats=as.numeric(1:nrow(bedFile))) + return(bedFile) } diff --git a/docs/annotation.md b/docs/annotation.md index 1615a13..8607f5d 100644 --- a/docs/annotation.md +++ b/docs/annotation.md @@ -33,7 +33,7 @@ refgenie build -g GENOME -a refgene_anno --files refgene=/path/to/refGene.txt.gz ``` ## 5: Build the feat_annotation asset -The `feat_annotation` asset includes feature annotations used to calculate the [FRiF](glossary.md) and [PRiF](glossary.md). `Refgenie` can automatically build this after you have the above assets installed: +The `feat_annotation` asset includes feature annotations used to calculate the FRiF and cFRiF. `Refgenie` can automatically build this after you have the above assets installed: ```console refgenie build -g GENOME -a feat_annotation diff --git a/docs/changelog.md b/docs/changelog.md index 7f4e4ed..24e0425 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,6 +1,12 @@ # Change log All notable changes to this project will be documented in this file. +## [0.9.5] -- 2020-03-26 + +## Changed + - Updated FRiF calculation to only account for the `count` column + - Updated FRiF calculation to check if results are empty + ## [0.9.4] -- 2020-03-25 ## Changed diff --git a/docs/usage.md b/docs/usage.md index 1d12810..b04f507 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -25,7 +25,7 @@ usage: peppro.py [-h] [-R] [-N] [-D] [-F] [-T] [--silent] [--verbosity V] [--coverage] [--keep] [--noFIFO] [--no-complexity] [--prioritize] [-V] -PEPPRO version 0.9.4 +PEPPRO version 0.9.5 optional arguments: -h, --help show this help message and exit diff --git a/pipelines/peppro.py b/pipelines/peppro.py index 05631f7..364bc30 100755 --- a/pipelines/peppro.py +++ b/pipelines/peppro.py @@ -5,7 +5,7 @@ __author__ = ["Jason Smith", "Nathan Sheffield", "Mike Guertin"] __email__ = "jasonsmith@virginia.edu" -__version__ = "0.9.4" +__version__ = "0.9.5" from argparse import ArgumentParser import os diff --git a/usage.txt b/usage.txt index 1eead62..0bf5fc2 100644 --- a/usage.txt +++ b/usage.txt @@ -17,7 +17,7 @@ usage: peppro.py [-h] [-R] [-N] [-D] [-F] [-T] [--silent] [--verbosity V] [--coverage] [--keep] [--noFIFO] [--no-complexity] [--prioritize] [-V] -PEPPRO version 0.9.4 +PEPPRO version 0.9.5 optional arguments: -h, --help show this help message and exit