hugheylab / phers

https://phers.hugheylab.org
0 stars 0 forks source link

lintr found issues with code #64

Closed github-actions[bot] closed 2 years ago

github-actions[bot] commented 2 years ago
  1. R/genetic_association.R line 44: Variable and function name style should be camelCase. (https://github.com/hugheylab/phers/blob/main/R/genetic_association.R#L44)
    diseaseId = disease_id = snp = allele_count = count = N = vid = NULL   
  2. R/genetic_association.R line 67: Commas should always have a space after. (https://github.com/hugheylab/phers/blob/main/R/genetic_association.R#L67)
    snpSub = intersect(colnames(genotypes),snpSub)   
  3. R/genetic_association.R line 71: Put spaces around all infix operators. (https://github.com/hugheylab/phers/blob/main/R/genetic_association.R#L71)
    genotypes[, snpSub, drop=FALSE])   
  4. R/genetic_association.R line 76: Commas should never have a space before. (https://github.com/hugheylab/phers/blob/main/R/genetic_association.R#L76)
    measure.vars = snpSub , variable.name = 'snp', value.name = 'count',   
  5. R/genetic_association.R line 133: Variable and function name style should be camelCase. (https://github.com/hugheylab/phers/blob/main/R/genetic_association.R#L133)
    ci_lower = melt = pval = se = ci_upper = allele_count = varName = n_het = n_hom =   
  6. R/genetic_association.R line 134: Variable and function name style should be camelCase. (https://github.com/hugheylab/phers/blob/main/R/genetic_association.R#L134)
    n_total = n_wt = NULL   
  7. R/genetic_association.R line 145: Variable and function name style should be camelCase. (https://github.com/hugheylab/phers/blob/main/R/genetic_association.R#L145)
    lmInput1[allele_count == 2, allele_count := 1]}   
  8. R/genetic_association.R line 148: Variable and function name style should be camelCase. (https://github.com/hugheylab/phers/blob/main/R/genetic_association.R#L148)
    lmInput1[allele_count == 1, allele_count := 0]   
  9. R/genetic_association.R line 149: Variable and function name style should be camelCase. (https://github.com/hugheylab/phers/blob/main/R/genetic_association.R#L149)
    lmInput1[allele_count == 2, allele_count := 1]}   
  10. R/genetic_association.R line 152: Variable and function name style should be camelCase. (https://github.com/hugheylab/phers/blob/main/R/genetic_association.R#L152)
    lmInput1[, allele_count := as.factor(allele_count)]   
  11. R/genetic_association.R line 168: Variable and function name style should be camelCase. (https://github.com/hugheylab/phers/blob/main/R/genetic_association.R#L168)
    glmStat[, ci_lower := ci[1]]   
  12. R/genetic_association.R line 169: Variable and function name style should be camelCase. (https://github.com/hugheylab/phers/blob/main/R/genetic_association.R#L169)
    glmStat[, ci_upper := ci[2]]}   
  13. R/phers.R line 33: Variable and function name style should be camelCase. (https://github.com/hugheylab/phers/blob/main/R/phers.R#L33)
    flag = icd = person_id = . = NULL   
  14. R/phers.R line 84: Variable and function name style should be camelCase. (https://github.com/hugheylab/phers/blob/main/R/phers.R#L84)
    phecode = person_id = . = prev = w = NULL   
  15. R/phers.R line 117: Variable and function name style should be camelCase. (https://github.com/hugheylab/phers/blob/main/R/phers.R#L117)
    person_id = phecode = disease_id = w = score = . = NULL   
  16. R/phers.R line 157: Variable and function name style should be camelCase. (https://github.com/hugheylab/phers/blob/main/R/phers.R#L157)
    disease_id = diseaseId = resid_score = . = person_id = score = NULL   
  17. R/positive_control.R line 26: Variable and function name style should be camelCase. (https://github.com/hugheylab/phers/blob/main/R/positive_control.R#L26)
    dx_status = entry_date = uniq_dates = . = NULL   
  18. R/positive_control.R line 46: Variable and function name style should be camelCase. (https://github.com/hugheylab/phers/blob/main/R/positive_control.R#L46)
    cases[, dx_status := 1]   
  19. R/positive_control.R line 55: Variable and function name style should be camelCase. (https://github.com/hugheylab/phers/blob/main/R/positive_control.R#L55)
    dxStatus[is.na(dx_status), dx_status := 0]   
  20. R/utils.R line 111: Variable and function name style should be camelCase. (https://github.com/hugheylab/phers/blob/main/R/utils.R#L111)
    n_het = n_hom = n_wt = NULL   
  21. R/utils.R line 114: Variable and function name style should be camelCase. (https://github.com/hugheylab/phers/blob/main/R/utils.R#L114)
    dCounts[, n_wt := sum(lmInput$allele_count == 0)]   
  22. R/utils.R line 115: Variable and function name style should be camelCase. (https://github.com/hugheylab/phers/blob/main/R/utils.R#L115)
    dCounts[, n_het := sum(lmInput$allele_count == 1)]   
  23. R/utils.R line 116: Variable and function name style should be camelCase. (https://github.com/hugheylab/phers/blob/main/R/utils.R#L116)
    dCounts[, n_hom := sum(lmInput$allele_count == 2)]   
  24. data-raw/phers_create_data.R line 73: Variable and function name style should be camelCase. (https://github.com/hugheylab/phers/blob/main/data-raw/phers_create_data.R#L73)
    IcdCodes = icdPhecodeMap[flag == flag1 & !(icd %in% diseaseDxIcdMap[disease_id == marfanId]$icd)]$icd   
  25. data-raw/phers_create_data.R line 83: Variable and function name style should be camelCase. (https://github.com/hugheylab/phers/blob/main/data-raw/phers_create_data.R#L83)
    icdSampleAll = icdSampleAll[, entry_date := sample(entryDates, nrow(icdSampleAll))]   
  26. data-raw/phers_create_data.R line 94: Trailing blank lines are superfluous. (https://github.com/hugheylab/phers/blob/main/data-raw/phers_create_data.R#L94)

  27. inst/extdata/run_plink.R line 15: Lines should not be more than 120 characters. (https://github.com/hugheylab/phers/blob/main/inst/extdata/run_plink.R#L15)
    plinkCmnd = glue('--simulate {plinkSimPath} --make-bed --out {plinkOut} --simulate-ncases {npop/2} --simulate-ncontrols {npop/2} --seed 1')   

    To have lintr ignore any of these issues, add the appropriate lines of those shown below to lint_ignore.csv at the top-level of the repository:

    
    filename,line_number,message,line
    R/genetic_association.R,44,Variable and function name style should be camelCase.,diseaseId = disease_id = snp = allele_count = count = N = vid = NULL
    R/genetic_association.R,67,Commas should always have a space after.,"snpSub = intersect(colnames(genotypes),snpSub)"
    R/genetic_association.R,71,Put spaces around all infix operators.,"genotypes[, snpSub, drop=FALSE])"
    R/genetic_association.R,76,Commas should never have a space before.,"measure.vars = snpSub , variable.name = 'snp', value.name = 'count',"
    R/genetic_association.R,133,Variable and function name style should be camelCase.,ci_lower = melt = pval = se = ci_upper = allele_count = varName = n_het = n_hom =
    R/genetic_association.R,134,Variable and function name style should be camelCase.,n_total = n_wt = NULL
    R/genetic_association.R,145,Variable and function name style should be camelCase.,"lmInput1[allele_count == 2, allele_count := 1]}"
    R/genetic_association.R,148,Variable and function name style should be camelCase.,"lmInput1[allele_count == 1, allele_count := 0]"
    R/genetic_association.R,149,Variable and function name style should be camelCase.,"lmInput1[allele_count == 2, allele_count := 1]}"
    R/genetic_association.R,152,Variable and function name style should be camelCase.,"lmInput1[, allele_count := as.factor(allele_count)]"
    R/genetic_association.R,168,Variable and function name style should be camelCase.,"glmStat[, ci_lower := ci[1]]"
    R/genetic_association.R,169,Variable and function name style should be camelCase.,"glmStat[, ci_upper := ci[2]]}"
    R/phers.R,33,Variable and function name style should be camelCase.,flag = icd = person_id = . = NULL
    R/phers.R,84,Variable and function name style should be camelCase.,phecode = person_id = . = prev = w = NULL
    R/phers.R,117,Variable and function name style should be camelCase.,person_id = phecode = disease_id = w = score = . = NULL
    R/phers.R,157,Variable and function name style should be camelCase.,disease_id = diseaseId = resid_score = . = person_id = score = NULL
    R/positive_control.R,26,Variable and function name style should be camelCase.,dx_status = entry_date = uniq_dates = . = NULL
    R/positive_control.R,46,Variable and function name style should be camelCase.,"cases[, dx_status := 1]"
    R/positive_control.R,55,Variable and function name style should be camelCase.,"dxStatus[is.na(dx_status), dx_status := 0]"
    R/utils.R,111,Variable and function name style should be camelCase.,n_het = n_hom = n_wt = NULL
    R/utils.R,114,Variable and function name style should be camelCase.,"dCounts[, n_wt := sum(lmInput$allele_count == 0)]"
    R/utils.R,115,Variable and function name style should be camelCase.,"dCounts[, n_het := sum(lmInput$allele_count == 1)]"
    R/utils.R,116,Variable and function name style should be camelCase.,"dCounts[, n_hom := sum(lmInput$allele_count == 2)]"
    data-raw/phers_create_data.R,73,Variable and function name style should be camelCase.,IcdCodes = icdPhecodeMap[flag == flag1 & !(icd %in% diseaseDxIcdMap[disease_id == marfanId]$icd)]$icd
    data-raw/phers_create_data.R,83,Variable and function name style should be camelCase.,"icdSampleAll = icdSampleAll[, entry_date := sample(entryDates, nrow(icdSampleAll))]"
    data-raw/phers_create_data.R,94,Trailing blank lines are superfluous.,""
    inst/extdata/run_plink.R,15,Lines should not be more than 120 characters.,plinkCmnd = glue('--simulate {plinkSimPath} --make-bed --out {plinkOut} --simulate-ncases {npop/2} --simulate-ncontrols {npop/2} --seed 1')