How to use txtimport and do differential expression
1
0
Entering edit mode
@914a6e23
Last seen 17 months ago
Ecuador

Hi, I want to do an analysiss about difeferential expression, I have the code #Coniene dos columnas: el id de las secuencias y la condicion en la que fue obtenida cada una (cancer y tratados) setwd("C:/Users/ACER/Documents/MAESTRIA BIOLOGIA COMPUTACIONAL/PROYECTO FINAL/Datos/leucemia_sin tratar_tratados_modelo_animal_cuantificación") getwd() data <- read.csv('Libro1.csv', header = TRUE, sep = "\t") data

LECTURA DE LAS CONTEOS

EN LA VARIABLE dir SE ESCRIBIRA EL DIRECTORIO DONDE SE ENCUENTRAN LOS OUTPUTS DE KALLISTO

HAY QUE RECORDAR QUE KALLISTO GENERA UNA CARPETA INDIVIDUAL POR CADA SECUENCIA

CON list.files VAMOS A OBSERVAR QUE dir CONTIEN CARPETAS

dir <- "C:/Users/ACER/Documents/MAESTRIA BIOLOGIA COMPUTACIONAL/PROYECTO FINAL/Datos/leucemia_sin tratar_tratados_modelo_animal_cuantificación" list.files(dir)

PARA INGRESAR A CADA UNA DE LAS CARPETAS DE OUTPUTKALLISTO, VAMOS A CREAR UN VECTOR CON EL NOMBRE DE CADA CARPETA

folder_list <- c("output_directory_modelo_animal_1", "output_directory_modelo_animal_10", "output_directory_modelo_animal_2", "output_directory_modelo_animal_3", "output_directory_modelo_animal_4", "output_directory_modelo_animal_5", "output_directory_modelo_animal_6", "output_directory_modelo_animal_7", "output_directory_modelo_animal_8", "output_directory_modelo_animal_9", "output_directory_tratado_muestra1", "output_directory_tratado_muestra10", "output_directory_tratado_muestra2", "output_directory_tratado_muestra3", "output_directory_tratado_muestra4", "output_directory_tratado_muestra5", "output_directory_tratado_muestra6", "output_directory_tratado_muestra7", "output_directory_tratado_muestra8", "output_directory_tratado_muestra9", "output_kallisto_segmento_1", "output_kallisto_segmento_10", "output_kallisto_segmento_2", "output_kallisto_segmento_3", "output_kallisto_segmento_5", "output_kallisto_segmento_6", "output_kallisto_segmento_7", "output_kallisto_segmento_8", "output_kallisto_segmento_9")

LECTURA DE LOS ARCHIVOS abundance.tsv

files <- file.path(dir, "abundance.tsv") #directorio, nombre de las carpetas, nombre del archivo a leer

Directorio raíz

root_dir <- "C:/Users/ACER/Documents/MAESTRIA BIOLOGIA COMPUTACIONAL/PROYECTO FINAL/Datos/leucemia_sin tratar_tratados_modelo_animal_cuantificación"

IDENTIFICACION DE LOS TRANSCRITOS

los transcritos deben asociarse con sus IDs, human (GRCh38p12 v28)

tx2gene <- transcripts(EnsDb.Hsapiens.v86, columns=c("tx_id", "gene_name")) tx2gene <- as.tibble(tx2gene)

tx2gene <- dplyr::rename(tx2gene, target_id=tx_id)

tx2gene <- dplyr::select(tx2gene, "target_id", "gene_name")

head(tx2gene)

Crear la matriz con tximport

txi_gene <- tximport(files, type = "kallisto", tx2gene = tx2gene, countsFromAbundance = "lengthScaledTPM",ignoreAfterBar = TRUE, ignoreTxVersion=TRUE)

txi_transcript <- tximport(files, type = "kallisto", tx2gene = tx2gene, txOut = TRUE, countsFromAbundance = "lengthScaledTPM", ignoreTxVersion=TRUE), but when i want to do it, I have problems to read abundace.tsv, also I have problems to download and install EnsDb.Hsapiens.v86, anda I want to resolve this as soon as possible i do not know what it is wrong. ```

NewWave • 558 views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 1 day ago
United States

I think you probably need something like this

files <- paste(dir,  folder_list, "abundance.tsv", sep = "/")
## or better yet
files <- paste(dir, folder_list, "abundance.h5", sep = "/")
## and use the HDF5 reader instead, which will be much faster.

Do you really need a v86 EnsDb package? That's pretty old. Anyway, you can get all the EnsDb packages from v87 on up from the AnnotationHub

library(AnnotationHub)
hub <- AnnotationHub()
query(hub, c("ensdb","homo sapiens"))
ensdb <- hub[["AH53211"]]

I sort of doubt you need v86 or even v87. It's more likely that your data were aligned to a version in the 90s or 100s.

ADD COMMENT

Login before adding your answer.

Traffic: 405 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6