Skip to content

Commit

Permalink
minor edit
Browse files Browse the repository at this point in the history
  • Loading branch information
mmkim1210 committed Jan 29, 2022
1 parent 692c5a3 commit 186ee00
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 111 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
**/.DS_Store
/data
/etc.
/docs/Manifest.toml
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ using Pkg
Pkg.activate(@__DIR__)
Pkg.add(["GeneticsMakie", "CairoMakie", "Makie", "CSV", "DataFrames", "SnpArrays"])

using GeneticsMakie, CairoMakie, Makie.GeometryBasics, CSV, DataFrames, SnpArrays, Statistics
using GeneticsMakie, CairoMakie, Makie.GeometryBasics, CSV, DataFrames, SnpArrays, Statistics, Downloads

const GM = GeneticsMakie
CairoMakie.activate!(type = "png")
Expand All @@ -31,7 +31,7 @@ gencode = let
url = "https://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_39/GRCh37_mapping/gencode.v39lift37.annotation.gtf.gz"
file = basename(url)
isdir("data/gencode") || mkdir("data/gencode")
isfile("data/gencode/$(file)") || download(url, "data/gencode/$(file)")
isfile("data/gencode/$(file)") || Downloads.download(url, "data/gencode/$(file)")
h = ["seqnames", "source", "feature", "start", "end", "score", "strand", "phase", "info"]
CSV.read("data/gencode/$(file)", DataFrame; delim = "\t", comment = "#", header = h)
end
Expand Down Expand Up @@ -162,13 +162,13 @@ kgp = let
url = joinpath(beagle, "b37.vcf/chr$(chr).1kg.phase3.v5a.vcf.gz")
vcf = basename(url)
isdir("data/1kg") || mkdir("data/1kg")
isfile("data/1kg/$(vcf)") || download(url, "data/1kg/$(vcf)")
isfile("data/1kg/$(vcf)") || Downloads.download(url, "data/1kg/$(vcf)")
# Convert vcf file to plink bed file (this step takes a while)
isfile("data/1kg/$(replace(vcf, ".vcf.gz" => ".bed"))") || vcf2plink("data/1kg/$(vcf)", "data/1kg/$(replace(vcf, ".vcf.gz" => ""))")
# Download sample metadata
url = joinpath(beagle, "sample_info/integrated_call_samples_v3.20130502.ALL.panel")
meta = basename(url)
isfile("data/1kg/$(meta)") || download(url, "data/1kg/$(meta)")
isfile("data/1kg/$(meta)") || Downloads.download(url, "data/1kg/$(meta)")
# Subset data to the genomic region of interest and European samples
kgp = SnpData("data/1kg/$(replace(vcf, ".vcf.gz" => ""))")
meta = CSV.read("data/1kg/$(meta)", DataFrame)
Expand Down Expand Up @@ -244,7 +244,7 @@ gwas = let
url = gwas[key][1]
file = gwas[key][2]
isdir("data/gwas") || mkdir("data/gwas")
isfile("data/gwas/$(file)") || download(url, "data/gwas/$(file)")
isfile("data/gwas/$(file)") || Downloads.download(url, "data/gwas/$(file)")
end
scz = CSV.read("data/gwas/$(gwas["scz"][2])", DataFrame; comment = "##", missingstring = ["NA"])
bd = CSV.read("data/gwas/$(gwas["bd"][2])", DataFrame; comment = "##", missingstring = ["NA"])
Expand Down
97 changes: 0 additions & 97 deletions docs/Manifest.toml

This file was deleted.

