Package: cwas
Category-wide association study (CWAS)CWAS (Category-Wide Association Study)is a data analytic tool to perform stringent association tests to find non-coding loci associated with autism spectrum disorder (ASD). CWAS runs category-based burden tests using de novo variants from whole genome sequencing data and diverse annotation data sets.CWAS was used in the following papers.An analytical framework for whole genome sequence association studies and its implications for autism spectrum disorder(Werlinget al., 2018)Genome-wide de novo risk score implicates promoter variation in autism spectrum disorder(Anet al., 2018)CWAS-Plus: Estimating genome-wide evaluation of noncoding variation from whole genome sequencing data. (Kim et al., in preperation)Here isthe original CWAS repository:sanderslab/cwasQuickstartData requirementsUsers must prepare following data for CWAS because it is very essential but cannot be generated automatically. Here are details.1. Input VCF data (De novo variant list)#CHROM  POS ID  REF ALT QUAL    FILTER  INFO
chr1    3747728 .        T       C       .       .       SAMPLE=11000.p1
chr1    38338861        .       C       A       .       .       SAMPLE=11000.p1
chr1    117942118       .      T       G       .       .       SAMPLE=11000.p1The input VCF data must follow thespecification of VCF.TheINFOfield must contain a sample ID of each variant with this formatSAMPLE={sample_id}.2. List of samplesSAMPLEPHENOTYPE11000.p1case11000.s1ctrl11002.p1case11002.s1ctrlCWAS requires the file like above listing sample IDs with its family IDs and phenotypes (Case=case, Control=ctrl).Here are details of the required format.Tab separated2 essential columns:SAMPLEandPHENOTYPEA value in thePHENOTYPEmust becaseorctrl.The values in theSAMPLEmust be matched with the sample IDs of variants in the input VCF file.3. List of adjustment factors (Optional)SAMPLEAdjustFactor11000.p10.93211000.s11.08211002.p10.89511002.s11.113The file like above is required if you want to adjust the number of variants for each sample in CWAS.Here are details of the required format.Tab separated2 essential columns:SAMPLEandAdjustFactorA value in theAdjustFactormust be a float.The values in theSAMPLEmust be matched with the sample IDs of variants in the input VCF file.You can get the examples of the above data requirements fromjoonan-lab/cwas-input-example4. CWAS annotation filesYou can install those file from this repository:joonan-lab/cwas-datasetgitclonehttps://github.com/joonan-lab/cwas-dataset.gitDue to the sizes of BigWig files for conservation scores, you must install them manually.Please follow this instruction.InstallationWe recomment usingconda virtual environmentto build environment for CWAS. Installing CWAS-Plus within a conda environment will prevent its installation in the global environment. When creating a conda environment, also install Python to enable local installations using pip. We recommend installing R too. Run the following statements in your shell.pipcondacreate-ncwaspython=3.10r-base=4.2.2
condaactivatecwas
pipinstallcwasgithubcondacreate-ncwaspython=3.10r-base=4.2.2
condaactivatecwas
gitclonehttps://github.com/joonan-lab/cwas.gitcdcwas
pipinstall.In addition, you must installVariant Effect Predictor (VEP).CWAS Execution1. StartRun this command.cwasstartAs default, this command createsCWAS workspacein your home directory. The path is$HOME/.cwas.$HOME/.cwas/configuration.txthas also generated.Alternatively,CWAS workspacecan be specified with-woption. Theconfiguration.txtwill also be generated in the specifiedCWAS workspace..cwas
└──configuration.txt2. ConfigurationWrite the following information in the$HOME/.cwas/configuration.txt.ANNOTATION_DATA_DIR=/path/to/your/dirGENE_MATRIX=/path/to/your/fileANNOTATION_KEY_CONFIG=/path/to/your/fileVEP=/path/to/your/vepVEP_CACHE_DIR=/path/to/your/vep/cache/dirVEP_CONSERVATION_FILE=/path/to/your/vep/resourceVEP_LOFTEE=/path/to/your/vep/resourceVEP_HUMAN_ANCESTOR_FA=/path/to/your/vep/resourceVEP_GERP_BIGWIG=/path/to/your/vep/resourceVEP_MIS_DB=/path/to/your/missense/databaseVEP_MIS_INFO_KEY=VEP_MIS_THRES=TheANNOTATION_DATAis a directory that contains all the BED files fromjoonan-lab/cwas-dataset.
TheVEP_MIS_DBis a database that is used to define damaging missense variants. TheVEP_MIS_INFO_KEYis an user-defined name of the database used to annotate variants. TheVEP_MIS_THRESis a threshold for missense variants (missense variants with value>=threshold are defined as damaging missense variants).After writing the above file, run this command.cwasconfigurationFollowing files will be generated in your home directory as default. If you specifyCWAS workspace, the files will be located in the same directory as theconfiguration.txt..cwas
├──annotation-data
├──annotation_keys.yaml
├──category_domain.yaml
├──configuration.txt
├──gene_matrix.txt
└──redundant_category.txt
.cwas_env3. PreparationThis step merges the BED files to annotate variants. Run the following command.cwaspreparation-p4You can adjust the number of worker processes with-p.After running this, merged BED file and its index will be generated in yourCWAS workspace..cwas
...
├──merged_annotation.bed.gz
├──merged_annotation.bed.gz.tbi
...4. AnnotationThis step annotate your VCF file usingVEP. Run this command.cwasannotation-v/path/to/your/vcf-p4You can adjust the number of worker processes with-p.Here is the result file..cwas
...
├──{YourVCFfilename}.annotated.vcf.gz
...5. CategorizationThis step categorize your variants using the annotation datasets. Run this command.cwascategorization-i/path/to/your/annotated/vcf-p4You can adjust the number of worker processes with-p.After running this, you will get....cwas
...
├──{YourVCFfilename}.categorization_result.zarr
...Categorized results are generated inzarr format. Outputs are easily stored and loaded with zarr.6. Burden Test (Binomial Test)This step is for calculation of relative risks and p-values for each category. As a default, these tests are based on variant-level analysis. The--use_n_carrieroption can be used for sample-level analysis.Binomial testThis step runs category-based burden test using the categorization result. The type of the test is binomial test. Run this command.cwasbinomial_test-i/path/to/your/categorization/result-s/path/to/your/samples[-a/path/to/your/adj_factors][]means that this is optional. If-aoption is not specified, this step will bypass the adjustment step.After running this, you will get....cwas
...
├──{YourVCFfilename}.burden_test.txt
├──{YourVCFfilename}.burden_test.volcano_plot.pdf
├──{YourVCFfilename}.category_counts.txt
├──{YourVCFfilename}.category_info.txt
...Permutation testThis step runs category-based permutations using the categorization result. Run this command.cwaspermutation_test-i/path/to/your/categorization/result-s/path/to/your/samples[-a/path/to/your/adj_factors][-b]If-boption is specified, this step will generate binomial p-values for each permutation. This p-values will be used for burden shift and DAWN analysis.After running this, you will get....cwas
...
├──{YourVCFfilename}.permutation_test.txt
├──{YourVCFfilename}.binom_pvals.txt.gz
...