R语言【taxa】——从taxa 定义的类中获取组分信息

Package taxa version 0.4.2


tax_auth(x)

        在拥有对应信息的对象中设置和获取类群所有权信息。

> x <- taxon(name = c('Homo sapiens', 'Bacillus', 'Ascomycota', 'Ericaceae'),
+            rank = c('species', 'genus', 'phylum', 'family'),
+            id = taxon_id(c('9606', '1386', '4890', '4345'), db = 'ncbi'),
+            auth = c('Linnaeus, 1758', 'Cohn 1872', NA, 'Juss., 1789'))

> tax_auth(x)
<taxon_authority[4]>
[1] Linnaeus 1758 Cohn 1872     NA            Juss. 1789   

> tax_auth(x) <- tolower(tax_auth(x))
> tax_auth(x)[1] <- 'Billy'
> x
<taxon[4]>
[1] 9606|Homo sapiens Billy |species 1386|Bacillus cohn 1872|genus   
[3] 4890|Ascomycota na  |phylum      4345|Ericaceae juss. 1789|family
Rank levels: phylum < family < genus < species

tax_author(x)

        设置和获取分类群的作者信息。

> x <- taxon_authority(c('Cham. & Schldl.', 'L.'),
+                      date = c('1827', '1753'))

> tax_author(x)
[1] "Cham. & Schldl." "L."     
        
> tax_author(x)[1] <- "Billy"
> tax_author(x) <- tolower(tax_author(x))
> tax_author(x)
[1] "billy" "l." 

tax_cite(x)

        设置和获取分类群的引用信息。

> x <- taxon_authority(c('Cham. & Schldl.', 'L.'),
+                      date = c('1827', '1753'),
+                      citation = c(NA, 'Species Plantarum'))

> tax_cite(x)
[1] NA                  "Species Plantarum"

> tax_cite(x)[1] <- "Cham. et al 1984"
> tax_cite(x)
[1] "Cham. et al 1984"  "Species Plantarum"

tax_date(x)

        设置和获取分类群的日期信息。

> x <- taxon_authority(c('Cham. & Schldl.', 'L.'),
+                      date = c('1827', '1753'))

> tax_date(x)
[1] "1827" "1753"

> tax_date(x)[1] <- "1984"
> tax_date(x) <- c(NA, '1800')
> tax_date(x)
[1] NA     "1800"

tax_db(x)

        设置和获取分类群的数据库信息。

> x <- taxon_id(c('9606', '1386', '4890', '4345'), db = 'ncbi')

> tax_db(x)
<taxon_db[4]>
[1] ncbi ncbi ncbi ncbi

> tax_db(x) <- 'nbn'
> tax_db(x)[2] <- 'itis'
> tax_db(x)
<taxon_db[4]>
[1]  nbn itis  nbn  nbn

tax_id(x)

        设置和获取类群的ID。

> x <- taxon(name = c('Homo sapiens', 'Bacillus', 'Ascomycota', 'Ericaceae'),
+            rank = c('species', 'genus', 'phylum', 'family'),
+            id = taxon_id(c('9606', '1386', '4890', '4345'), db = 'ncbi'),
+            auth = c('Linnaeus, 1758', 'Cohn 1872', NA, 'Juss., 1789'))

> tax_id(x)
<taxon_id[4]>
[1] 9606 (ncbi) 1386 (ncbi) 4890 (ncbi) 4345 (ncbi)

> tax_id(x) <- paste0('00', tax_id(x))
> tax_id(x)[1] <- '00000'
> tax_id(x)
<taxon_id[4]>
[1] 00000  001386 004890 004345

tax_name(x)

        设置和获取分类群名称。

> x <- taxon(name = c('Homo sapiens', 'Bacillus', 'Ascomycota', 'Ericaceae'),
+            rank = c('species', 'genus', 'phylum', 'family'),
+            id = taxon_id(c('9606', '1386', '4890', '4345'), db = 'ncbi'),
+            auth = c('Linnaeus, 1758', 'Cohn 1872', NA, 'Juss., 1789'))

> tax_name(x)
[1] "Homo sapiens" "Bacillus"     "Ascomycota"   "Ericaceae"   

> tax_name(x) <- tolower(tax_name(x))
> tax_name(x)[1] <- 'Billy'
> tax_name(x)
[1] "Billy"      "bacillus"   "ascomycota" "ericaceae"

tax_rank(x)

        设置和获取类群等级。

> x <- taxon(name = c('Homo sapiens', 'Bacillus', 'Ascomycota', 'Ericaceae'),
+            rank = c('species', 'genus', 'phylum', 'family'),
+            id = taxon_id(c('9606', '1386', '4890', '4345'), db = 'ncbi'),
+            auth = c('Linnaeus, 1758', 'Cohn 1872', NA, 'Juss., 1789'))

> tax_rank(x)
<taxon_rank[4]>
[1] species genus   phylum  family 
Rank levels: phylum < family < genus < species

> tax_rank(x) <- 'species'
> tax_rank(x)[1] <- taxon_rank('family')
> tax_rank(x)
<taxon_rank[4]>
[1] family  species species species
Rank levels: family < species

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-24 12:26:01       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-24 12:26:01       106 阅读
  3. 在Django里面运行非项目文件

    2024-01-24 12:26:01       87 阅读
  4. Python语言-面向对象

    2024-01-24 12:26:01       96 阅读

热门阅读

  1. 计算机网络中的网络地址转换

    2024-01-24 12:26:01       54 阅读
  2. 第8章-网络设备文件管理

    2024-01-24 12:26:01       52 阅读
  3. 27.【TypeScript 教程】迭代器(Iterator)

    2024-01-24 12:26:01       56 阅读
  4. php正则电话号

    2024-01-24 12:26:01       57 阅读
  5. NLP自然语言介绍

    2024-01-24 12:26:01       57 阅读
  6. CSS的书写位置

    2024-01-24 12:26:01       63 阅读
  7. 编程笔记 html5&css&js 055 CSS颜色表

    2024-01-24 12:26:01       50 阅读
  8. 基于easyswoole开发的聊天室

    2024-01-24 12:26:01       48 阅读
  9. 【Docker】Docker学习⑥ - 网络部分

    2024-01-24 12:26:01       36 阅读
  10. leetcode-相交链表

    2024-01-24 12:26:01       57 阅读