diff --git a/NAMESPACE b/NAMESPACE index cfaaf650..fe4c23d6 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -4,7 +4,6 @@ export(BinaryDomainNetwork) export(GCA2Lineage) export(GenContextNetwork) export(IPG2Lineage) -export(RepresentativeAccNums) export(acc2FA) export(acc2Lineage) export(acc2fa) @@ -12,8 +11,6 @@ export(addLeaves2Alignment) export(addLineage) export(addName) export(addTaxID) -export(add_leaves) -export(add_name) export(advanced_opts2est_walltime) export(alignFasta) export(assign_job_queue) @@ -31,11 +28,11 @@ export(convert2TitleCase) export(convertAlignment2FA) export(convertAlignment2Trees) export(convertFA2Tree) -export(convert_aln2fa) export(countByColumn) export(createFA2Tree) export(createJobResultsURL) export(createJobStatusEmailMessage) +export(createRepresentativeAccNum) export(createWordCloud2Element) export(createWordCloudElement) export(create_lineage_lookup) @@ -49,15 +46,13 @@ export(findParalogs) export(formatJobArgumentsHTML) export(gc_undirected_network) export(generateAllAlignments2FA) -export(generate_all_aln2fa) export(generate_msa) +export(getAccNumFromFA) export(getTopAccByLinDomArch) -export(get_accnums_from_fasta_file) export(get_proc_medians) export(get_proc_weights) export(make_opts2procs) export(mapAcc2Name) -export(map_acc2name) export(map_advanced_opts2procs) export(msa_pdf) export(plotIPR2Viz) @@ -83,14 +78,14 @@ export(removeTails) export(renameFA) export(rename_fasta) export(replaceQuestionMarks) -export(reveql) -export(reverse_operon) +export(reverseOperonSeq) export(run_deltablast) export(run_rpsblast) export(selectLongestDuplicate) export(sendJobStatusEmail) export(shortenLineage) export(sinkReset) +export(straightenOperonSeq) export(summarizeByLineage) export(summarizeDomArch) export(summarizeDomArch_ByLineage) @@ -98,11 +93,10 @@ export(summarizeGenContext) export(summarizeGenContext_ByDomArchLineage) export(summarizeGenContext_ByLineage) export(themeGenes2) -export(to_titlecase) export(totalGenContextOrDomArchCounts) export(validateCountDF) export(wordcloud3) -export(write.MsaAAMultipleAlignment) +export(writeMSA_AA2FA) export(write_proc_medians_table) export(write_proc_medians_yml) importFrom(Biostrings,AAStringSet) diff --git a/R/CHANGED-pre-msa-tree.R b/R/CHANGED-pre-msa-tree.R index c4a97589..2f6c8a62 100644 --- a/R/CHANGED-pre-msa-tree.R +++ b/R/CHANGED-pre-msa-tree.R @@ -54,7 +54,7 @@ convert2TitleCase <- function(x, y = " ") { ################################ ## Function to add leaves to an alignment file ## !! Add DA to leaves? -#' Adding Leaves to an alignment file w/ accessions +#' addLeaves2Alignment #' #' @author Janani Ravi #' @keywords alignment, accnum, leaves, lineage, species @@ -178,7 +178,7 @@ addLeaves2Alignment <- function(aln_file = "", } -#' Add Name +#' addName #' #' @author Samuel Chen, Janani Ravi #' @description This function adds a new 'Name' column that is comprised of components from @@ -252,7 +252,7 @@ addName <- function(data, ################################ ## Function to convert alignment 'aln' to fasta format for MSA + Tree -#' Adding Leaves to an alignment file w/ accessions +#' convertAlignment2FA #' #' @author Janani Ravi #' @keywords alignment, accnum, leaves, lineage, species @@ -320,6 +320,9 @@ convertAlignment2FA <- function(aln_file = "", return(fasta) } +#' mapAcc2Name +#' +#' @description #' Default renameFA() replacement function. Maps an accession number to its name #' #' @param line The line of a fasta file starting with '>' @@ -382,6 +385,9 @@ renameFA <- function(fa_path, outpath, ################################ ## generateAllAlignments2FA +#' generateAllAlignments2FA +#' +#' @description #' Adding Leaves to an alignment file w/ accessions #' #' @keywords alignment, accnum, leaves, lineage, species @@ -441,10 +447,11 @@ generateAllAlignments2FA <- function(aln_path = here("data/rawdata_aln/"), # accessions <- c("P12345","Q9UHC1","O15530","Q14624","P0DTD1") # accessions <- rep("ANY95992.1", 201) -#' acc2FA converts protein accession numbers to a fasta format. +#' acc2FA #' #' @description -#' Resulting fasta file is written to the outpath. +#' converts protein accession numbers to a fasta format. Resulting +#' fasta file is written to the outpath. #' #' @author Samuel Chen, Janani Ravi #' @keywords accnum, fasta @@ -539,6 +546,9 @@ acc2FA <- function(accessions, outpath, plan = "sequential") { return(result) } +#' createRepresentativeAccNum +#' +#' @description #' Function to generate a vector of one Accession number per distinct observation from 'reduced' column #' #' @author Samuel Chen, Janani Ravi @@ -556,7 +566,7 @@ acc2FA <- function(accessions, outpath, plan = "sequential") { #' @export #' #' @examples -RepresentativeAccNums <- function(prot_data, +createRepresentativeAccNum <- function(prot_data, reduced = "Lineage", accnum_col = "AccNum") { # Get Unique reduced column and then bind the AccNums back to get one AccNum per reduced column @@ -585,6 +595,9 @@ RepresentativeAccNums <- function(prot_data, return(accessions) } +#' alignFasta +#' +#' @description #' Perform a Multiple Sequence Alignment on a FASTA file. #' #' @author Samuel Chen, Janani Ravi @@ -610,12 +623,12 @@ alignFasta <- function(fasta_file, tool = "Muscle", outpath = NULL) { ) if (typeof(outpath) == "character") { - write.MsaAAMultipleAlignment(aligned, outpath) + writeMSA_AA2FA(aligned, outpath) } return(aligned) } -#' Write MsaAAMultpleAlignment Objects as algined fasta sequence +#' writeMSA_AA2FA #' #' @description #' MsaAAMultipleAlignment Objects are generated from calls to msaClustalOmega @@ -632,7 +645,7 @@ alignFasta <- function(fasta_file, tool = "Muscle", outpath = NULL) { #' @export #' #' @examples -write.MsaAAMultipleAlignment <- function(alignment, outpath) { +writeMSA_AA2FA <- function(alignment, outpath) { l <- length(rownames(alignment)) fasta <- "" for (i in 1:l) @@ -645,7 +658,7 @@ write.MsaAAMultipleAlignment <- function(alignment, outpath) { return(fasta) } -#' Get accnums from fasta file +#' getAccNumFromFA #' #' @param fasta_file #' @@ -655,7 +668,7 @@ write.MsaAAMultipleAlignment <- function(alignment, outpath) { #' @export #' #' @examples -get_accnums_from_fasta_file <- function(fasta_file) { +getAccNumFromFA <- function(fasta_file) { txt <- read_file(fasta_file) accnums <- stringi::stri_extract_all_regex(fasta_file, "(?<=>)[\\w,.]+")[[1]] return(accnums) diff --git a/R/pre-msa-tree.R b/R/pre-msa-tree.R index 44979c3c..290a1644 100644 --- a/R/pre-msa-tree.R +++ b/R/pre-msa-tree.R @@ -49,7 +49,7 @@ api_key <- Sys.getenv("ENTREZ_API_KEY", unset = "YOUR_KEY_HERE") #' @export #' #' @examples -to_titlecase <- function(x, y = " ") { +convert2TitleCase <- function(x, y = " ") { s <- strsplit(x, y)[[1]] paste(toupper(substring(s, 1, 1)), substring(s, 2), sep = "", collapse = y @@ -59,7 +59,7 @@ to_titlecase <- function(x, y = " ") { ################################ ## Function to add leaves to an alignment file ## !! Add DA to leaves? -#' Adding Leaves to an alignment file w/ accessions +#' addLeaves2Alignment #' #' @author Janani Ravi #' @@ -95,9 +95,9 @@ to_titlecase <- function(x, y = " ") { #' #' @examples #' \dontrun{ -#' add_leaves("pspa_snf7.aln", "pspa.txt") +#' addLeaves2Alignment("pspa_snf7.aln", "pspa.txt") #' } -add_leaves <- function(aln_file = "", +addLeaves2Alignment <- function(aln_file = "", lin_file = "data/rawdata_tsv/all_semiclean.txt", # !! finally change to all_clean.txt!! # lin_file="data/rawdata_tsv/PspA.txt", reduced = FALSE) { @@ -184,7 +184,7 @@ add_leaves <- function(aln_file = "", } -#' Title +#' addName #' #' @author Samuel Chen, Janani Ravi #' @@ -209,7 +209,7 @@ add_leaves <- function(aln_file = "", #' @export #' #' @examples -add_name <- function(data, +addName <- function(data, accnum_col = "AccNum", spec_col = "Species", lin_col = "Lineage", lin_sep = ">", out_col = "Name") { cols <- c(accnum_col, "Kingdom", "Phylum", "Genus", "Spp") @@ -258,7 +258,7 @@ add_name <- function(data, ################################ ## Function to convert alignment 'aln' to fasta format for MSA + Tree -#' Adding Leaves to an alignment file w/ accessions +#' convertAlignment2FA #' #' @author Janani Ravi #' @@ -288,9 +288,9 @@ add_name <- function(data, #' #' @examples #' \dontrun{ -#' add_leaves("pspa_snf7.aln", "pspa.txt") +#' convertAlignment2FA("pspa_snf7.aln", "pspa.txt") #' } -convert_aln2fa <- function(aln_file = "", +convertAlignment2FA <- function(aln_file = "", lin_file = "data/rawdata_tsv/all_semiclean.txt", # !! finally change to all_clean.txt!! fa_outpath = "", reduced = FALSE) { @@ -324,6 +324,9 @@ convert_aln2fa <- function(aln_file = "", return(fasta) } +#' mapAcc2Name +#' +#' @description #' Default rename_fasta() replacement function. Maps an accession number to its name #' #' @param line he line of a fasta file starting with '>' @@ -340,7 +343,7 @@ convert_aln2fa <- function(aln_file = "", #' @export #' #' @examples -map_acc2name <- function(line, acc2name, acc_col = "AccNum", name_col = "Name") { +mapAcc2Name <- function(line, acc2name, acc_col = "AccNum", name_col = "Name") { # change to be the name equivalent to an add_names column # Find the first ' ' end_acc <- str_locate(line, " ")[[1]] @@ -386,7 +389,10 @@ rename_fasta <- function(fa_path, outpath, } ################################ -## generate_all_aln2fa +## generateAllAlignments2FA +#' generateAllAlignments2FA +#' +#' @description #' Adding Leaves to an alignment file w/ accessions #' #' @author Janani Ravi @@ -413,9 +419,9 @@ rename_fasta <- function(fa_path, outpath, #' #' @examples #' \dontrun{ -#' generate_all_aln2fa() +#' generateAllAlignments2FA() #' } -generate_all_aln2fa <- function(aln_path = here("data/rawdata_aln/"), +generateAllAlignments2FA <- function(aln_path = here("data/rawdata_aln/"), fa_outpath = here("data/alns/"), lin_file = here("data/rawdata_tsv/all_semiclean.txt"), reduced = F) { @@ -448,6 +454,10 @@ generate_all_aln2fa <- function(aln_path = here("data/rawdata_aln/"), # accessions <- rep("ANY95992.1", 201) #' acc2fa #' +#' @description +#' converts protein accession numbers to a fasta format. Resulting +#' fasta file is written to the outpath. +#' #' @author Samuel Chen, Janani Ravi #' @keywords accnum, fasta #' @@ -546,7 +556,7 @@ acc2fa <- function(accessions, outpath, plan = "sequential") { return(result) } -#' RepresentativeAccNums +#' createRepresentativeAccNum #' #' @description #' Function to generate a vector of one Accession number per distinct observation from 'reduced' column @@ -566,7 +576,7 @@ acc2fa <- function(accessions, outpath, plan = "sequential") { #' @export #' #' @examples -RepresentativeAccNums <- function(prot_data, +createRepresentativeAccNum <- function(prot_data, reduced = "Lineage", accnum_col = "AccNum") { # Get Unique reduced column and then bind the AccNums back to get one AccNum per reduced column @@ -623,15 +633,15 @@ alignFasta <- function(fasta_file, tool = "Muscle", outpath = NULL) { ) if (typeof(outpath) == "character") { - write.MsaAAMultipleAlignment(aligned, outpath) + writeMSA_AA2FA(aligned, outpath) } return(aligned) } -#' write.MsaAAMultipleAlignment +#' writeMSA_AA2FA #' #' @description -#' Write MsaAAMultpleAlignment Objects as algined fasta sequence +#' Write MsaAAMultpleAlignment Objects as aligned fasta sequence #' MsaAAMultipleAlignment Objects are generated from calls to msaClustalOmega #' and msaMuscle from the 'msa' package #' @@ -647,7 +657,7 @@ alignFasta <- function(fasta_file, tool = "Muscle", outpath = NULL) { #' @export #' #' @examples -write.MsaAAMultipleAlignment <- function(alignment, outpath) { +writeMSA_AA2FA <- function(alignment, outpath) { l <- length(rownames(alignment)) fasta <- "" for (i in 1:l) @@ -660,7 +670,7 @@ write.MsaAAMultipleAlignment <- function(alignment, outpath) { return(fasta) } -#' get_accnums_from_fasta_file +#' getAccNumFromFA #' #' @param fasta_file #' @@ -671,7 +681,7 @@ write.MsaAAMultipleAlignment <- function(alignment, outpath) { #' @export #' #' @examples -get_accnums_from_fasta_file <- function(fasta_file) { +getAccNumFromFA <- function(fasta_file) { txt <- read_file(fasta_file) accnums <- stringi::stri_extract_all_regex(fasta_file, "(?<=>)[\\w,.]+")[[1]] return(accnums) diff --git a/R/reverse_operons.R b/R/reverse_operons.R index e4bbd50e..a2570e8d 100755 --- a/R/reverse_operons.R +++ b/R/reverse_operons.R @@ -3,7 +3,7 @@ # Modified by Janani Ravi and Samuel Chen -#' reveql +#' straightenOperonSeq #' #' @param prot #' @@ -11,7 +11,7 @@ #' @export #' #' @examples -reveql <- function(prot) { +straightenOperonSeq <- function(prot) { w <- prot # $GenContext.orig # was 'x' y <- rep(NA, length(w)) @@ -57,7 +57,7 @@ reveql <- function(prot) { ## The function to reverse operons -#' reverse_operon +#' reverseOperonSeq #' #' @param prot #' @@ -65,7 +65,7 @@ reveql <- function(prot) { #' @export #' #' @examples -reverse_operon <- function(prot) { +reverseOperonSeq <- function(prot) { gencontext <- prot$GenContext gencontext <- gsub(pattern = ">", replacement = ">|", x = gencontext) @@ -108,7 +108,7 @@ reverse_operon <- function(prot) { - ge <- lapply(1:length(ge), function(x) reveql(ge[[x]])) + ge <- lapply(1:length(ge), function(x) straightenOperonSeq(ge[[x]])) ye <- te[withouteq] @@ -141,4 +141,4 @@ reverse_operon <- function(prot) { # colnames(prot) <- c("AccNum","GenContext.orig","len", "GeneName","TaxID","Species") ## ??? straighten operons -# prot$GenContext.orig <- reverse_operon(prot) +# prot$GenContext.orig <- reverseOperonSeq(prot) diff --git a/man/acc2fa.Rd b/man/acc2fa.Rd index 158b2d51..3e7a756d 100644 --- a/man/acc2fa.Rd +++ b/man/acc2fa.Rd @@ -15,6 +15,9 @@ Function may not work for vectors of length > 10,000} \item{plan}{} } \description{ +converts protein accession numbers to a fasta format. Resulting +fasta file is written to the outpath. + acc2fa converts protein accession numbers to a fasta format. Resulting fasta file is written to the outpath. } diff --git a/man/addLeaves2Alignment.Rd b/man/addLeaves2Alignment.Rd index a758ebd5..d00e6df7 100644 --- a/man/addLeaves2Alignment.Rd +++ b/man/addLeaves2Alignment.Rd @@ -1,9 +1,15 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/CHANGED-pre-msa-tree.R +% Please edit documentation in R/CHANGED-pre-msa-tree.R, R/pre-msa-tree.R \name{addLeaves2Alignment} \alias{addLeaves2Alignment} -\title{Adding Leaves to an alignment file w/ accessions} +\title{addLeaves2Alignment} \usage{ +addLeaves2Alignment( + aln_file = "", + lin_file = "data/rawdata_tsv/all_semiclean.txt", + reduced = FALSE +) + addLeaves2Alignment( aln_file = "", lin_file = "data/rawdata_tsv/all_semiclean.txt", @@ -11,7 +17,7 @@ addLeaves2Alignment( ) } \arguments{ -\item{aln_file}{haracter. Path to file. Input tab-delimited file + +\item{aln_file}{Character. Path to file. Input tab-delimited file + alignment file accnum & alignment. Default is 'pspa_snf7.aln'} @@ -23,15 +29,25 @@ Default is 'pspa.txt'} only one sequence per lineage. Default is FALSE.} } \description{ +Adding Leaves to an alignment file w/ accessions +Genomic Contexts vs Domain Architectures. + Adding Leaves to an alignment file w/ accessions Genomic Contexts vs Domain Architectures. } \details{ +The alignment file would need two columns: 1. accession + +number and 2. alignment. The protein homolog accession to lineage mapping + +file should have + The alignment file would need two columns: 1. accession + number and 2. alignment. The protein homolog accession to lineage mapping + file should have } \note{ +Please refer to the source code if you have alternate + +file formats and/or column names. + Please refer to the source code if you have alternate + file formats and/or column names. } @@ -39,6 +55,9 @@ file formats and/or column names. \dontrun{ addLeaves2Alignment("pspa_snf7.aln", "pspa.txt") } +\dontrun{ +addLeaves2Alignment("pspa_snf7.aln", "pspa.txt") +} } \author{ Janani Ravi diff --git a/man/addName.Rd b/man/addName.Rd index e04f9849..6f171456 100644 --- a/man/addName.Rd +++ b/man/addName.Rd @@ -1,9 +1,18 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/CHANGED-pre-msa-tree.R +% Please edit documentation in R/CHANGED-pre-msa-tree.R, R/pre-msa-tree.R \name{addName} \alias{addName} -\title{Add Name} +\title{addName} \usage{ +addName( + data, + accnum_col = "AccNum", + spec_col = "Species", + lin_col = "Lineage", + lin_sep = ">", + out_col = "Name" +) + addName( data, accnum_col = "AccNum", @@ -28,9 +37,14 @@ addName( Lineage, and AccNum info} } \value{ +Original data with a 'Name' column + Original data with a 'Name' column } \description{ +This function adds a new 'Name' column that is comprised of components from +Kingdom, Phylum, Genus, and species, as well as the accession + This function adds a new 'Name' column that is comprised of components from Kingdom, Phylum, Genus, and species, as well as the accession } diff --git a/man/add_leaves.Rd b/man/add_leaves.Rd deleted file mode 100644 index f1eeed10..00000000 --- a/man/add_leaves.Rd +++ /dev/null @@ -1,50 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/pre-msa-tree.R -\name{add_leaves} -\alias{add_leaves} -\title{Adding Leaves to an alignment file w/ accessions} -\usage{ -add_leaves( - aln_file = "", - lin_file = "data/rawdata_tsv/all_semiclean.txt", - reduced = FALSE -) -} -\arguments{ -\item{aln_file}{Character. Path to file. Input tab-delimited file + -alignment file accnum & alignment. -Default is 'pspa_snf7.aln'} - -\item{lin_file}{Character. Path to file. Protein file with accession + -number to lineage mapping. -Default is 'pspa.txt'} - -\item{reduced}{Boolean. If TRUE, a reduced data frame will be generated with -only one sequence per lineage. Default is FALSE.} -} -\description{ -Adding Leaves to an alignment file w/ accessions -Genomic Contexts vs Domain Architectures. -} -\details{ -The alignment file would need two columns: 1. accession + -number and 2. alignment. The protein homolog accession to lineage mapping + -file should have -} -\note{ -Please refer to the source code if you have alternate + -file formats and/or column names. -} -\examples{ -\dontrun{ -add_leaves("pspa_snf7.aln", "pspa.txt") -} -} -\author{ -Janani Ravi -} -\keyword{accnum,} -\keyword{alignment,} -\keyword{leaves,} -\keyword{lineage,} -\keyword{species} diff --git a/man/add_name.Rd b/man/add_name.Rd deleted file mode 100644 index f19139e1..00000000 --- a/man/add_name.Rd +++ /dev/null @@ -1,39 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/pre-msa-tree.R -\name{add_name} -\alias{add_name} -\title{Title} -\usage{ -add_name( - data, - accnum_col = "AccNum", - spec_col = "Species", - lin_col = "Lineage", - lin_sep = ">", - out_col = "Name" -) -} -\arguments{ -\item{data}{Data to add name column to} - -\item{accnum_col}{Column containing accession numbers} - -\item{spec_col}{Column containing species} - -\item{lin_col}{Column containing lineage} - -\item{lin_sep}{Character separating lineage levels} - -\item{out_col}{Column that contains the new 'Name' derived from Species, -Lineage, and AccNum info} -} -\value{ -Original data with a 'Name' column -} -\description{ -This function adds a new 'Name' column that is comprised of components from -Kingdom, Phylum, Genus, and species, as well as the accession -} -\author{ -Samuel Chen, Janani Ravi -} diff --git a/man/alignFasta.Rd b/man/alignFasta.Rd index 21b020cf..02a3026b 100644 --- a/man/alignFasta.Rd +++ b/man/alignFasta.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/CHANGED-pre-msa-tree.R, R/pre-msa-tree.R \name{alignFasta} \alias{alignFasta} -\title{Perform a Multiple Sequence Alignment on a FASTA file.} +\title{alignFasta} \usage{ alignFasta(fasta_file, tool = "Muscle", outpath = NULL) @@ -21,6 +21,8 @@ aligned fasta sequence as a MsaAAMultipleAlignment object aligned fasta sequence as a MsaAAMultipleAlignment object } \description{ +Perform a Multiple Sequence Alignment on a FASTA file. + Perform a Multiple Sequence Alignment on a FASTA file. } \author{ diff --git a/man/convert2TitleCase.Rd b/man/convert2TitleCase.Rd index 84e7fa00..72619285 100644 --- a/man/convert2TitleCase.Rd +++ b/man/convert2TitleCase.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/CHANGED-pre-msa-tree.R +% Please edit documentation in R/CHANGED-pre-msa-tree.R, R/pre-msa-tree.R \name{convert2TitleCase} \alias{convert2TitleCase} \alias{totitle,} @@ -7,6 +7,8 @@ \title{Changing case to 'Title Case'} \usage{ convert2TitleCase(text, delimitter) + +to_titlecase(text, delimitter) } \arguments{ \item{x}{Character vector.} @@ -15,8 +17,13 @@ convert2TitleCase(text, delimitter) } \description{ Translate string to Title Case w/ delimitter. + +Translate string to Title Case w/ delimitter. +Changing case to 'Title Case' } \seealso{ +chartr, toupper, and tolower. + chartr, toupper, and tolower. } \author{ diff --git a/man/convertAlignment2FA.Rd b/man/convertAlignment2FA.Rd index d6b4dc56..8e9ceb94 100644 --- a/man/convertAlignment2FA.Rd +++ b/man/convertAlignment2FA.Rd @@ -1,9 +1,16 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/CHANGED-pre-msa-tree.R +% Please edit documentation in R/CHANGED-pre-msa-tree.R, R/pre-msa-tree.R \name{convertAlignment2FA} \alias{convertAlignment2FA} -\title{Adding Leaves to an alignment file w/ accessions} +\title{convertAlignment2FA} \usage{ +convertAlignment2FA( + aln_file = "", + lin_file = "data/rawdata_tsv/all_semiclean.txt", + fa_outpath = "", + reduced = FALSE +) + convertAlignment2FA( aln_file = "", lin_file = "data/rawdata_tsv/all_semiclean.txt", @@ -31,11 +38,18 @@ Adding Leaves to an alignment file w/ accessions Genomic Contexts vs Domain Architectures. } \details{ +The alignment file would need two columns: 1. accession + +number and 2. alignment. The protein homolog accession to lineage mapping + +file should have + The alignment file would need two columns: 1. accession + number and 2. alignment. The protein homolog accession to lineage mapping + file should have } \note{ +Please refer to the source code if you have alternate + +file formats and/or column names. + Please refer to the source code if you have alternate + file formats and/or column names. } @@ -44,6 +58,9 @@ file formats and/or column names. addLeaves2Alignment("pspa_snf7.aln", "pspa.txt") } +\dontrun{ +convertAlignment2FA("pspa_snf7.aln", "pspa.txt") +} } \author{ Janani Ravi diff --git a/man/convert_aln2fa.Rd b/man/convert_aln2fa.Rd deleted file mode 100644 index 8bebe31d..00000000 --- a/man/convert_aln2fa.Rd +++ /dev/null @@ -1,53 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/pre-msa-tree.R -\name{convert_aln2fa} -\alias{convert_aln2fa} -\title{Adding Leaves to an alignment file w/ accessions} -\usage{ -convert_aln2fa( - aln_file = "", - lin_file = "data/rawdata_tsv/all_semiclean.txt", - fa_outpath = "", - reduced = FALSE -) -} -\arguments{ -\item{aln_file}{Character. Path to file. Input tab-delimited file + -alignment file accnum & alignment. -Default is 'pspa_snf7.aln'} - -\item{lin_file}{Character. Path to file. Protein file with accession + -number to lineage mapping. -Default is 'pspa.txt'} - -\item{fa_outpath}{Character. Path to the written fasta file. -Default is 'NULL'} - -\item{reduced}{Boolean. If TRUE, the fasta file will contain only one sequence per lineage. -Default is 'FALSE'} -} -\description{ -Adding Leaves to an alignment file w/ accessions -} -\details{ -The alignment file would need two columns: 1. accession + -number and 2. alignment. The protein homolog accession to lineage mapping + -file should have -} -\note{ -Please refer to the source code if you have alternate + -file formats and/or column names. -} -\examples{ -\dontrun{ -add_leaves("pspa_snf7.aln", "pspa.txt") -} -} -\author{ -Janani Ravi -} -\keyword{accnum,} -\keyword{alignment,} -\keyword{leaves,} -\keyword{lineage,} -\keyword{species} diff --git a/man/RepresentativeAccNums.Rd b/man/createRepresentativeAccNum.Rd similarity index 60% rename from man/RepresentativeAccNums.Rd rename to man/createRepresentativeAccNum.Rd index f617cde4..3bd20522 100644 --- a/man/RepresentativeAccNums.Rd +++ b/man/createRepresentativeAccNum.Rd @@ -1,12 +1,20 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/CHANGED-pre-msa-tree.R, R/pre-msa-tree.R -\name{RepresentativeAccNums} -\alias{RepresentativeAccNums} -\title{Function to generate a vector of one Accession number per distinct observation from 'reduced' column} +\name{createRepresentativeAccNum} +\alias{createRepresentativeAccNum} +\title{createRepresentativeAccNum} \usage{ -RepresentativeAccNums(prot_data, reduced = "Lineage", accnum_col = "AccNum") +createRepresentativeAccNum( + prot_data, + reduced = "Lineage", + accnum_col = "AccNum" +) -RepresentativeAccNums(prot_data, reduced = "Lineage", accnum_col = "AccNum") +createRepresentativeAccNum( + prot_data, + reduced = "Lineage", + accnum_col = "AccNum" +) } \arguments{ \item{prot_data}{Data frame containing Accession Numbers} @@ -18,6 +26,8 @@ One accession number will be assigned for each of these observations} \item{accnum_col}{Column from prot_data that contains Accession Numbers} } \description{ +Function to generate a vector of one Accession number per distinct observation from 'reduced' column + Function to generate a vector of one Accession number per distinct observation from 'reduced' column } \author{ diff --git a/man/generateAllAlignments2FA.Rd b/man/generateAllAlignments2FA.Rd index 3bf9938a..8f9d8ffc 100644 --- a/man/generateAllAlignments2FA.Rd +++ b/man/generateAllAlignments2FA.Rd @@ -1,9 +1,16 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/CHANGED-pre-msa-tree.R +% Please edit documentation in R/CHANGED-pre-msa-tree.R, R/pre-msa-tree.R \name{generateAllAlignments2FA} \alias{generateAllAlignments2FA} -\title{Adding Leaves to an alignment file w/ accessions} +\title{generateAllAlignments2FA} \usage{ +generateAllAlignments2FA( + aln_path = here("data/rawdata_aln/"), + fa_outpath = here("data/alns/"), + lin_file = here("data/rawdata_tsv/all_semiclean.txt"), + reduced = F +) + generateAllAlignments2FA( aln_path = here("data/rawdata_aln/"), fa_outpath = here("data/alns/"), @@ -15,28 +22,44 @@ generateAllAlignments2FA( \item{aln_path}{Character. Path to alignment files. Default is 'here("data/rawdata_aln/")'} -\item{fa_outpath}{Character. Path to file. Master protein file with AccNum & lineages. -Default is 'here("data/rawdata_tsv/all_semiclean.txt")'} - -\item{lin_file}{Character. Path to the written fasta file. +\item{fa_outpath}{Character. Path to the written fasta file. Default is 'here("data/alns/")'.} +\item{lin_file}{Character. Path to file. Master protein file with AccNum & lineages. +Default is 'here("data/rawdata_tsv/all_semiclean.txt")'} + \item{reduced}{Boolean. If TRUE, the fasta file will contain only one sequence per lineage. Default is 'FALSE'.} } \description{ +Adding Leaves to an alignment file w/ accessions + +Adding Leaves to all alignment files w/ accessions & DAs? + +Adding Leaves to an alignment file w/ accessions + Adding Leaves to all alignment files w/ accessions & DAs? } \details{ +The alignment files would need two columns separated by spaces: 1. AccNum and 2. alignment. The protein homolog file should have AccNum, Species, Lineages. + The alignment files would need two columns separated by spaces: 1. AccNum and 2. alignment. The protein homolog file should have AccNum, Species, Lineages. } \note{ +Please refer to the source code if you have alternate + file formats and/or column names. + Please refer to the source code if you have alternate + file formats and/or column names. } \examples{ \dontrun{ generateAllAlignments2FA() } +\dontrun{ +generateAllAlignments2FA() +} +} +\author{ +Janani Ravi } \keyword{accnum,} \keyword{alignment,} diff --git a/man/generate_all_aln2fa.Rd b/man/generate_all_aln2fa.Rd deleted file mode 100644 index ad6b7136..00000000 --- a/man/generate_all_aln2fa.Rd +++ /dev/null @@ -1,48 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/pre-msa-tree.R -\name{generate_all_aln2fa} -\alias{generate_all_aln2fa} -\title{Adding Leaves to an alignment file w/ accessions} -\usage{ -generate_all_aln2fa( - aln_path = here("data/rawdata_aln/"), - fa_outpath = here("data/alns/"), - lin_file = here("data/rawdata_tsv/all_semiclean.txt"), - reduced = F -) -} -\arguments{ -\item{aln_path}{Character. Path to alignment files. -Default is 'here("data/rawdata_aln/")'} - -\item{fa_outpath}{Character. Path to the written fasta file. -Default is 'here("data/alns/")'.} - -\item{lin_file}{Character. Path to file. Master protein file with AccNum & lineages. -Default is 'here("data/rawdata_tsv/all_semiclean.txt")'} - -\item{reduced}{Boolean. If TRUE, the fasta file will contain only one sequence per lineage. -Default is 'FALSE'.} -} -\description{ -Adding Leaves to all alignment files w/ accessions & DAs? -} -\details{ -The alignment files would need two columns separated by spaces: 1. AccNum and 2. alignment. The protein homolog file should have AccNum, Species, Lineages. -} -\note{ -Please refer to the source code if you have alternate + file formats and/or column names. -} -\examples{ -\dontrun{ -generate_all_aln2fa() -} -} -\author{ -Janani Ravi -} -\keyword{accnum,} -\keyword{alignment,} -\keyword{leaves,} -\keyword{lineage,} -\keyword{species} diff --git a/man/getAccNumFromFA.Rd b/man/getAccNumFromFA.Rd new file mode 100644 index 00000000..d3ab8177 --- /dev/null +++ b/man/getAccNumFromFA.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/CHANGED-pre-msa-tree.R, R/pre-msa-tree.R +\name{getAccNumFromFA} +\alias{getAccNumFromFA} +\title{getAccNumFromFA} +\usage{ +getAccNumFromFA(fasta_file) + +getAccNumFromFA(fasta_file) +} +\arguments{ +\item{fasta_file}{} +} +\description{ +getAccNumFromFA + +getAccNumFromFA +} diff --git a/man/get_accnums_from_fasta_file.Rd b/man/get_accnums_from_fasta_file.Rd deleted file mode 100644 index 84c163cc..00000000 --- a/man/get_accnums_from_fasta_file.Rd +++ /dev/null @@ -1,18 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/CHANGED-pre-msa-tree.R, R/pre-msa-tree.R -\name{get_accnums_from_fasta_file} -\alias{get_accnums_from_fasta_file} -\title{Get accnums from fasta file} -\usage{ -get_accnums_from_fasta_file(fasta_file) - -get_accnums_from_fasta_file(fasta_file) -} -\arguments{ -\item{fasta_file}{} -} -\description{ -Get accnums from fasta file - -get_accnums_from_fasta_file -} diff --git a/man/mapAcc2Name.Rd b/man/mapAcc2Name.Rd index 0f5d447d..39ecb065 100644 --- a/man/mapAcc2Name.Rd +++ b/man/mapAcc2Name.Rd @@ -1,13 +1,15 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/CHANGED-pre-msa-tree.R +% Please edit documentation in R/CHANGED-pre-msa-tree.R, R/pre-msa-tree.R \name{mapAcc2Name} \alias{mapAcc2Name} -\title{Default renameFA() replacement function. Maps an accession number to its name} +\title{mapAcc2Name} \usage{ +mapAcc2Name(line, acc2name, acc_col = "AccNum", name_col = "Name") + mapAcc2Name(line, acc2name, acc_col = "AccNum", name_col = "Name") } \arguments{ -\item{line}{The line of a fasta file starting with '>'} +\item{line}{he line of a fasta file starting with '>'} \item{acc2name}{Data Table containing a column of accession numbers and a name column} @@ -18,4 +20,6 @@ are mapped to} } \description{ Default renameFA() replacement function. Maps an accession number to its name + +Default rename_fasta() replacement function. Maps an accession number to its name } diff --git a/man/map_acc2name.Rd b/man/map_acc2name.Rd deleted file mode 100644 index fcdb3023..00000000 --- a/man/map_acc2name.Rd +++ /dev/null @@ -1,21 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/pre-msa-tree.R -\name{map_acc2name} -\alias{map_acc2name} -\title{Default rename_fasta() replacement function. Maps an accession number to its name} -\usage{ -map_acc2name(line, acc2name, acc_col = "AccNum", name_col = "Name") -} -\arguments{ -\item{line}{he line of a fasta file starting with '>'} - -\item{acc2name}{Data Table containing a column of accession numbers and a name column} - -\item{acc_col}{Name of the column containing Accession numbers} - -\item{name_col}{Name of the column containing the names that the accession numbers -are mapped to} -} -\description{ -Default rename_fasta() replacement function. Maps an accession number to its name -} diff --git a/man/reveql.Rd b/man/reverseOperonSeq.Rd similarity index 56% rename from man/reveql.Rd rename to man/reverseOperonSeq.Rd index 9dc2bcb8..d61ec5f2 100644 --- a/man/reveql.Rd +++ b/man/reverseOperonSeq.Rd @@ -1,14 +1,14 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/reverse_operons.R -\name{reveql} -\alias{reveql} -\title{reveql} +\name{reverseOperonSeq} +\alias{reverseOperonSeq} +\title{reverseOperonSeq} \usage{ -reveql(prot) +reverseOperonSeq(prot) } \arguments{ \item{prot}{} } \description{ -reveql +reverseOperonSeq } diff --git a/man/reverse_operon.Rd b/man/straightenOperonSeq.Rd similarity index 53% rename from man/reverse_operon.Rd rename to man/straightenOperonSeq.Rd index 270e2a62..fcd0c923 100644 --- a/man/reverse_operon.Rd +++ b/man/straightenOperonSeq.Rd @@ -1,14 +1,14 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/reverse_operons.R -\name{reverse_operon} -\alias{reverse_operon} -\title{reverse_operon} +\name{straightenOperonSeq} +\alias{straightenOperonSeq} +\title{straightenOperonSeq} \usage{ -reverse_operon(prot) +straightenOperonSeq(prot) } \arguments{ \item{prot}{} } \description{ -reverse_operon +straightenOperonSeq } diff --git a/man/to_titlecase.Rd b/man/to_titlecase.Rd deleted file mode 100644 index 45139d3b..00000000 --- a/man/to_titlecase.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/pre-msa-tree.R -\name{to_titlecase} -\alias{to_titlecase} -\alias{totitle,} -\alias{to_title} -\title{To Titlecase} -\usage{ -to_titlecase(text, delimitter) -} -\arguments{ -\item{x}{Character vector.} - -\item{y}{Delimitter. Default is space (" ").} -} -\description{ -Translate string to Title Case w/ delimitter. -Changing case to 'Title Case' -} -\seealso{ -chartr, toupper, and tolower. -} -\author{ -Andrie, Janani Ravi -} diff --git a/man/write.MsaAAMultipleAlignment.Rd b/man/writeMSA_AA2FA.Rd similarity index 65% rename from man/write.MsaAAMultipleAlignment.Rd rename to man/writeMSA_AA2FA.Rd index 17a05f50..a6798469 100644 --- a/man/write.MsaAAMultipleAlignment.Rd +++ b/man/writeMSA_AA2FA.Rd @@ -1,12 +1,12 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/CHANGED-pre-msa-tree.R, R/pre-msa-tree.R -\name{write.MsaAAMultipleAlignment} -\alias{write.MsaAAMultipleAlignment} -\title{Write MsaAAMultpleAlignment Objects as algined fasta sequence} +\name{writeMSA_AA2FA} +\alias{writeMSA_AA2FA} +\title{writeMSA_AA2FA} \usage{ -write.MsaAAMultipleAlignment(alignment, outpath) +writeMSA_AA2FA(alignment, outpath) -write.MsaAAMultipleAlignment(alignment, outpath) +writeMSA_AA2FA(alignment, outpath) } \arguments{ \item{alignment}{MsaAAMultipleAlignment object to be written as a fasta} @@ -17,7 +17,7 @@ write.MsaAAMultipleAlignment(alignment, outpath) MsaAAMultipleAlignment Objects are generated from calls to msaClustalOmega and msaMuscle from the 'msa' package -Write MsaAAMultpleAlignment Objects as algined fasta sequence +Write MsaAAMultpleAlignment Objects as aligned fasta sequence MsaAAMultipleAlignment Objects are generated from calls to msaClustalOmega and msaMuscle from the 'msa' package }