xinhe-lab / ctwas

package for the causal TWAS project
https://xinhe-lab.github.io/ctwas/
MIT License
38 stars 12 forks source link

Use inherits to check class of object #28

Closed pcarbo closed 4 months ago

pcarbo commented 4 months ago

There are a bunch of places where you check the class of an object incorrectly. e.g., instead of

class(snp_info) == "list"

it should be

inherits(snp_info,"list")

These are the lines of code that need to be fixed:

File ‘ctwas/R/ctwas_harmonize_data.R’: if (class(snp_info) == "list") ...
File ‘ctwas/R/ctwas_harmonize_data.R’: if (class(snp_info) == "list") ...
File ‘ctwas/R/ctwas_preprocess_weights.R’: if (class(snp_info) == "list") ...
File ‘ctwas/R/ctwas_preprocess_z_snp.R’: if (class(snp_info) == "list") ...
File ‘ctwas/R/ctwas_region_data.R’: if (class(snp_info) == "list") ...
File ‘ctwas/R/ctwas_region_data.R’: if (class(snp_info) == "list") ...
File ‘ctwas/R/ctwas_region_data.R’: if (class(snp_info) == "list") ...
File ‘ctwas/R/ctwas_summarize_finemap_res.R’: if (class(snp_info) == "list") ...