Git Product home page Git Product logo

mcorentin / vargen Goto Github PK

View Code? Open in Web Editor NEW
13.0 5.0 3.0 1.71 MB

VarGen is an R package designed to get a list of variants related to a disease. It just need an OMIM morbid ID as input and optionally a list of tissues / gwas traits of interest to complete the results. You can also use your own customised list of genes. VarGen is capable of annotating the variants to help you identify the most impactful ones.

License: MIT License

R 100.00%

vargen's Introduction

VarGen

VarGen is an R package designed to get a list of variants related to a disease. It just need an OMIM morbid ID as input and optionally a list of tissues / gwas traits of interest to complete the results. You can use your own customised list of genes instead of an OMIM ID. VarGen is also capable of annotating the variants to help you rank and identify the most impactful ones.

All the coordinates are based on the hg38 version of the human genome.

VarGen is open-source and available on GitHub

Funding

Vargen was developed as part of the European Union’s Horizon 2020-funded project Nutrishield (GA 818110). For more information about the Nutrishield project, please visit the Nutrishield Webpage

How to cite VarGen:

Corentin Molitor, Matt Brember, Fady Mohareb, VarGen: An R package for disease-associated variant discovery and annotation, Bioinformatics, Early Online, btz930, https://doi.org/10.1093/bioinformatics/btz930

Table of Contents

VarGen workflow

This pipeline is centred on the genes linked to the disease of interest in the Online Mendelian Inheritance in Man (subsequently called the "OMIM genes"). VarGen is designed as a discovery tool, if you want a more specific pipeline see "VarPhen" in "Alternative pipelines".

VarGen outputs variants from the following sources:

  • OMIM: Variants located directly on the "OMIM genes".
  • FANTOM5: Variants located on the enhancers / promoters of the "OMIM genes".
  • GTEx: Variants associated with a change in expression for the "OMIM genes", in certain tissues. Currently GTEx v7 and v8 are supported.
  • GWAS catalog: Variants associated with the phenotype of interest.

The variants are then annotated with myvariant.

VarGen workflow

Installation

Dependencies

VarGen needs the following:

  • R (tested on version 3.6)
  • An internet connection
  • The following R libraries: (The number is the version tested during development)
    Bioconductor (3.9)      biomaRt (2.40.3)        gtools (3.8.1)         
    gwascat (2.16.0)        jsonlite (1.6)          GenomeInfoDb (1.20.0)
    IRanges (2.18.1)        httr (1.4.1)            BiocGenerics (0.30.0)
    stringr (1.4.0)         utils (3.6.0)           splitstackshape (1.4.8)
    ggplot2 (3.2.1)         rtracklayer (1.44.2)    BiocManager (1.30.4)
    R.utils (2.9.0)         myvariant (1.14.0)      GenomicRanges (1.36.0)
    data.table (1.12.8)
  • Optional R libraries (needed for the visualisation functions: vargen_visualisation and plot_manhattan_gwas):
    Gviz (1.28.1)           ggbio (>= 1.32.0)

To install the dependencies you can use the following command in R (it might take a while depending on your connection):

# If not already installed
install.packages("BiocManager")

BiocManager::install(c("biomaRt", "gtools", "GenomicRanges", "gwascat", "jsonlite",
                       "GenomeInfoDb", "IRanges", "httr", "BiocGenerics", "stringr",
                       "utils", "splitstackshape", "ggplot2", "rtracklayer",
                       "R.utils", "myvariant", "data.table"), dependencies = TRUE)

note: "R.methodsS3" and "R.oo" will be installed as dependencies of "R.utils"

Install VarGen with devtools

The easiest way to get VarGen is to install it directly from R using “devtools”:

install.packages("devtools")
library(devtools)
install_github(repo = "MCorentin/vargen", dependencies = TRUE)
library(vargen)

Install VarGen from source

Alternatively you can clone the GitHub repository:

git clone https://github.com/MCorentin/vargen

Then open R and install the package script from source:

library(utils)
install.packages("./vargen/", repos = NULL, type = "source")

Preparing the input

Obtaining the local files

VarGen is fetching data from public databases, it needs the following files (they should all be in the same folder). The easiest way to get them is to use the vargen_install function from this package. The list of files obtained by the function is available below (with their approximate sizes and the links to download them manually). note: The installation can take a while, especially for the GTEx files.

vargen_install(install_dir = "./vargen_data", gtex_version = "v8", verbose = T)

Alternatively, they can be installed manually (the approximate size of every file is written in parenthesis next to the filename):

note: VarGen will use the name of the file to get the extract date, so it needs to be in the format: [filename]_rYYYYY-MM-DD.tsv

Getting the OMIM id

