Entering edit mode
I am receiving the below error when running tximport for DEseq2:
Error in .local(object, ...) :
None of the transcripts in the quantification files are present
in the first column of tx2gene. Check to see that you are using
the same annotation for both.
Below is the code I am using:
samples <- read.table("samples.txt", header=TRUE)
files <- file.path(samples$Sample, "quant.sf")
file.exists(files)
txdb <- makeTxDbFromGFF(file="gencode.v44.long_noncoding_RNAs.gtf.gz")
k <- keys(txdb, keytype = "TXNAME")
tx2gene <- select(txdb, k, "GENEID", "TXNAME")
txi <- tximport(files, type="salmon", tx2gene=tx2gene, ignoreTxVersion=TRUE)
I have already confirmed that the annotation is the same for both and have also run with ignoreTxVersion = TRUE. Unfortunately the quant files are formatted like below and I can't find a simple solution to fix the issue. I know I somehow need to edit the name column to remove everything after the first | but I have over 200 quant files and I can't do it manually very efficiently. Does anyone have any suggestions??
Quant file format:
Name Length EffectiveLength TPM NumReads
ENST00000456328.2|ENSG00000290825.1|-|OTTHUMT00000362751.1|DDX11L2-202|DDX11L2|1657| 1657 1473.695 30.839887 199.500
ENST00000473358.1|ENSG00000243485.5|OTTHUMG00000000959.2|OTTHUMT00000002840.1|MIR1302-2HG-202|MIR1302-2HG|712| 712 434.000 0.000000 0.000
tx2gene format:
TXNAME GENEID
1 ENST00000456328.2 ENSG00000290825.1
2 ENST00000473358.1 ENSG00000243485.5
Thank you!!
Also, you don't want to use
ignoreTxVersion
, since both yourtx2gene
and your quant files have versions!If this is GENCODE, also they can just use tximeta, which does everything for you.