Skip to content

Commit

Permalink
Revert "Add steps for saving annotation db"
Browse files Browse the repository at this point in the history
This reverts commit 36cbb2b.
  • Loading branch information
jaclyn-taroni committed Nov 9, 2019
1 parent eb183ae commit b0f3615
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 25 deletions.
2 changes: 0 additions & 2 deletions analyses/focal-cn-file-preparation/.gitignore

This file was deleted.

28 changes: 5 additions & 23 deletions analyses/focal-cn-file-preparation/01-prepare-cn-file.R
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,6 @@ if (!dir.exists(results_dir)) {
dir.create(results_dir)
}

# this is the output of GenomicFeatures::makeTxDbFromGFF
# TODO: possibly update this when the GTF file gets included in the data
# download; may also remove the --gtf_file option and hardcode it?
annotation_directory <- file.path(root_dir,
"analyses",
"focal-cn-file-preparation",
"annotation_files")
annotation_file <- file.path(annotation_directory,
"txdb_from_gencode.v27.gtf.db")

#### Format CNV file and overlap with hg38 genome annotations ------------------

# we want to standardize the formats between the two methods here and drop
Expand Down Expand Up @@ -177,19 +167,11 @@ cnv_no_xy_gr <- cnv_no_xy %>%
GenomicRanges::makeGRangesFromDataFrame(keep.extra.columns = TRUE,
starts.in.df.are.0based = FALSE)

if (!file.exists(annotation_file)) {
# Define the annotations for the hg38 genome
txdb <- GenomicFeatures::makeTxDbFromGFF(
file = opt$gtf_file,
format = "gtf"
)
# can do this even if the directory exists
dir.create(annotation_directory, showWarnings = FALSE)
# write this to file to save time next time
AnnotationDbi::saveDb(txdb, annotation_file)
} else {
txdb <- AnnotationDbi::loadDb(annotation_file)
}
# Define the annotations for the hg38 genome
txdb <- GenomicFeatures::makeTxDbFromGFF(
file = opt$gtf_file,
format = "gtf"
)

# if the chromosome filter is on, then we will only look at exons on chr 1:22
if (chrom_filter) {
Expand Down

0 comments on commit b0f3615

Please sign in to comment.