Skip to content

Commit

Permalink
minor bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
valflanza committed Jan 31, 2021
1 parent 0a73f93 commit 018f594
Show file tree
Hide file tree
Showing 55 changed files with 97 additions and 118 deletions.
6 changes: 4 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ Package: pato
Type: Package
Title: Pangenome Analysis Toolkit
Version: 1.0.2
Author: Alba Talavera Rodríguez
Miguel Diez Fernandez de Bobadilla
Author: Miguel Diez Fernandez de Bobadilla
Alba Talavera Rodríguez
Lucia Chacon Vargas
Fernando Baquero
Teresa M. Coque
Val F. Lanza <[email protected]>
Maintainer: Val F. Lanza <[email protected]>
Description: PATO is a R package designed to analyze pangenomes (set of genomes)
Expand Down
3 changes: 1 addition & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ export(snps_map)
export(snps_pairwaise)
export(twins)
export(umap_plot)
import(Biostrings)
import(ape)
import(data.table)
import(dbscan)
import(doParallel)
import(dplyr)
Expand All @@ -64,4 +62,5 @@ import(threejs)
import(tibble)
import(tidyr)
import(uwot)
importFrom(data.table,fread)
importFrom(randomcoloR,distinctColorPalette)
3 changes: 1 addition & 2 deletions R/accnet.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@
#'
#' @import dplyr
#' @import tidyr
#' @import tibble
#' @import dtplyr
#' @import data.table
#'
#'
accnet <- function(mmseqs,threshold = 0.8, singles = TRUE)
{
Expand Down
2 changes: 0 additions & 2 deletions R/accnet_enrichment_analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
#' @import dplyr
#' @import tidyr
#' @import tibble
#' @import dtplyr
#' @import data.table
#'
accnet_enrichment_analysis <- function(data,cluster, padj_method = "BY")
{
Expand Down
2 changes: 0 additions & 2 deletions R/accnet_with_padj.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
#' @import dplyr
#' @import tidyr
#' @import tibble
#' @import dtplyr
#' @import data.table
#'
accnet_with_padj <- function(data)
{
Expand Down
2 changes: 0 additions & 2 deletions R/annotate.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@
#' @import dplyr
#' @import tidyr
#' @import tibble
#' @import dtplyr
#' @import data.table
#'
annotate <- function(data, type = "nucl", database =c("AbR","VF_A","VF_B"), query = "all")
{
Expand Down
2 changes: 1 addition & 1 deletion R/as.data.frame.nr_list.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#' @return A `data.frame`
#' @export
#'
#' @examples
#'
as.data.frame.nr_list <- function(data)
{
return(data.frame(
Expand Down
4 changes: 2 additions & 2 deletions R/classifier.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
#' @return Classifier returns a data.frame with the best hit for each input genome.
#' @export
#'
#' @examples
#'
#' @import dplyr
#' @import tidyr
#' @import tibble
#' @import dtplyr
#' @import data.table
#' @importFrom data.table fread

classifier <- function(file_list, n_cores, type ="nucl", max_dist = 0.06)
{
Expand Down
4 changes: 3 additions & 1 deletion R/cluster_accnet.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
#' @import tibble
#' @import uwot
#' @import mclust
#' @import data.table
#' @importFrom data.table fread
#' @import dbscan
#' @import parallelDist
#'
#'
cluster_accnet <- function(data, method, n_cluster, d_reduction, ...)
{
Dist <-
Expand Down
2 changes: 1 addition & 1 deletion R/cluster_files_from_distance.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' @import dtplyr
#' @import tidyr
#' @import tibble
#' @import data.table
#' @importFrom data.table fread
#' @import igraph
#'
cluster_files_from_distance <- function(files, file_type, distance, n_cores, folder)
Expand Down
2 changes: 1 addition & 1 deletion R/cluster_knnn.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @import dplyr
#' @import tidyr
#' @import tibble
#' @import data.table
#' @importFrom data.table fread
cluster_knnn <- function(data,method)
{

Expand Down
2 changes: 1 addition & 1 deletion R/cluster_mash.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' @import tibble
#' @import uwot
#' @import mclust
#' @import data.table
#' @importFrom data.table fread
#' @import dbscan
#'
cluster_mash <- function(data, method, n_cluster,d_reduction,...)
Expand Down
4 changes: 2 additions & 2 deletions R/coincidents.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
#' @return A data.frame with the protein/gene ID ("Target") and the membership (cluster number)
#' @export
#'
#' @examples
#'
#' @import dplyr
#' @import tidyr
#' @import tibble
#' @import dtplyr
#' @import data.table
#' @importFrom data.table fread
#' @import uwot
#' @import dbscan
#'
Expand Down
4 changes: 2 additions & 2 deletions R/core_genome.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
#' @return A core_genome object (a data.frame with two columns: fasta header and sequence)
#' @export
#'
#' @examples
#'
#' @import dplyr
#' @import tidyr
#' @import tibble
#' @import dtplyr
#' @import data.table
#' @importFrom data.table fread
#' @import foreach
#' @import doParallel
#' @import parallel
Expand Down
2 changes: 1 addition & 1 deletion R/core_plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#' @import tibble
#' @import dtplyr
#' @import ggplot2
#' @import data.table
#' @importFrom data.table fread
#' @import doParallel
#' @import foreach
#'
Expand Down
2 changes: 1 addition & 1 deletion R/core_snp_genome.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#' @return core_snp_genome object
#' @export
#'
#' @examples
#'
core_snp_genome <- function(file_list, n_cores, ref, type)
{
if(grepl('linux',Sys.getenv("R_PLATFORM"))) ## Linux
Expand Down
2 changes: 1 addition & 1 deletion R/core_snps_matrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @return A square matrix
#' @export
#'
#' @examples
#'
#' @import stringdist
#' @import magrittr
#'
Expand Down
2 changes: 1 addition & 1 deletion R/dn_ds.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' @return
#' @export
#'
#' @examples
#'
#'
#'
dn_ds <- function(mmseq,accnet,min_size =5 ,n_cores,mode = "fast")
Expand Down
2 changes: 1 addition & 1 deletion R/export_accnet_aln.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#'
#' @export
#'
#' @examples
#'
#'
export_accnet_aln <- function(accnet,file, min_freq =3)
{
Expand Down
2 changes: 1 addition & 1 deletion R/export_core_to_fasta.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#'
#' @export
#'
#' @examples
#'
export_core_to_fasta <- function(core_data,file)
{

Expand Down
2 changes: 1 addition & 1 deletion R/export_to_gephi.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#' @import tibble
#' @import dtplyr
#' @import igraph
#' @import data.table
#' @importFrom data.table fread
export_to_gephi <- function(data, file, cluster)
{
if(is(data,"accnet"))
Expand Down
2 changes: 1 addition & 1 deletion R/extract_non_redundant.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' @import tidyr
#' @import tibble
#' @import dtplyr
#' @import data.table
#' @importFrom data.table fread
#'
extract_non_redundant <- function(data, nr_list)
{
Expand Down
2 changes: 1 addition & 1 deletion R/heatmap_of_annotation.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#'
#' @export
#'
#' @examples
#'
#'
#' @import dplyr
#' @import tidyr
Expand Down
4 changes: 2 additions & 2 deletions R/knnn.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
#' @return Returns an \emph{igraph} object.
#' @export
#'
#' @examples
#'
#' @import dplyr
#' @import tidyr
#' @import tibble
#' @import dtplyr
#' @import data.table
#' @importFrom data.table fread
#' @import igraph
#' @import parallelDist

Expand Down
13 changes: 7 additions & 6 deletions R/load_gff_list.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@
#' The function returns a \code{gff_list} object the can be used as input for other functions (mmseqs, mash)
#' @export
#'
#' @examples
#'
#' @import dplyr
#' @import tidyr
#' @import tibble
#' @import dtplyr
#' @import data.table
#' @import Biostrings
#' @importFrom data.table fread
#' @import openssl
#' @import microseq
#' @import foreach
Expand All @@ -36,6 +35,9 @@ load_gff_list <- function(input_files, n_cores)
cl <- makeCluster(n_cores)
registerDoParallel(cl)

on.exit(file.remove(list.files(pattern = "gffTMP")))
on.exit(stopCluster(cl), add = T)

input_files <- as_tibble(input_files) %>% rename(File = 1)
folderName <- paste(getwd(),"/",md5(paste(input_files$File, sep = "",collapse = "")),"_gffList",sep = "",collapse = "")

Expand Down Expand Up @@ -99,13 +101,12 @@ load_gff_list <- function(input_files, n_cores)
ffn_faa <- inner_join(ffn_faa,gff) %>% select(Annot,Sequence) %>% rename(Header = Annot)

writeFasta(ffn_faa, paste(folderName,"/ffn/",pathName,".ffn",sep = "",collapse = "")) ## Write the ffn file
ffn_faa <- ffn_faa %>% mutate(Sequence = translate(Sequence))
ffn_faa <- ffn_faa %>% mutate(Sequence = microseq::translate(Sequence))
writeFasta(ffn_faa , paste(folderName,"/faa/",pathName,".faa",sep = "",collapse = "")) ## Write the faa file
}


on.exit(file.remove(list.files(pattern = "gffTMP")))
on.exit(stopCluster(cl), add = T)


results <- list(path = folderName, files = input_files)
class(results) <- append(class(results),"gff_list")
Expand Down
4 changes: 2 additions & 2 deletions R/mash.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
#'
#' @references Mash: fast genome and metagenome distance estimation using MinHash. Ondov BD, Treangen TJ, Melsted P, Mallonee AB, Bergman NH, Koren S, Phillippy AM. Genome Biol. 2016 Jun 20;17(1):132. doi: 10.1186/s13059-016-0997-x.
#' @references Mash Screen: High-throughput sequence containment estimation for genome discovery. Ondov BD, Starrett GJ, Sappington A, Kostic A, Koren S, Buck CB, Phillippy AM. BioRxiv. 2019 Mar. doi: 10.1101/557314
#' @examples
#'
#' @import dplyr
#' @import tidyr
#' @import tibble
#' @import dtplyr
#' @import data.table
#' @importFrom data.table fread



Expand Down
4 changes: 2 additions & 2 deletions R/mmseqs.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@
#' @references Steinegger M and Soeding J. MMseqs2 enables sensitive protein sequence searching for the analysis of massive data sets. Nature Biotechnology, doi: 10.1038/nbt.3988 (2017).
#' @references Steinegger M and Soeding J. Clustering huge protein sequence sets in linear time. Nature Communications, doi: 10.1038/s41467-018-04964-5 (2018).
#' @references Mirdita M, Steinegger M and Soeding J. MMseqs2 desktop and local web server app for fast, interactive sequence searches. Bioinformatics, doi: 10.1093/bioinformatics/bty1057 (2019)
#' @examples
#'
#' @import dplyr
#' @import tidyr
#' @import tibble
#' @import dtplyr
#' @import data.table
#' @importFrom data.table fread
#' @import foreach
#' @import doParallel
#' @import openssl
Expand Down
4 changes: 2 additions & 2 deletions R/network_of_annotation.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
#' @return \emph{igraph} object
#' @export
#'
#' @examples
#'
#' @seealso \code{\link{annotate}}
#'
#' @import dplyr
#' @import tidyr
#' @import tibble
#' @import dtplyr
#' @import igraph
#' @import data.table
#' @importFrom data.table fread
#'
network_of_annotation <- function(data, min_identity = 0.95, max_evalue = 1e-25)
{
Expand Down
4 changes: 2 additions & 2 deletions R/non_redundant.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
#'
#' @seealso \code{\link{extract_non_redundant}}
#'
#' @examples
#'
#' @import dplyr
#' @import tidyr
#' @import tibble
#' @import dtplyr
#' @import igraph
#' @import data.table
#' @importFrom data.table fread
#' @import parallelDist
#'
non_redundant <- function(data, number, fraction, distance, tolerance = 0.05, max_iter = 10000, fast =TRUE, snps)
Expand Down
4 changes: 2 additions & 2 deletions R/non_redundant_hier.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
#'
#' @seealso \code{\link{extract_non_redundant}}
#'
#' @examples
#'
#' @import dplyr
#' @import tidyr
#' @import tibble
#' @import dtplyr
#' @import igraph
#' @import data.table
#' @importFrom data.table fread
#' @import parallelDist
#'
non_redundant_hier <- function(data, number, fraction, distance, tolerance = 0.05, partitions = 10,max_iter = 10000, fast =FALSE, snps)
Expand Down
4 changes: 2 additions & 2 deletions R/non_redundant_pangenomes.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
#' @import tidyr
#' @import tibble
#' @import dtplyr
#' @import data.table
#' @importFrom data.table fread
#' @import igraph
#
#' @return
#' @export
#'
#' @examples
#'
non_redundant_pangenomes <- function(file_list, distance, type = "prot", n_cores,sketch = 1000, kmer = 21)
{

Expand Down
Loading

0 comments on commit 018f594

Please sign in to comment.