The OMIM morbid ID is the starting point of the pipeline, from it VarGen will get the genes associated to the disease. You can obtain it from the OMIM website https://omim.org/ or using the list_omim_accessions function. In our case we will use “obesity leanness included” (OMIM id: 601665).

gene_mart <- connect_to_gene_ensembl()
View(list_omim_accessions(gene_mart))

# You can search using list of keywords as well:
list_omim_accessions(gene_mart, c("alzheimer", "neurodegeneration"))

#>      mim_morbid_accession    mim_morbid_description
#> [1]  606889                  ALZHEIMER DISEASE 4;;AD4;;ALZHEIMER DISEASE, FAMILIAL, 4
#> [2]  618476                  BRAIN ABNORMALITIES, NEURODEGENERATION, AND DYSOSTEOSCLEROSIS;BANDDOS
#> [3]  615643                  NEURODEGENERATION WITH BRAIN IRON ACCUMULATION 6; NBIA6
#> [4]  618276                  NEURODEGENERATION, CHILDHOOD-ONSET, WITH CEREBELLAR ATROPHY; CONDCA
#> [5]  618278                  FIBROSIS, NEURODEGENERATION, AND CEREBRAL ANGIOMATOSIS; FINCA
#> ...

Getting the GTEx tissues

This database will be used to get tissue-specific variants that are affecting the expression of the genes related to the disease. You can obtain the list of files with the list_gtex_tissues function.

list_gtex_tissues(gtex_dir = "./vargen_data/GTEx_Analysis_v8_eQTL/")

#>      keywords                     filepaths
#> [1]  Adipose_Subcutaneous         vargen_data/GTEx_Analysis_v8_eQTL/Adipose_Subcutaneous.v8.signif_variant_gene_pairs.txt.gz
#> [2]  Adipose_Visceral_Omentum     vargen_data/GTEx_Analysis_v8_eQTL/Adipose_Visceral_Omentum.v8.signif_variant_gene_pairs.txt.gz
#> [3]  Adrenal_Gland                vargen_data/GTEx_Analysis_v8_eQTL/Adrenal_Gland.v8.signif_variant_gene_pairs.txt.gz
#> [4]  Artery_Aorta                 vargen_data/GTEx_Analysis_v8_eQTL/Artery_Aorta.v8.signif_variant_gene_pairs.txt.gz
#> ...

To select the GTEx tissues of interest you can use the select_gtex_tissues function, for our case we will use the adipose tissues (subcutaneous and visceral):

adipose_tissues <- select_gtex_tissues("./vargen_data/GTEx_Analysis_v8_eQTL/", "adipose")
adipose_tissues

#> [1] "./vargen_data/GTEx_Analysis_v8_eQTL/Adipose_Subcutaneous.v8.signif_variant_gene_pairs.txt.gz"    
#> [2] "./vargen_data/GTEx_Analysis_v8_eQTL/Adipose_Visceral_Omentum.v8.signif_variant_gene_pairs.txt.gz"

Getting the gwas traits

