-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#Error. Could not read input tissue database. #6
Comments
Hi @hust-yyan can you share the command you are using to run SPrediXcan and the full error log? Also add |
@hust-yyan the beta is the weight. You need the right columns in your weights table in the db.
|
That's not normal. I would advice you to look back at your filtering/QC step if everything worked well. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I recently performed a TWAS study on miRNA expression. After creating the predict database using our miRNA expression and genotype data, we encountered the following error during s-Predixcan analysis.
Here is the code I used to create the Predict database
library(DBI)
library(RSQLite)
"%&%" <- function(a,b) paste(a,b, sep='')
driver <- dbDriver('SQLite')
model_summaries <- read.table('./summary/Model_training_chr1_model_summaries_filter.txt',header = T, stringsAsFactors = F)
tiss_summary <- read.table('./summary/Model_training_chr1_summary.txt', header = T, stringsAsFactors = F)
n_samples <- tiss_summary$n_samples
for (i in 2:22) {
model_summaries <- rbind(model_summaries,
read.table('./summary/Model_training_chr'%&%as.character(i) %&% '_model_summaries_filter.txt', header = T, stringsAsFactors = F))
tiss_summary <- rbind(tiss_summary,
read.table('./summary/Model_training_chr' %&% as.character(i) %&% '_summary.txt', header = T, stringsAsFactors = F))
}
model_summaries <- rename(model_summaries, gene = gene_id)
Create a database connection
conn <- dbConnect(drv = driver, './dbs/miRNA_expression_204.db')
dbWriteTable(conn, 'model_summaries', model_summaries, overwrite = TRUE)
dbExecute(conn, "CREATE INDEX gene_model_summary ON model_summaries (gene)")
Weights Table -----
weights <- read.table('./weights/Model_training_chr1_weights.txt', header = T,stringsAsFactors = F)
for (i in 2:22) {
weights <- rbind(weights,
read.table('./weights/Model_training_chr' %&% as.character(i) %&% '_weights.txt', header = T, stringsAsFactors = F))
}
weights <- rename(weights, gene = gene_id)
dbWriteTable(conn, 'weights', weights, overwrite = TRUE)
dbExecute(conn, "CREATE INDEX weights_rsid ON weights (rsid)")
dbExecute(conn, "CREATE INDEX weights_gene ON weights (gene)")
dbExecute(conn, "CREATE INDEX weights_rsid_gene ON weights (rsid, gene)")
Sample_info Table ----
sample_info <- data.frame(n_samples = n_samples, population = 'EAS') # Provide the population info
dbWriteTable(conn, 'sample_info', sample_info, overwrite = TRUE)
Construction Table ----
construction <- tiss_summary %>%
select(chrom, cv_seed) %>%
rename(chromosome = chrom)
dbWriteTable(conn, 'construction', construction, overwrite = TRUE)
dbDisconnect(conn)
The text was updated successfully, but these errors were encountered: