@@ -946,49 +946,28 @@ eliminate_GRanges_metadata_columns_also_present_in_Rowdata <- function(.my_data,
946946}
947947
948948subset_tibble_output <- function (.data , count_info , sample_info , gene_info , range_info , .subset ) {
949-
950- . <- NULL
951-
952- # This function outputs a tibble after subsetting the columns
953- .subset <- enquo(.subset )
954-
955- # Build template of the output
956- output_colnames <-
957- slice(count_info , 0 ) %> %
958- left_join(slice(sample_info , 0 ), by = s_(.data )$ name ) %> %
959- left_join(slice(gene_info , 0 ), by = f_(.data )$ name ) %> %
960- when(nrow(range_info ) > 0 ~ (. ) %> % left_join(range_info , by = f_(.data )$ name ), ~ (. )) %> %
961- select(!! .subset ) %> %
962- colnames()
963-
964-
965- # Sample table
966- sample_info <-
967- sample_info %> %
968- when(
969- colnames(. ) %> % intersect(output_colnames ) %> % length() %> % equals(0 ) ~ NULL ,
970- select(. , one_of(s_(.data )$ name , output_colnames )) %> %
971- suppressWarnings()
972- )
973-
974- # Ranges table
975- range_info <-
976- range_info %> %
977- when(
978- colnames(. ) %> % intersect(output_colnames ) %> % length() %> % equals(0 ) ~ NULL ,
979- select(. , one_of(f_(.data )$ name , output_colnames )) %> %
980- suppressWarnings()
981- )
982-
983- # Ranges table
984- gene_info <-
985- gene_info %> %
986- when(
987- colnames(. ) %> % intersect(output_colnames ) %> % length() %> % equals(0 ) ~ NULL ,
988- select(. , one_of(f_(.data )$ name , output_colnames )) %> %
989- suppressWarnings()
990- )
991-
949+ # This function outputs a tibble after subsetting the columns
950+ .subset <- enquo(.subset )
951+
952+ # Build template of the output
953+ output_colnames <-
954+ slice(count_info , 0 ) %> %
955+ left_join(slice(sample_info , 0 ), by = s_(.data )$ name ) %> %
956+ left_join(slice(gene_info , 0 ), by = f_(.data )$ name ) %> %
957+ when(nrow(range_info ) > 0 ~ (. ) %> % left_join(range_info , by = f_(.data )$ name ), ~ (. )) %> %
958+ select(!! .subset ) %> %
959+ colnames()
960+
961+
962+ # Sample table
963+ sample_info <-
964+ sample_info %> %
965+ when(
966+ colnames(. ) %> % intersect(output_colnames ) %> % length() %> % equals(0 ) ~ NULL ,
967+ select(. , one_of(s_(.data )$ name , output_colnames )) %> %
968+ suppressWarnings()
969+ )
970+
992971 # Ranges table
993972 range_info <-
994973 range_info %> %
0 commit comments