create_PAC: Wrapper for creation of PAC object

View source: R/create_PAC.R

create_PACR Documentation

Wrapper for creation of PAC object

Description

create_PAC Merges lanes, performs adaptor trimming and makes a first PAC object with count and basic phenotypic information

Usage

create_PAC(lanes = NULL, trim = NULL, input, output = NULL)

Arguments

lanes

allows to define whether lanes should be merged with merge_lanes (may be necessary after using e.g BaseSpace to download fasta files from Illumina cloud). Default=NULL, where no lane merging will be performed.

trim

Character vector to define whether trimming of adaptors should be performed. Current accepted values are "default_neb" and "default_illumina", trimming adaptors from library preparation with NebNext or Illumina technologies respectively. More advanced and manual adaptor trimming is possible with make_trim. Default=NULL, where no adaptor trimming will be performed.

input

Character indicating path to where input files can be found in fasta or fastq format. Depending on value of lanes and trim, the function assumes whether to expect files in path to be trimmed or not and whether to merge lanes.

output

Character indicating path to where output files will be stored, if applicable (such as in merge_lanes). Default=NULL.

Details

Given (at minimum) an path to input files to be analyzed, create_PAC will wrap around all necessary preparatory steps (merge_lanes, make_counts, and make_PAC) to produce a PAC object. This wrapper comes with the caveat that it uses default values in most functions. If that does not suit your analysis, we recommend you to run each function on its own!

Value

PAC object with values in pheno and count

See Also

https://github.com/Danis102 for updates on the current package.

Other PAC generation: PAC_check(), make_PAC(), make_counts(), make_cutadapt(), make_pheno(), make_trim(), merge_lanes()

Examples


###########################################################
### test the map_rangetype function
# More complicated examples can be found in the vignette.
##----------------------------------------

# First create an annotation blank PAC with group means
sys_path = system.file("extdata", package = "seqpac", mustWork = TRUE)
fq <- list.files(path = sys_path, pattern = "fastq", all.files = FALSE,
                full.names = TRUE)
 
# Create an output folder
input <- paste0(tempdir(), "/lanes/")
output <- paste0(tempdir(), "/merged/")
dir.create(input, showWarnings=FALSE)
dir.create(output, showWarnings=FALSE)

# Fix compatible file names
file.copy(from = fq, to = input)
old_fls <- list.files(input, full.names=TRUE)
new_sample <- c(rep("sample1_", times=3), rep("sample2_", times=3))
new_lane <- rep(c("lane1","lane2","lane3"), times=2)
new_fls <- paste0(input,new_sample, new_lane, ".fastq.gz")
file.rename(from = old_fls, to = new_fls)

# Then merge the fastq files
pac <- create_PAC(lanes=TRUE, trim="default_neb", input, output)



Danis102/seqpac documentation built on Aug. 26, 2023, 10:15 a.m.