Skip to content
Snippets Groups Projects
Commit 0cebbcb3 authored by Holger Brandl's avatar Holger Brandl
Browse files

cont star integration

parent cebd3cb7
No related branches found
No related tags found
No related merge requests found
......@@ -430,3 +430,29 @@ dge_create_star_index(){
mailme "created star index for $igenome"
}
export -f dge_create_star_index
dge_star_counts2matrix(){
echo '
devtools::source_url("https://raw.githubusercontent.com/holgerbrandl/datautils/v1.13/R/core_commons.R")
## STAR count file format is
#column 1: gene ID
#column 2: counts for unstranded RNA-seq
#column 3: counts for the 1st read strand aligned with RNA (htseq-count option -s yes)
exprCounts <- list.files(".", "ReadsPerGene.out.tab") %>% ldply(function(countFile){
read.delim(countFile, header=F) %>%
select(V1, V2) %>%
set_names("gene_id", "num_alignments") %>%
filter(!str_detect(gene_id, "^N_")) %>%
mutate(sample=trim_ext(countFile, ".ReadsPerGene.out.tab"))
}, .progress="text")
countMatrix <- spread(exprCounts, sample, num_alignments)
write.delim(countMatrix, "star_count_matrix.txt")
' | R --vanilla -q
}
export -f dge_star_counts2matrix
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment