Skip to content

Commit 8471bce

Browse files
committed
2 parents b1bb37a + c60259a commit 8471bce

File tree

7 files changed

+95
-47
lines changed

7 files changed

+95
-47
lines changed

.github/workflows/test-coverage.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
33
on:
44
push:
5-
branches: [main, master]
5+
branches: [main, master, documentation]
66
pull_request:
7-
branches: [main, master]
7+
branches: [main, master, documentation]
88

99
name: test-coverage
1010

@@ -44,7 +44,7 @@ jobs:
4444

4545
- name: Upload test results
4646
if: failure()
47-
uses: actions/upload-artifact@v3
47+
uses: actions/upload-artifact@v4
4848
with:
4949
name: coverage-test-failures
5050
path: ${{ runner.temp }}/package

DESCRIPTION

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
Package: bppg
22
Title: Bipartite peptide-protein graphs
33
Version: 0.0.0.9000
4-
Authors@R:
4+
Authors@R: c(
55
person("Karin", "Schork", , "[email protected]", role = c("aut", "cre"),
6-
comment = c(ORCID = "0000-0003-3756-4347"))
6+
comment = c(ORCID = "0000-0003-3756-4347")),
7+
person("Katharina", "Neuhaus", , "[email protected]", role = c("aut")))
78
Description: Functionality to create and characterize bipartite graphs that
89
show the relationship between peptides and proteins in bottom-up proteomics.
910
License: BSD_3_clause + file LICENSE

R/generate_graphs_from_FASTA.R

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
#' Generate graphs from a FASTA file
22
#'
3-
#' @param fasta fasta file, already read into R by seqinr::read.fasta
4-
#' @param collapse_protein_nodes collapse protein nodes?
5-
#' @param collapse_peptide_nodes collapse peptide nodes?
6-
#' @param result_path path where results are saved. If NULL, results are not saved
7-
#' @param suffix suffix for saving results
8-
#' @param save_intermediate Save intermediate results?
9-
#' @param ... additional arguments to bppg::digest_fasta()
10-
#' @param prot_origin origin of protein, e.g. organism etc.
3+
#' @param fasta \strong{list of vector of chars} \cr
4+
#' A fasta file, already read into R by seqinr::read.fasta().
5+
#' @param collapse_protein_nodes \strong{logical} \cr
6+
#' If \code{TRUE}, the protein nodes will be collapsed.
7+
#' @param collapse_peptide_nodes \strong{logical} \cr
8+
#' If \code{TRUE}, the peptide nodes will be collapsed.
9+
#' @param result_path \strong{character} \cr
10+
#' The path where results are saved. If \code{NULL}, results are not saved.
11+
#' @param suffix \strong{character} \cr
12+
#' The suffix for saving results.
13+
#' @param save_intermediate \strong{logical} \cr
14+
#' If \code{TRUE}, the intermediate results will also be saved.
15+
#' @param prot_origin \strong{character vector} \cr
16+
#' The origin of protein, e.g. organism etc.
17+
#' @param ... Additional arguments to bppg::digest_fasta()
1118
#'
1219
#' @return subgraphs (i.e. connected components) from the graph generated from the FASTA file.
1320
#' @export
@@ -18,10 +25,13 @@
1825
#' fasta <- seqinr::read.fasta(file = file, seqtype = "AA", as.string = TRUE)
1926
#' graphs <- bppg::generate_graphs_from_FASTA(fasta)
2027
#'
21-
generate_graphs_from_FASTA <- function(fasta, collapse_protein_nodes = TRUE,
28+
29+
generate_graphs_from_FASTA <- function(fasta,
30+
collapse_protein_nodes = TRUE,
2231
collapse_peptide_nodes = TRUE,
2332
result_path = NULL,
24-
suffix = NULL, save_intermediate = FALSE,
33+
suffix = NULL,
34+
save_intermediate = FALSE,
2535
prot_origin = NULL,
2636
...) {
2737

R/generate_graphs_from_quantdata.R

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,38 @@
1-
#' Generate graphs from peptide ratio table, using an edgelist calculated on the fasta file
1+
#' Generate graphs from peptide ratio table, using an edgelist calculated on the fasta file.
22
#'
3-
#' @param peptide_ratios table with peptide ratios
4-
#' @param id_cols columns with ids, e.g. peptide sequences (everything except the peptide ratios)
5-
#' @param fasta_edgelist Edgelist created from the corresponding FASTA file
6-
#' @param outpath output path
7-
#' @param seq_column column name of the peptide sequence
8-
#' @param collapse_protein_nodes if TRUE protein nodes will be collapsed
9-
#' @param collapse_peptide_nodes if TRUE, peptide nodes will be collapsed
10-
#' @param suffix suffix for output files
3+
#' @param peptide_ratios \strong{data.frame} \cr
4+
#' A table with peptide ratios.
5+
#' @param id_cols \strong{integer vector} \cr
6+
#' The columns with ids, e.g. peptide sequences (everything except the peptide ratios)
7+
#' @param fasta_edgelist \strong{data.frame} \cr
8+
#' An edgelist created from the corresponding FASTA file, eg. created with [generate_edgelist()].
9+
#' @param outpath \strong{character} \cr
10+
#' The output path for the results.
11+
#' @param seq_column \strong{character} \cr
12+
#' The column name of the peptide sequence.
13+
#' @param collapse_protein_nodes \strong{logical} \cr
14+
#' If \code{TRUE}, the protein nodes will be collapsed.
15+
#' @param collapse_peptide_nodes \strong{logical} \cr
16+
#' If \code{TRUE}, the peptide nodes will be collapsed.
17+
#' @param suffix \strong{character} \cr
18+
#' The suffix for saving results.
1119
#'
12-
#' @return list of list of subgraphs
20+
#' @return A list of list of subgraphs
1321
#' @export
1422
#'
15-
#' @examples # TODO
16-
generate_quant_graphs <- function(peptide_ratios, id_cols = 1, fasta_edgelist, outpath = NULL, seq_column = "Sequence",
17-
collapse_protein_nodes = TRUE, collapse_peptide_nodes = FALSE, suffix = "") {
23+
#' @seealso [generate_edgelist()]
24+
#'
25+
#' @examples
26+
#'
27+
28+
generate_quant_graphs <- function(peptide_ratios,
29+
id_cols = 1,
30+
fasta_edgelist,
31+
outpath = NULL,
32+
seq_column = "Sequence",
33+
collapse_protein_nodes = TRUE,
34+
collapse_peptide_nodes = FALSE,
35+
suffix = "") {
1836

1937
### broad filtering for edgelist for only quantifies peptides
2038
edgelist_filtered <- fasta_edgelist[fasta_edgelist[,2] %in% peptide_ratios[,seq_column], ]

bppg.Rproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Version: 1.0
2+
ProjectId: 0c04aeda-ae5b-4b31-800f-043d497776fc
23

34
RestoreWorkspace: No
45
SaveWorkspace: No

man/generate_graphs_from_FASTA.Rd

Lines changed: 15 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/generate_quant_graphs.Rd

Lines changed: 22 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)