@@ -64,7 +64,8 @@ filterTranscripts <- function(combinedTranscripts, min.sampleNumber){
6464 combinedTranscripts $ NSampleTxScore > = min.sampleNumber ) & (
6565 combinedTranscripts $ NSampleReadProp > = min.sampleNumber )
6666 }
67- combinedTranscripts = combinedTranscripts [filterSet ,]
67+ # combinedTranscripts = combinedTranscripts[filterSet,]
68+ combinedTranscripts $ maxTxScore [! filterSet ] = 0
6869 return (combinedTranscripts )
6970}
7071
@@ -83,8 +84,10 @@ filterTranscriptsByAnnotation <- function(rowDataCombined, annotationGrangesList
8384 if (remove.subsetTx ) { # (1) based on compatibility with annotations
8485 notCompatibleIds <- which(! grepl(" compatible" , rowDataCombined $ readClassType ) |
8586 rowDataCombined $ readClassType == " equal:compatible" ) # keep equal for FDR calculation
86- exonRangesCombined <- exonRangesCombined [notCompatibleIds ]
87- rowDataCombined <- rowDataCombined [notCompatibleIds ,]
87+ # exonRangesCombined <- exonRangesCombined[notCompatibleIds]
88+ # rowDataCombined <- rowDataCombined[notCompatibleIds,]
89+ rowDataCombined $ maxTxScore [grepl(" compatible" , rowDataCombined $ readClassType ) &
90+ rowDataCombined $ readClassType != " equal:compatible" ]= 0
8891 }
8992 # (2) remove transcripts below NDR threshold/identical junctions to annotations
9093 rowDataCombined = calculateNDROnTranscripts(rowDataCombined ,
@@ -178,6 +181,7 @@ calculateNDROnTranscripts <- function(combinedTranscripts, useTxScore = FALSE){
178181 " for NDR precision stabilization." )
179182 message(" NDR will be approximated as: (1 - Transcript Model Prediction Score)" )
180183 } else combinedTranscripts $ NDR = calculateNDR(combinedTranscripts $ maxTxScore , equal )
184+ combinedTranscripts $ NDR [combinedTranscripts $ maxTxScore == 0 ] = 1
181185 return (combinedTranscripts )
182186}
183187
0 commit comments