Skip to content

Commit

Permalink
Update tests and fetch_uniprot
Browse files Browse the repository at this point in the history
  • Loading branch information
jpquast committed Oct 25, 2024
1 parent 17a2ed6 commit abf7be4
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

* `assign_peptide_type` now takes the `start` argument, containing the start position of a peptide. If a protein does not have any peptide starting at position `1` and there is a peptide starting at position `2`, this peptide will be considered "tryptic" at the N-terminus. This is because the initial Methionine is likely missing due to processing for every copy of the protein and therefore position `2` is the true N-terminus.
* `extract_metal_binders()` now uses keywords from UniProt as well. In addition, only "enables" GO terms are considered now.
*
* `fetch_uniprot()` received another default column "keyword".

# protti 0.9.1

## Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion R/barcode_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ barcode_plot <- function(data,
xmin = ({{ start_position }} - 1) / {{ protein_length }} * 100,
fill = {{ colouring }}
),
size = 0.7
linewidth = 0.7
) +
{
if (is.numeric(dplyr::pull(data, {{ colouring }}))) {
Expand Down
3 changes: 2 additions & 1 deletion R/fetch_uniprot.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ fetch_uniprot <-
"ft_binding",
"cc_cofactor",
"cc_catalytic_activity",
"xref_pdb"
"xref_pdb",
"keyword"
),
batchsize = 200,
max_tries = 10,
Expand Down
3 changes: 2 additions & 1 deletion man/extract_metal_binders.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/fetch_uniprot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions tests/testthat/test-fetch_extract_and_enrichment_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if (Sys.getenv("TEST_PROTTI") == "true") {
expect_warning(uniprot <- fetch_uniprot(unis))
expect_is(uniprot, "data.frame")
expect_equal(nrow(uniprot), 9)
expect_equal(ncol(uniprot), 17)
expect_equal(ncol(uniprot), 18)
})

proteome <- fetch_uniprot_proteome(organism_id = "83333", columns = c("accession", "go_f", "xref_string"))
Expand Down Expand Up @@ -481,7 +481,8 @@ if (Sys.getenv("TEST_PROTTI") == "true") {
columns = c(
"ft_binding",
"cc_cofactor",
"cc_catalytic_activity"
"cc_catalytic_activity",
"keyword"
)
)

Expand All @@ -495,7 +496,7 @@ if (Sys.getenv("TEST_PROTTI") == "true") {
)

expect_is(metal_info, "data.frame")
expect_equal(ncol(metal_info), 20)
expect_equal(ncol(metal_info), 21)
expect_equal(nrow(metal_info), 35)
})

Expand Down

0 comments on commit abf7be4

Please sign in to comment.