This function selects species from a GeneDiscoveR object based on a specified phenotype.

select_species_by_phenotype(
  GeneDiscoveRobject = NULL,
  columnPhenotype = "Oil-body-type",
  columnID = "OrthofinderID",
  type = NULL
)

Arguments

GeneDiscoveRobject

A GeneDiscoveR object containing genome data.

columnPhenotype

The name of the column in the genome data that contains the phenotype information.

columnID

The name of the column in the genome data that contains the species ID.

type

The specific phenotype to filter by.

Value

The updated GeneDiscoveR object with the selected species.

Examples

# Create a GeneDiscoveR object
N0sDir <- system.file("extdata", "N0-1dot3-6", package = "GeneDiscoveR")
overallsDir <- system.file("extdata", "Comparatives-1dot3-6", package = "GeneDiscoveR")
dataFile <- system.file("extdata", "annotatedCDSs.tsv", package = "GeneDiscoveR")
minInflation <- 1.3
maxInflation <- 6
stepInflation <- 0.1

GeneDiscoveRobject <- GeneDiscoveR(overallsDir = overallsDir, N0sDir = N0sDir, dataFile = dataFile, minInflation = minInflation, maxInflation = maxInflation, stepInflation = stepInflation)

# Set active run
GeneDiscoveRobject <- set_run_active(GeneDiscoveRobject, InflationValue = 1.8)
#> -----------From OrthoFinder-----------
#> The process has been completed successfully

# Select species by phenotype
GeneDiscoveRobject <- select_species_by_phenotype(GeneDiscoveRobject = GeneDiscoveRobject, columnPhenotype = "Oil-body-type", columnID = "OrthofinderID", type = "one_in_specialized_cell")
GeneDiscoveRobject <- select_species_by_phenotype(GeneDiscoveRobject = GeneDiscoveRobject, columnPhenotype = "Oil-body-type", columnID = "OrthofinderID", type = "many_in_all_cells")
GeneDiscoveRobject <- select_species_by_phenotype(GeneDiscoveRobject = GeneDiscoveRobject, columnPhenotype = "Oil-body-type", columnID = "OrthofinderID", type = "noneOB")

# Show Phenotypes
print(GeneDiscoveRobject$Phenotypes)
#> $one_in_specialized_cell
#>  [1] "1016-Treubia_lacunosa"                  
#>  [2] "664-Conocephalum_conicum"               
#>  [3] "908-Cyathodium_cavernarum"              
#>  [4] "909-Ricciocarpos_natans"                
#>  [5] "952-Plagiochasma_appendiculatum"        
#>  [6] "231-Lunularia_cruciata"                 
#>  [7] "MAPA-Marchantia_paleacea"               
#>  [8] "MpTAKv6-Marchantia_polymorpha_rudelaris"
#>  [9] "MpMON-Marchantia_polymorpha_montivagans"
#> [10] "MpPOL-Marchantia_polymorpha_polymorpha" 
#> 
#> $many_in_all_cells
#>  [1] "225-Ptilidium_ciliare"                
#>  [2] "1017-Porella_caespitans_var_nipponica"
#>  [3] "1025-Porella_chinensis"               
#>  [4] "604-Gackstroemia_magellanica"         
#>  [5] "630-Porella_platyphylla"              
#>  [6] "888-Acrolejeunea_sandvicensis"        
#>  [7] "957-Frullania_moniliata"              
#>  [8] "891-Pleurozia_purpurea"               
#>  [9] "625-Noteroclada_confluens"            
#> [10] "912-Pallavicinia_ambigua"             
#> [11] "905-Metzgeria_hamata"                 
#> [12] "955-Jungermannia_erectum"             
#> [13] "369-Plagiochila_semidecurrens"        
#> [14] "1026-Bazzania_tridens"                
#> [15] "343-Odontoschisma_sphagni"            
#> [16] "359-Scapania_nepalensis"              
#> [17] "620-Vetaforma_dusenii"                
#> [18] "621-Plagiochila_sp"                   
#> [19] "623-Mesoptychia_sp"                   
#> [20] "626-Acrobolbus_urvilleanus"           
#> [21] "906-Herbertus_kurzii"                 
#> [22] "961-Lepidozia_reptans"                
#> [23] "963-Plicanthus_hirtellus"             
#> [24] "965-Tetralophozia_filiformis"         
#> [25] "966-Tritomaria_exsectiformis"         
#> [26] "302-Haplomitrium_mnioides"            
#> [27] "889-Fossombronia_cristula"            
#> 
#> $noneOB
#> [1] "M158-Sphaerocarpos_donnellii" "368-Metzgeria_furcata"       
#> [3] "653-Riccia_cavernosa"         "890-Blasia_pusilla"          
#> [5] "349-Blasia_pusilla"          
#> 
# Output: $one_in_specialized_cell ... $many_in_all_cells ... $noneOB ...

# Clean phenotypes
GeneDiscoveRobject <- clean_phenotypes(GeneDiscoveRobject)
print(GeneDiscoveRobject$Phenotypes)
#> NULL
# Output: NULL