Function requires the path to the individual count files and the samples to be included in the matrix. Files will be read based on the sample they represent the values from the different files are merged into a matrix and returned

prep_RNAseq_matrix(path_to_counts, selected_samples)

Arguments

path_to_counts

Path to the individual RNAseq count files

selected_samples

The samples to be read

Value

final_counts The formatted count matrix

Examples

path <- tempfile()
bfc <- BiocFileCache(path, ask = FALSE)
bfc_cache<-slot(bfc,'cache')
write_example_data_to_dir(target_dir=bfc_cache)
my_path_data<-paste0(bfc_cache,'/data/PBMC/raw_counts_TS')
my_path_sample_dta<-paste0(bfc_cache,'/data/PBMC/sample_file.csv')
graph_vect<-c("#e31a1c","#1f78b4")

TS_object <- new('TimeSeries_Object',
                 group_names=c('IgM','LPS'),group_colors=graph_vect,DE_method='DESeq2',
                 DE_p_filter='padj',DE_p_thresh=0.05,DE_l2fc_thresh=1,
                 PART_l2fc_thresh=4,sem_sim_org='org.Hs.eg.db',Gpro_org='hsapiens')

TS_object <- add_experiment_data(TS_object,sample_dta_path=my_path_sample_dta,count_dta_path=my_path_data)
groups<-slot(TS_object,'group_names')
#Ensures that the order will follow the grouping order
sample_data<-exp_sample_data(TS_object)
selected_samples_1<-sample_data$sample[sample_data$group %in% groups[1]]
selected_samples_2<-sample_data$sample[sample_data$group %in% groups[2]]
selected_samples<-c(selected_samples_1,selected_samples_2)

#Prepare the matrix according to the differential expression method (affects input)
 final_counts<-prep_RNAseq_matrix(my_path_data,selected_samples)