YosefLab / scone

53 stars 12 forks source link

Factor Sample Filter Bug #81

Closed mbcole closed 7 years ago

mbcole commented 7 years ago

For factor sample filter,

csum is undefined if no plotting is requested

 if(plot) {
    csum = cumsum((qpc$sdev^2)/sum(qpc$sdev^2)) #this
    plot(csum, main = "Cumulative Quality PC Variance", 
         ylab = "Fraction of Total Variance")
    abline(h = min_qual_variance, lty = 2, col = "red")
  }
  num_qual_pcs = which(csum > min_qual_variance)[1]

should be

  csum = cumsum((qpc$sdev^2)/sum(qpc$sdev^2)) #should be here
  if(plot) {
    plot(csum, main = "Cumulative Quality PC Variance", 
         ylab = "Fraction of Total Variance")
    abline(h = min_qual_variance, lty = 2, col = "red")
  }
  num_qual_pcs = which(csum > min_qual_variance)[1]
mbcole commented 7 years ago

Fixed in afe241af8ebef8df1e345b532140c2670336447e