1
NCBI SRA 데이터베이스에 액세스하려고 시도하고 ID 목록을 쿼리하여 출력을 행렬에 저장하려고합니다.출력을 행렬에 저장
Bioconductor의 sradb 패키지를 사용하여 데이터베이스에 액세스하고 쿼리 할 수 있지만 실제로는 느리고 나는 루프 출력을 저장하는 방법을 알 수 없습니다.
파일 GPL11154_GSMs.txt 내가 관심이있는 ID를 포함 그리고는 다음과 같습니다.
GSM616127
GSM616128
GSM616129
GSM663427
GSM665037
는 내가 가지고 지금 모든 반복에 결과를 업데이트합니다.
#source("https://bioconductor.org/biocLite.R")
#biocLite("SRAdb")
library(SRAdb)
#connect to databasse
sqlfile <- getSRAdbFile()
sra_con <- dbConnect(SQLite(),sqlfile)
## lists all the tables in the SQLite database
sra_tables <- dbListTables(sra_con)
sra_tables
dbGetQuery(sra_con,'PRAGMA TABLE_INFO(study)')
## checking the structure of the tables
#dbListFields(sra_con,"experiment")
#dbListFields(sra_con,"run")
#read in file with sample IDs per platform
x <- scan("GPL11154_GSMs.txt", what="", sep="\n")
gsm_list <- strsplit(x, "[[:space:]]+") # Separate elements by one or more whitepace
for (gsm in gsm_list){
gsm_to_srr <- getSRA(search_terms = gsm, out_types = c("submission", "study", "sample","experiment", "run"), sra_con)
print(gsm_to_srr)
}
예, res.df = as.data.frame (do.call (rbind, res))을 변환 한 다음 저장했습니다. 그것은 완벽하게 작동했습니다. 감사 – MenieM