-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfastqcr.R
54 lines (33 loc) · 1.27 KB
/
fastqcr.R
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
#http://www.sthda.com/english/wiki/fastqcr-an-r-package-facilitating-quality-controls-of-sequencing-data-for-large-numbers-of-samples
devtools::install_github("kassambara/fastqcr")
library("fastqcr")
library(dplyr)
####### RUNNING fastqc
fastqc(fq.dir = "../7_limpieza_demultiplexadas/", # FASTQ files directory
qc.dir = "../fastqcr_output", # Results direcory
threads = 4 # Number of threads
)
# Aggregating Multiple FastQC Reports into a Data Frame
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# Demo QC directory containing zipped FASTQC reports
qc.dir <- ("../fastqcr_output")
qc <- qc_aggregate(qc.dir)
qc
summary(qc)
#general statistics
stats.per.sample<-qc_stats(qc)
View(qc_stats(qc))
#################
dim(stats.per.sample)
n = 330 # n toma la dimension de rows
R2 = c() # Se crea un vector vacío
R1 = c() # Idem
for(i in 1:n){ # Se van a procesar los números de 1 a n
if(i%%2==0) R2<-c(R2,i) # Si al dividir por 2 sale 0
else R1<-c(R1,i)} # el numero es par, impar en otro caso
R2
R1
stats.per.sample.r1<- stats.per.sample[R1 , ]
stats.per.sample.r1
View(stats.per.sample.r1)
write.csv(stats.per.sample.r1, "../2clean.stats.per.sample.r1.csv", col.names = TRUE, row.names = TRUE)