6 changes: 3 additions & 3 deletions docs/src/examples/gtf.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ the human genome (GRCh37), where we download the comprehensive
gene annotation file in [GTF format](https://www.gencodegenes.org/pages/data_format.html).

```julia
using GeneticsMakie, CSV, DataFrames
using GeneticsMakie, CSV, DataFrames, Downloads
isdir("data") || mkdir("data")
url = "https://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_39/GRCh37_mapping/gencode.v39lift37.annotation.gtf.gz"
file = basename(url)
isdir("data/gencode") || mkdir("data/gencode")
isfile("data/gencode/$(file)") || download(url, "data/gencode/$(file)")
isfile("data/gencode/$(file)") || Downloads.download(url, "data/gencode/$(file)")
h = ["seqnames", "source", "feature", "start", "end", "score", "strand", "phase", "info"]
gencode = CSV.read("data/gencode/$(file)", DataFrame; delim = "\t", comment = "#", header = h)
```
Expand Down Expand Up @@ -54,4 +54,4 @@ GeneticsMakie.findgene("RBFOX1", gencode)

!!! tip "Gene names"
Make sure to use the correct gene name in case the gene cannot be found.
Gene names can be looked up in databases such as [GeneCards](https://www.genecards.org/).
The latest gene names can be looked up in databases such as [GeneCards](https://www.genecards.org/).
6 changes: 3 additions & 3 deletions docs/src/examples/locus.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@ Pkg.add("SnpArrays")
```

```julia
using SnpArrays
using SnpArrays, Downloads
# Download 1000 Genomes data for a single chromosome
beagle = "http://bochet.gcc.biostat.washington.edu/beagle/1000_Genomes_phase3_v5a"
url = joinpath(beagle, "b37.vcf/chr$(chr).1kg.phase3.v5a.vcf.gz")
vcf = basename(url)
isdir("data/1kg") || mkdir("data/1kg")
isfile("data/1kg/$(vcf)") || download(url, "data/1kg/$(vcf)")
isfile("data/1kg/$(vcf)") || Downloads.download(url, "data/1kg/$(vcf)")
# Convert vcf file to plink bed file (this step takes a while)
isfile("data/1kg/$(replace(vcf, ".vcf.gz" => ".bed"))") || vcf2plink("data/1kg/$(vcf)", "data/1kg/$(replace(vcf, ".vcf.gz" => ""))")
# Download sample metadata
url = joinpath(beagle, "sample_info/integrated_call_samples_v3.20130502.ALL.panel")
meta = basename(url)
isfile("data/1kg/$(meta)") || download(url, "data/1kg/$(meta)")
isfile("data/1kg/$(meta)") || Downloads.download(url, "data/1kg/$(meta)")
# Subset data to the genomic region of interest and European samples
kgp = SnpData("data/1kg/$(replace(vcf, ".vcf.gz" => ""))")
meta = CSV.read("data/1kg/$(meta)", DataFrame)
Expand Down
4 changes: 2 additions & 2 deletions docs/src/examples/summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Pkg.add(["GeneticsMakie", "CSV", "DataFrames"])
```

```julia
using GeneticsMakie, CSV, DataFrames
using GeneticsMakie, CSV, DataFrames, Downloads
gwas = Dict(
"height" => "https://portals.broadinstitute.org/collaboration/giant/images/6/63/Meta-analysis_Wood_et_al%2BUKBiobank_2018.txt.gz",
"weight" => "https://portals.broadinstitute.org/collaboration/giant/images/c/c8/Meta-analysis_Locke_et_al%2BUKBiobank_2018_UPDATED.txt.gz"
Expand All @@ -18,7 +18,7 @@ isdir("data/gwas") || mkdir("data/gwas")
df = DataFrame[]
for key in keys(gwas)
url = gwas[key]
isfile("data/gwas/$(basename(url))") || download(url, "data/gwas/$(basename(url))")
isfile("data/gwas/$(basename(url))") || Downloads.download(url, "data/gwas/$(basename(url))")
push!(df, CSV.read("data/gwas/$(basename(url))", DataFrame; comment = "##", missingstring = ["NA"]))
end
```
Expand Down
1 change: 0 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using GeneticsMakie
using Test
using CairoMakie
using Makie.GeometryBasics
using CSV
using DataFrames
using SnpArrays
Expand Down

0 comments on commit 186ee00

Please sign in to comment.