-
Notifications
You must be signed in to change notification settings - Fork 0
/
_targets.R
56 lines (41 loc) · 1.42 KB
/
_targets.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
## Load your packages, e.g. library(targets).
source("./packages.R")
## Load your R files
lapply(list.files("./R", full.names = TRUE), source)
## tar_plan supports drake-style targets and also tar_target()
tar_plan(
# INPUT FILES
###################################################
# The path to the gtf file
tar_file(gtf_file,
here::here("data", "genomic.gtf")),
# The path to the transcriptome file
tar_file(transcriptome_file,
here::here("data", "transcriptome.fa")),
tar_file(bam_file,
here::here("data", "alignment.bam")),
# Genome file
tar_file(genome_file,
here::here("data", "genome.fna")),
# Make seq length files
tar_file(bam_length_file,
make_bam_length_file(bam_file)),
tar_file(transcriptome_length, file,
make_transcript_length_file(transcriptome_file)),
# GET seq lengths
# Get sequence lengths from the bam and transcriptome files
tar_target(bam_lengths,
get_bam_lengths(bam_length_file)),
# Transcriptome lengths
tar_target(transcriptome_lengths,
get_transcript_lengths(transcriptome_length_file)),
# Identify transcripts with different lengths
tar_file(problem_transcripts,
identify_problem_transcripts(bam_lengths, transcriptome_lengths)),
# Subset the gtf file based to remove the problem transcripts
tar_file(subset_gtf,
remove_problem_transcripts(problem_transcripts, gtf_file))
# Make a new transcriptome file using this new gtf file
tar_file(new_transcriptome,
make_new_transcriptome(subset_gtf, genome_file))
)