Skip to contents

This function compares the original input tibble and the updated tibble, identifying and reporting any changes in the specified columns (`entry_name`, `protein_name`, `gene_name`).

Usage

compare_tibbles_uniprot(
  original_tibble,
  updated_tibble,
  entry_name_col = "entry_name",
  protein_name_col = "protein_name",
  gene_name_col = "gene_name"
)

Arguments

original_tibble

The original tibble before processing.

updated_tibble

The tibble returned after processing.

entry_name_col

The column name for entry names (default: "entry_name").

protein_name_col

The column name for protein names (default: "protein_name").

gene_name_col

The column name for gene names (default: "gene_name").

Value

None. Prints the differences between the tibbles.

Examples

# Example usage:
# \donttest{
# Original input tibble
input_data <- tibble::tibble(
  id = c(1, 2),
  species = c("mouse", "rat"),
  sample_type = c("brain", "liver"),
  accession = c("O88737", "Q9R064"),
  accession_source = c("UniProt", "UniProt")
)

# Process the tibble (this will add the entry_name, protein_name, and gene_name)
processed_data <- process_tibble_uniprot(input_data)
#> Processing accession: O88737
#>  Sending request to UniProt for accession: O88737
#>  Successfully retrieved data for O88737
#>  Parsing UniProt data...
#>  Entry name retrieved: BSN_MOUSE
#>  Protein name retrieved: Protein bassoon
#>  Gene name retrieved: Bsn
#>  Parsing completed.
#> Data updated for row 1
#> Processing accession: Q9R064
#>  Sending request to UniProt for accession: Q9R064
#>  Successfully retrieved data for Q9R064
#>  Parsing UniProt data...
#>  Entry name retrieved: GORS2_RAT
#>  Protein name retrieved: Golgi reassembly-stacking protein 2
#>  Gene name retrieved: Gorasp2
#>  Parsing completed.
#> Data updated for row 2
#>  Processing completed for all rows.

# Compare the original and processed tibbles
compare_tibbles_uniprot(input_data, processed_data)
#> Row 1: entry_name updated from NA to BSN_MOUSE
#> Row 1: protein_name updated from NA to Protein bassoon
#> Row 1: gene_name updated from NA to Bsn
#> Row 2: entry_name updated from NA to GORS2_RAT
#> Row 2: protein_name updated from NA to Golgi reassembly-stacking protein 2
#> Row 2: gene_name updated from NA to Gorasp2
#> Comparison completed.
#> [1] "Row 1: entry_name updated from NA to BSN_MOUSE"                            
#> [2] "Row 1: protein_name updated from NA to Protein bassoon"                    
#> [3] "Row 1: gene_name updated from NA to Bsn"                                   
#> [4] "Row 2: entry_name updated from NA to GORS2_RAT"                            
#> [5] "Row 2: protein_name updated from NA to Golgi reassembly-stacking protein 2"
#> [6] "Row 2: gene_name updated from NA to Gorasp2"                               
#> [7] "Comparison completed."                                                     
# }