Commit 462a1cc4 authored by domingue's avatar domingue

Merge branch 'master' of https://git.mpi-cbg.de/bioinfo/ngs_tools

Update code from gitlab
parents 8cff60f6 9c0a92d1
......@@ -121,10 +121,10 @@ libSizes <- read_tsv("algn_counts.txt", col_names=F) %>% set_names(c("library_si
libSizes %>% ggplot(aes(sample, library_size)) +
geom_bar(stat="identity") +
scale_y_continuous(labels=comma) +
ggtitle("# alignments") +
ggtitle("number of alignments") +
coord_flip()
ggsave2()
ggsave("lib_size.pdf")
' | R -q --vanilla
}
export -f cs_lib_size
......
......@@ -42,7 +42,7 @@ Options:
--gene_info <info_file> Gene information file downloaded from the ensembl website if bioMart version is not present
--betaprior <boolean> Apply betaprior when running DESeq2 [default: TRUE]
--sub_data <boolean> Subset de_results by contrasts and store the data in a subfolder [default: FALSE]
--gtf <gtf_file> Path to a GTF file, preferably the same used for read counting.
--gtf <gtf_file> Path to a GTF file, preferably the same used for read counting.
'
#commandArgs <- function(x) c("--design", "'batch+condition'", "--contrasts", "../contrasts.txt star_counts_matrix_reduced_sampleset.txt", "basic_design_reduced_sampleset.txt")
......@@ -675,26 +675,26 @@ select <- dplyr::select
## import gtf
# if(!file.exists(gene.model)) stop(paste("GTF File:", gene.model, " does NOT exist. Run with: \n", runstr))
gtf <- import.gff(
gtf_file,
format = "gtf",
feature.type = "exon"
)
txdb <- makeTxDbFromGRanges(gtf)
exons <- exonsBy(
txdb,
by = "gene"
)
genes <- genes(txdb) ## genomic coordinates of genes
## after filtering only a subset of genes remains
## genes in the GRangesList must match the number of genes in dds
exons <- exons[names(exons) %in% rownames(assay(dds))]
rowRanges(dds) <- exons
if(!is.null(gtf_file)){
gtf <- import.gff(
gtf_file,
format = "gtf",
feature.type = "exon"
)
txdb <- makeTxDbFromGRanges(gtf)
exons <- exonsBy(
txdb,
by = "gene"
)
genes <- genes(txdb) ## genomic coordinates of genes
## after filtering only a subset of genes remains
## genes in the GRangesList must match the number of genes in dds
exons <- exons[names(exons) %in% rownames(assay(dds))]
rowRanges(dds) <- exons
}
# Load transcriptome annotations needed for results annotation
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment