-
Notifications
You must be signed in to change notification settings - Fork 0
/
get-env-info.qmd
88 lines (59 loc) · 1.5 KB
/
get-env-info.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
title: "Tidy env info"
format: pdf
editor: visual
---
# Load the csv file and tidy the data
```{r}
library(tidyverse)
# Load the csv file
env_info <- read_csv("C:\\Users\\DuYih\\Desktop\\sequence-PVC.csv")
```
```{r}
env_info
```
```{r}
# Tidy the data
env_info %>% group_by(Project, `Isolation Source`) %>%
summarise(count=n())
```
```{r}
env_info %>% group_by(Project) %>%
summarise(count=n())
```
```{r}
env_info %>% filter(Project == "PRJNA39207") %>%
group_by(Project, `Isolation Source`) %>%
summarise(count=n())
```
```{r}
# select the FJ901344 information
env_info %>% filter(Accession == "FJ902144")
head(env_info)
```
```{r}
env_info %>% filter(Project == 'PRJNA38465')
```
```{r}
# 读取CSV文件
file_path <- "C:\\Users\\DuYih\\Desktop\\github\\PVC\\env_abundance.csv"
data <- read.csv(file_path, stringsAsFactors = FALSE)
# 检查是否存在字符 'FJ902375'
exists <- any(grepl("ERP013152", data))
# 输出结果
if (exists) {
print("字符 'FJ902375' 存在于文件中。")
} else {
print("字符 'FJ902375' 不存在于文件中。")
}
```
```{r}
# 读取文件的前几行
file_path <- "C:\\Users\\DuYih\\Desktop\\github\\PVC\\samples.info"
# 使用 read.csv 函数的 nrows 参数读取前几行
num_rows <- 50 # 你想查看的行数
data <- read.csv(file_path, nrows = num_rows)
# 显示数据
print(data)
```
grep -q 'FJ902375' samples-otus.99.metag.minfilter && echo "字符 'FJ902375' 存在于文件中。" || echo "字符 'FJ902375' 不存在于文件中。"