The gwas traits will be used to get associated variants in the gwas catalog (https://www.ebi.ac.uk/gwas/). You can search the available gwas traits by keyword with the list_gwas_traits function. Here we are going to use a local gwas catalog file.

gwas_cat <- create_gwas("./vargen_data")
obesity_traits <- list_gwas_traits("obesity", gwas_cat)
obesity_traits

#>  [1] "Obesity (extreme)"
#>  [2] "Obesity-related traits"
#>  [3] "Obesity"
#>  [4] "Obesity (early onset extreme)"
#>  [5] "Obesity in adult survivors of childhood cancer exposed to cranial radiation"
#>  [6] "Obesity in adult survivors of childhood cancer not exposed to cranial radiation"
#>  [7] "Bilirubin levels in extreme obesity"
#>  [8] "Type 2 diabetes (young onset) and obesity"
#>  [9] "Obesity and osteoporosis"
#> [10] "Hepatic lipid content in extreme obesity"
#> [11] "Hyperinsulinemia in obesity"

How to use VarGen

Launching the pipeline

VarGen main entry point is the vargen_pipeline function.

The mandatory inputs are:

  • The folder with the installed files, "./vargen_data/" in our case (see "Obtaining the local files")
  • A OMIM morbid id, “601665” in our case (see "Getting the OMIM id").
  • An output directory, where information about the variants and the genes will be written. The default is the current directory “./”.

The optional inputs are:

  • A fantom5 correlation threshold, the higher it is, the stricter you are about association between genes and enhancers. The default is 0.25
  • A list of GTEx tissues (see "Getting the GTEx tissues")
  • A list of gwas traits (see "Getting the gwas traits")

Now we can launch the pipeline with all the input data:

adipose_tissues <- select_gtex_tissues("./vargen_data/GTEx_Analysis_v8_eQTL/", 
                                       "adipose")

gwas_cat <- create_gwas("./vargen_data")
obesity_traits <- list_gwas_traits("obesity", gwas_cat)

obesity_variants <- vargen_pipeline(vargen_dir = "./vargen_data/", 
                                    omim_morbid_ids = "601665", 
                                    gtex_tissues = adipose_tissues, 
                                    gwas_traits = obesity_traits, 
                                    verbose = T)

You will obtain a data.frame with the list of variants, their position on GRCh38, the ensembl id and hgnc gene symbol of the gene associated with the variant and the source (omim, fantom5, gtex or gwas). For gtex, the name of the tissue from which the variant was found is written in parenthesis, for example: "gtex (Adipose_Subcutaneous)"

#  chr     pos         rsid           ensembl_gene_id    hgnc_symbol  source
#> chr2    25160855    rs777983882    ENSG00000115138    POMC         omim
#> chr2    25160866    rs1480805741   ENSG00000115138    POMC         omim
#> chr2    25160871    rs1245939527   ENSG00000115138    POMC         omim
#> chr2    25160872    rs1219237056   ENSG00000115138    POMC         omim
#> chr2    25160877    rs1453226041   ENSG00000115138    POMC         omim
#> chr2    25160879    rs566456581    ENSG00000115138    POMC         omim
...
#> chr5    96442329    rs6879048      ENSG00000175426    PCSK1        gtex (Adipose_Visceral_Omentum)

Annotating the variants

This pipeline is designed as a discovery analysis, to identify potential new variants, you should not expect every variants from the pipeline to have an effect on the phenotype. Annotating the variants will help you defining which variants to keep or discard. To annotate the variants you can use the annotate_variants function with the list of rsids obtained with the vargen pipeline. This uses myvariant.info to annotate the variants and may take some time depending on your internet connection.

The annotation contains:

  • ref: the reference allele in the human reference (GRCh38)
  • alt: the alternative reference for this rsid. Some rsid are multi-allelic and can have more than one alternative allele. In this case VarGen creates one line per alternative allele and annotates them separately (as some alleles are more deleterious than others for a single rsid).
  • CADD Phred score: ranging from 1 to 99, based on the rank of each variant relative to all possible 8.6 billion substitutions in the human reference genome. A higher value means a more deleterious variant. (above 10 means the variant is in the top 10%, above 20 in the top 1%).
  • fathmm-xf score: between 0 and 1, a higher value means a more deleterious variant. (more confidence closer to 0 or 1)
  • fathmm-xf prediction: "D" (DAMAGING) if score > 0.5 or "N" (NEUTRAL) otherwise.
  • Annotation type: information about the variant location (eg: coding, non-coding, regulatory region...)
  • Consequence: gives more information on the functional effect (eg: REGULATORY, DOWNSTREAM, STOP_GAINED, SPLICE-SITE...)
  • ClinVar clinical significance: standard to report the clinical significance of certain variants (eg: "benign", "pathogenic", "drug response" etc....).
  • snpEff impact: assessment of the putative impact of the variant (HIGH, MODERATE, MODIFIER or LOW).

/!\ The alternative allele is not always the risk allele (it can be the reference allele, meaning that the majority of the population is carrying the risk).

obesity_annotation <- annotate_variants(obesity_variants$rsid, verbose = T)

# Merging the output of the annotation with VarGen output, using the "rsid" column
obesity_ann <- merge(obesity_variants, obesity_annotation)

# We advise you to write the variants in a file, so you will not have to run the pipeline again.
write.table(x = obesity_ann, quote = FALSE, row.names = FALSE,
            file = "./OMIM_601665/vargen_variants_annotated.tsv", sep = "\t")

Output after annotation: Output after annotation

Filtering the variants

As VarGen is outputting a lot of variants, you may want to filter the results. The filtering strategy is dependent on your preferences. VarGen outputs an R data.frame containing information about each variant. You can focus on clinically significant variants ("pathogenic", "likely pathogenic" etc...), on variants with a high phred score etc...

You can even combine different filtering, for example we found that keeping all the variants from the gwas catalog and with clinical significance while removing the variants with a cadd phred score lower than 10 was removing a lot of potentially false positive results:

vargen_phred_10 <- obesity_ann [obesity_ann$cadd_phred > 10,]
vargen_phred_10 <- vargen_phred_10[!is.na(vargen_phred_10$cadd_phred),]

vargen_clinVar <- obesity_ann [obesity_ann$clinical_significance != "",]

vargen_gwas <- obesity_ann[obesity_ann$source == "gwas",]

#Concatenating the different filtering
obesity_filtered <- rbind(vargen_phred_10, vargen_clinVar, vargen_gwas)	

Alternative pipelines

VarPhen

A more specific, alternative pipeline is available as part of this package, called "VarPhen", it outputs a smaller list of variants, but directly related to the disease of interest. It relies on biomaRt to link variants to phenotypes.

note: You will need to specify the columns to merge the results from VarPhen ("redsnp_id") and the annotation ("rsid"). cf: the example below.

VarPhen workflow

Example with obesity:

# First connect to snp ensembl
snp_mart <- connect_to_snp_ensembl()

obesity_phens <- get_phenotype_terms(keyword = "obesity", 
                                     snp_mart = snp_mart)

obesity_varphen <- get_variants_from_phenotypes(phenotypes = obesity_phens, 
                                                snp_mart = snp_mart)

obesity_varphen_annotation <- annotate_variants(obesity_varphen$refsnp_id)

# /!\ contrary to vargen, here you need to specify which columns to merge
# "refsnp_id" for varphen, and "rsid" for the annotation.
obesity_varphen_annotated <- merge(obesity_varphen, 
                                   obesity_varphen_annotation, 
                                   by.x = "refsnp_id", by.y = "rsid")

Output example: VarPhen output

Customised list of genes

If instead of an OMIM id you are interested in a specific list of genes, you can use the vargen_custom function with a list of ensembl gene ids. This take the same input as vargen_pipeline (except the omim id) and follow the same workflow (variants on genes, promoters, gtex and gwas).

Example:

adipose_tissues <- select_gtex_tissues("./vargen_data/GTEx_Analysis_v8_eQTL/", 
                                       "adipose")

gwas_cat <- create_gwas("./vargen_data")
obesity_traits <- list_gwas_traits("obesity", gwas_cat)

obesity_custom <- vargen_custom(vargen_dir = "./vargen_data/", 
                                gene_ids = c("ENSG00000155846", "ENSG00000115138"), 
                                outdir = "./", 
                                gtex_tissues = adipose_tissues, 
                                gwas_traits = obesity_traits, 
                                verbose = T)

Tips

How to get gwas variants only

If you are only interested in the gwas variants, you can use the following commands:

gwas_cat <- create_gwas()

# This will list the gwas traits with "alzheimer":
list_gwas_traits(keywords = "alzheimer", gwas_cat = gwas_cat)

# Selecting some gwas traits of interest:
alzheimer_traits <- c("Alzheimer's disease", "Alzheimer's disease (late onset)", "Alzheimer's disease (cognitive decline)")

# This will get the variants from the selected traits:
gwas_variants <- get_gwas_variants(gwas_cat = gwas_cat, gwas_traits = alzheimer_traits)

# If you want more details about the variants you can annotate them:
gwas_variants_annotated <- annotate_variants(rsid = gwas_variants$rsid)

How to plot the gwas variants

If you want to visualise the variants in a manhattan plot, you can use the plot_manhattan_gwas function:

gwas_cat <- create_gwas()

alzheimer_traits <- c("Alzheimer's disease", "Alzheimer's disease (late onset)", "Alzheimer's disease biomarkers", 
                      "Alzheimer's disease (cognitive decline)")

plot_manhattan_gwas(traits = alzheimer_traits, gwas_cat = gwas_cat)

# Optional: if you want to save the plot as a pdf
pdf("./manhanttan_alzheimer.pdf", width = 14)
    plot_manhattan_gwas(traits = alzheimer_traits, gwas_cat = gwas_cat)
dev.off()

Example of manhanttan plot for alzheimer's disease

The two thresholds, suggestive and significant, correspond to the definition given by Lander and Kruglyak:

Lander E, Kruglyak L. Genetic dissection of complex traits: guidelines for interpreting and reporting linkage results. Nat Genet. 1995;11(3):241-7.

How to plot the omim variants

You can use the vargen_visualisation function to have an overview of the variants located on the omim genes. Note that one variant can be represented multiple times, as it consequence and phred score will be different according to each transcript.

# cf: 'Annotating the variants' to create "vargen_variants_annotated.tsv":
obesity_vargen_ann <- read.table(file = "./OMIM_601665/vargen_variants_annotated.tsv",
                                 header = T, sep = "\t", stringsAsFactors = F)
 
gene_mart <- connect_to_gene_ensembl()
vargen_visualisation(annotated_snps = obesity_vargen_ann,
                     outdir = "./obesity_gviz/", 
                     device = "png", 
                     gene_mart = gene_mart)

The plot contains 4 tracks:

  • The chromosome, with a red marker on the gene location
  • The ensembl transcripts
  • The variant consequences, grouped by type (eg: INTRONIC, STOP LOST etc...), each green bar represent a variant
  • The cadd phred score, each dot represent a variant.

vargen visualisation

The rsid_highlight parameter allows you to highlight some variants (by rsid) in red:

obesity_vargen_ann <- read.table("OMIM_601665/vargen_variants_annotated.tsv")

gene_mart <- connect_to_gene_ensembl()
vargen_visualisation(annotated_snps = obesity_vargen_ann, verbose = T,
                     outdir = "./obesity_gviz/", device = "png", 
                     gene_mart = gene_mart,
                     rsid_highlight = unique(obesity_vargen_ann[obesity_vargen_ann$cadd_phred > 20, "rsid"]))

vargen visualisation with highlighted variants

ensembl mirrors

If you come accross the following error when trying to use VarGen:

Error in bmRequest(request = request, ssl.verifypeer = ssl.verifypeer,  : 
  Internal Server Error (HTTP 500).

It means that the ensembl server you are trying to access is not available (by default VarGen tries to access the "www" mirror of ensembl).

To solve this issue, you can try to connect with a different mirror ("useast", "uswest" or "asia"):

gene_ensembl <- connect_to_gene_ensembl(mirror = "useast")

GTEx InDels (prior to VarGen v0.1.6)

GTEx and Ensembl do not use the same position to refer to the same InDel.

For example with 1_760811_CTCTT_C_b37 (rs200712425):

  • GTEx format: CTCTT becomes C.
  • Ensembl format: TCTTTCTTT becomes TCTTT.

In both cases TCTT gets deleted, but GTEx refers it from the left (position 760811) and ensembl from the right (position 760812).

Since VarGen was using the position to translate the GTEx id to rsid, "convert_gtex_to_rsids" did not work for InDels. This was corrected in VarGen v0.1.3 (commit: 2ed3488d5976275104647eeae2c87a5f759a0c1a) and now the correct rsids are retrieved.

/!\ However, if there is a SNP at the same position than the InDel, it will also be retrieved.

Update: Since VarGen v0.1.6, the GTEx rsids are retrieved from a lookup table, so this issue is now irrelevant.

Some examples

In the following example we are assuming that the files described in "Installation" have been installed in the folder "./vargen_data", either manually or by running:

 vargen_install("./vargen_data")
  • Example 1: "Simple query for Type 1 Diabetes Mellitus"
T1DM_variants <- vargen_pipeline(vargen_dir = "./vargen_data",
                                 omim_morbid_ids = "222100")
  • Example 2: "Type 1 Diabetes Mellitus with GTEx"
# First select the tissues of interest (here pancreas)
# it is possible to select more than one tissue (eg: c("pancreas", "adipose"))
pancreas_gtex <- select_gtex_tissues(gtex_dir = "./vargen_data/GTEx_Analysis_v8_eQTL/",
                                     tissues_query = "pancreas")

T1DM_variants <- vargen_pipeline(vargen_dir = "./vargen_data", 
                                 omim_morbid_ids = "222100", 
                                 gtex_tissues = pancreas_gtex)
  • Example 3: "Obesity with GTEx, GWAS and annotation"
# First select the tissues of interest (here adipose) 
# it is possible to select more than one tissue (eg: c("pancreas", "adipose"))
adipose_gtex <- select_gtex_tissues(gtex_dir = "./vargen_data/GTEx_Analysis_v8_eQTL/", 
                                    tissues_query = "adipose")

# List the available gwas traits:
list_gwas_traits(keywords = "obesity")

# Select gwas traits of interest
gwas_obesity <- c("Obesity (extreme)", "Obesity-related traits", "Obesity", "Obesity (early onset extreme)")

Obesity_variants <- vargen_pipeline(vargen_dir = "./vargen_data",
                                    omim_morbid_ids = "601665", 
                                    gtex_tissues = adipose_gtex,
                                    gwas_traits = gwas_obesity,
                                    fantom_corr = 0.25, 
                                    verbose = TRUE)

# Annotation of the variants obtained with the previous command:
Obesity_annotation <- annotate_variants(rsid = Obesity_variants$rsid)

# Merging the original output with the annotation:
Obesity_variants_annotated <- merge(Obesity_variants, Obesity_annotation)
View(Obesity_variants_annotated)

vargen's People

Contributors

fadymohareb avatar mcorentin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vargen's Issues

VarPhen pipeline - phenotypes

Due to a change in biomaRt, get_phenotype_terms() does not return a list of phenotypes anymore.

obesity_phens <- get_phenotype_terms(keyword = "obesity", snp_mart = snp_mart)

Error in biomaRt::getBM(attributes = c("chr_name", "chrom_start", "refsnp_id", :
Values argument contains no data.

However, get_variants_from_phenotypes() still works if the user knows the list of phenotypes to use as input.

"convert_gtex_to_rsids" does not work for InDels.

GTEx and Ensembl do not use the same position to refer to the same InDels.

For example with 1_760811_CTCTT_C_b37 (rs200712425).

  • GTEx format: CTCTT becomes C.
  • Ensembl format: TCTTTCTTT becomes TCTTT.

In both cases "TCTT" gets deleted, but GTEx refers it from the left (position 760811) and ensembl from the right (position 760812).

Since VarGen uses the position to translate the GTEx id to rsid, "convert_gtex_to_rsids" does not work for InDels.

Issues with annotation of variants

Hi!
I used the following command to run the VarGen pipeline but I am getting the following error:

> disease_variants <- vargen_pipeline(vargen_dir = "./vargen_data/", 
+                                     omim_morbid_ids = c("125853",
+                                                         "222100", 
+                                                         "601665", 
+                                                         "604302",
+                                                         "212750",
+                                                         "145500",
+                                                         "603813",
+                                                         "166710",
+                                                         "266600",
+                                                         "610938",
+                                                         "601367",
+                                                         "223100",
+                                                         "600807"),
+                                     gtex_tissues = gtex_tissue,
+                                     gwas_traits = disease_traits, 
+                                     verbose = T)
[1] "Connecting to the gene mart..."
[1] "Connecting to the snp mart..."
[1] "Building the gwascat object..."
[1] "Reading the enhancer tss association file for FANTOM5... './vargen_data//enhancer_tss_associations.bed'"
[1] "Starting the pipeline..."
[1] "Getting genes for OMIM: 125853"
[1] "Getting genes for OMIM: 222100"
[1] "Getting genes for OMIM: 601665"
[1] "Getting genes for OMIM: 604302"
[1] "Getting genes for OMIM: 212750"
[1] "Getting genes for OMIM: 145500"
[1] "Getting genes for OMIM: 603813"
[1] "Getting genes for OMIM: 166710"
[1] "Getting genes for OMIM: 266600"
[1] "Getting genes for OMIM: 610938"
[1] "Getting genes for OMIM: 601367"
[1] "Getting genes for OMIM: 223100"
[1] "Getting genes for OMIM: 600807"
[1] "Writing the list of genes to: .//genes_info.tsv"
[1] "Getting the GTEx variants..."
[1] "Loading GTEx lookup table... Please be patient"
|--------------------------------------------------|
|==================================================|
[1] "Number of GTEx ids removed (no corresponding rsid): 135"
Error in vecseq(f__, len__, if (allow.cartesian || notjoin || !anyDuplicated(f__,  : 
  Join results in 1895121 rows; more than 471669 = nrow(x)+nrow(i). Check for duplicate key values in i each of which join to the same group in x over and over again. If that's ok, try by=.EACHI to run j for each group to avoid the large allocation. If you are sure you wish to proceed, rerun with allow.cartesian=TRUE. Otherwise, please search for this error message in the FAQ, Wiki, Stack Overflow and data.table issue tracker for advice.
In addition: Warning messages:
1: In vargen_pipeline(vargen_dir = "./vargen_data/", omim_morbid_ids = c("125853",  :
  Gene mart not provided (or not a valid Mart object).We used one from connect_to_gene_ensembl() instead.
2: In vargen_pipeline(vargen_dir = "./vargen_data/", omim_morbid_ids = c("125853",  :
  Snp mart not provided (or not a valid Mart object).We used one from connect_to_snp_ensembl() instead.
3: In type.convert.default(X[[i]], ...) :
  'as.is' should be specified by the caller; using TRUE
4: In type.convert.default(X[[i]], ...) :
  'as.is' should be specified by the caller; using TRUE
5: In type.convert.default(X[[i]], ...) :
  'as.is' should be specified by the caller; using TRUE
6: In type.convert.default(X[[i]], ...) :
  'as.is' should be specified by the caller; using TRUE
7: In type.convert.default(X[[i]], ...) :
  'as.is' should be specified by the caller; using TRUE

Following gtex tissues were taken into consideration :

gtex_tissue <- select_gtex_tissues("./vargen_data/GTEx_Analysis_v8_eQTL/", 
                                   c("adipose",
                                     "artery_coronary",
                                     "pancreas", 
                                     "breast", 
                                     "heart", 
                                     "liver",
                                     "stomach",
                                     "lung",
                                     "fibroblasts",
                                     "small_intestine", "whole_blood", "brain"))

Also, when I am not including the gtex tissue in the pipeline I am able to run the pipeline with some warnings but unable to perfrom annotations:

Running Pipeline :

> disease_variants <- vargen_pipeline(vargen_dir = "./vargen_data/", 
+                                     omim_morbid_ids = c("125853",
+                                                         "222100", 
+                                                         "601665", 
+                                                         "604302",
+                                                         "212750",
+                                                         "145500",
+                                                         "603813",
+                                                         "166710",
+                                                         "266600",
+                                                         "610938",
+                                                         "601367",
+                                                         "223100",
+                                                         "600807"),
+                                     gwas_traits = disease_traits, 
+                                     verbose = T)
[1] "Connecting to the gene mart..."
[1] "Connecting to the snp mart..."
[1] "Building the gwascat object..."
[1] "Reading the enhancer tss association file for FANTOM5... './vargen_data//enhancer_tss_associations.bed'"
[1] "Starting the pipeline..."
[1] "Getting genes for OMIM: 125853"
[1] "Getting genes for OMIM: 222100"
[1] "Getting genes for OMIM: 601665"
[1] "Getting genes for OMIM: 604302"
[1] "Getting genes for OMIM: 212750"
[1] "Getting genes for OMIM: 145500"
[1] "Getting genes for OMIM: 603813"
[1] "Getting genes for OMIM: 166710"
[1] "Getting genes for OMIM: 266600"
[1] "Getting genes for OMIM: 610938"
[1] "Getting genes for OMIM: 601367"
[1] "Getting genes for OMIM: 223100"
[1] "Getting genes for OMIM: 600807"
[1] "Writing the list of genes to: .//genes_info.tsv"
[1] "No values for 'gtex_tissues', skipping GTEx step..."
[1] "Getting the gwas variants,,,"
[1] "Writing the variants to .//vargen_variants.tsv"
Warning messages:
1: In vargen_pipeline(vargen_dir = "./vargen_data/", omim_morbid_ids = c("125853",  :
  Gene mart not provided (or not a valid Mart object).We used one from connect_to_gene_ensembl() instead.
2: In vargen_pipeline(vargen_dir = "./vargen_data/", omim_morbid_ids = c("125853",  :
  Snp mart not provided (or not a valid Mart object).We used one from connect_to_snp_ensembl() instead.
3: In type.convert.default(X[[i]], ...) :
  'as.is' should be specified by the caller; using TRUE
4: In type.convert.default(X[[i]], ...) :
  'as.is' should be specified by the caller; using TRUE
5: In type.convert.default(X[[i]], ...) :
  'as.is' should be specified by the caller; using TRUE
6: In type.convert.default(X[[i]], ...) :
  'as.is' should be specified by the caller; using TRUE
7: In type.convert.default(X[[i]], ...) :
  'as.is' should be specified by the caller; using TRUE
8: In (function (seqlevels, genome, new_style)  :
  cannot switch GRCh38's seqlevels from NCBI to UCSC style

Performing annotation:

> disease_annotation <- annotate_variants(disease_variants$rsid, verbose = T)
Error in if (cj == upper) next : missing value where TRUE/FALSE needed
In addition: Warning message:
In (1:g) * nnm : NAs produced by integer overflow

Error on running Vargen pipeline

Hi!
On trying to run the VarGen pipeline as mentioned in the tutorial I am coming across two different error on running it two different times mentioned as follows:

#Error_1

> obesity_variants <- vargen_pipeline(vargen_dir = "./vargen_data/", 
+                                     omim_morbid_ids = "601665", 
+                                     gtex_tissues = adipose_tissues, 
+                                     gwas_traits = obesity_traits, 
+                                     verbose = T)
[1] "Connecting to the gene mart..."
Error in textConnection(bmResult) : invalid 'text' argument

#Error_2

> obesity_variants <- vargen_pipeline(vargen_dir = "./vargen_data/", 
+                                     omim_morbid_ids = "601665", 
+                                     gtex_tissues = adipose_tissues, 
+                                     gwas_traits = obesity_traits, 
+                                     verbose = T)
[1] "Connecting to the gene mart..."
[1] "Connecting to the snp mart..."
[1] "Building the gwascat object..."
[1] "Reading the enhancer tss association file for FANTOM5... './vargen_data//enhancer_tss_associations.bed'"
Error in file(file, "rt") : cannot open the connection
In addition: Warning messages:
1: In vargen_pipeline(vargen_dir = "./vargen_data/", omim_morbid_ids = "601665",  :
  Gene mart not provided (or not a valid Mart object).We used one from connect_to_gene_ensembl() instead.
2: In vargen_pipeline(vargen_dir = "./vargen_data/", omim_morbid_ids = "601665",  :
  Snp mart not provided (or not a valid Mart object).We used one from connect_to_snp_ensembl() instead.
3: In file(file, "rt") :
  cannot open file './vargen_data//enhancer_tss_associations.bed': No such file or directory

GWAS traits - ERROR- unable to find an inherited method for function ‘seqinfo’ for signature ‘"list"’

Dear all,

During the GWAS Traits step I am receiving this error and so far I didn't managed to understand the source of it.

In the vargen_data folder I correctly have the .tsv GWAS catalog : gwas_catalog_v1.0-associations_e108_r2022-11-01.tsv

gwas_cat <- create_gwas("./vargen_data/")
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘seqinfo’ for signature ‘"list"’

Many thanks for the help!

R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.0.1

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats4    stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] vargen_0.2.1                devtools_2.4.5              usethis_2.1.6               data.table_1.14.4          
 [5] myvariant_1.26.0            VariantAnnotation_1.42.1    Rsamtools_2.12.0            Biostrings_2.64.1          
 [9] XVector_0.36.0              SummarizedExperiment_1.26.1 Biobase_2.56.0              MatrixGenerics_1.8.1       
[13] matrixStats_0.62.0          R.utils_2.12.1              R.oo_1.25.0                 R.methodsS3_1.8.2          
[17] rtracklayer_1.56.1          ggplot2_3.4.0               splitstackshape_1.4.8       stringr_1.4.1              
[21] httr_1.4.4                  jsonlite_1.8.3              gwascat_2.28.1              GenomicRanges_1.48.0       
[25] GenomeInfoDb_1.32.4         IRanges_2.30.1              S4Vectors_0.34.0            BiocGenerics_0.42.0        
[29] gtools_3.9.3                biomaRt_2.52.0             

loaded via a namespace (and not attached):
  [1] backports_1.4.1          Hmisc_4.7-1              BiocFileCache_2.4.0      plyr_1.8.7               splines_4.2.1           
  [6] BiocParallel_1.30.4      digest_0.6.30            htmltools_0.5.3          fansi_1.0.3              magrittr_2.0.3          
 [11] checkmate_2.1.0          memoise_2.0.1            BSgenome_1.64.0          cluster_2.1.4            tzdb_0.3.0              
 [16] remotes_2.4.2            readr_2.1.3              prettyunits_1.1.1        jpeg_0.1-9               colorspace_2.0-3        
 [21] blob_1.2.3               rappdirs_0.3.3           xfun_0.34                dplyr_1.0.10             callr_3.7.3             
 [26] crayon_1.5.2             RCurl_1.98-1.9           survival_3.4-0           glue_1.6.2               gtable_0.3.1            
 [31] zlibbioc_1.42.0          DelayedArray_0.22.0      pkgbuild_1.3.1           scales_1.2.1             DBI_1.1.3               
 [36] miniUI_0.1.1.1           Rcpp_1.0.9               xtable_1.8-4             progress_1.2.2           htmlTable_2.4.1         
 [41] foreign_0.8-83           bit_4.0.4                Formula_1.2-4            profvis_0.3.7            htmlwidgets_1.5.4       
 [46] RColorBrewer_1.1-3       ellipsis_0.3.2           urlchecker_1.0.1         pkgconfig_2.0.3          XML_3.99-0.12           
 [51] nnet_7.3-18              dbplyr_2.2.1             deldir_1.0-6             utf8_1.2.2               tidyselect_1.2.0        
 [56] rlang_1.0.6              later_1.3.0              AnnotationDbi_1.58.0     munsell_0.5.0            tools_4.2.1             
 [61] cachem_1.0.6             cli_3.4.1                generics_0.1.3           RSQLite_2.2.18           fastmap_1.1.0           
 [66] yaml_2.3.6               processx_3.8.0           knitr_1.40               bit64_4.0.5              fs_1.5.2                
 [71] purrr_0.3.5              KEGGREST_1.36.3          mime_0.12                xml2_1.3.3               compiler_4.2.1          
 [76] rstudioapi_0.14          filelock_1.0.2           curl_4.3.3               png_0.1-7                tibble_3.1.8            
 [81] stringi_1.7.8            ps_1.7.2                 GenomicFeatures_1.48.4   lattice_0.20-45          Matrix_1.5-1            
 [86] vctrs_0.5.0              pillar_1.8.1             lifecycle_1.0.3          BiocManager_1.30.19      snpStats_1.46.0         
 [91] bitops_1.0-7             httpuv_1.6.6             R6_2.5.1                 BiocIO_1.6.0             latticeExtra_0.6-30     
 [96] promises_1.2.0.1         gridExtra_2.3            sessioninfo_1.2.2        codetools_0.2-18         assertthat_0.2.1        
[101] pkgload_1.3.1            rjson_0.2.21             withr_2.5.0              GenomicAlignments_1.32.1 GenomeInfoDbData_1.2.8  
[106] parallel_4.2.1           hms_1.1.2                grid_4.2.1               rpart_4.1.19             shiny_1.7.3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.