Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
ngs_tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bioinfo
ngs_tools
Commits
aea6b362
Commit
aea6b362
authored
8 years ago
by
Holger Brandl
Browse files
Options
Downloads
Patches
Plain Diff
deseq workflow cosmetics
parent
5b9dc042
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dge_workflow/featcounts_deseq_mf.R
+8
-7
8 additions, 7 deletions
dge_workflow/featcounts_deseq_mf.R
with
8 additions
and
7 deletions
dge_workflow/featcounts_deseq_mf.R
+
8
−
7
View file @
aea6b362
...
...
@@ -39,7 +39,7 @@ count_matrix_file <- opts$count_matrix
design_matrix_file
<-
opts
$
design_matrix
contrasts_file
<-
opts
$
contrasts
resultsBase
<-
if
(
str_length
(
opts
$
out
)
>
0
)
paste0
(
opts
$
out
prefix
,
"."
)
else
""
resultsBase
<-
if
(
str_length
(
opts
$
out
)
>
0
)
paste0
(
opts
$
out
,
"."
)
else
""
pcutoff
<-
if
(
is.null
(
opts
$
pcutoff
))
NULL
else
as.numeric
(
opts
$
pcutoff
)
qcutoff
<-
if
(
is.numeric
(
pcutoff
))
NULL
else
as.numeric
(
opts
$
qcutoff
)
...
...
@@ -49,7 +49,7 @@ if(is.numeric(pcutoff)) opts$qcutoff <- NULL
designFormula
<-
opts
$
design
## consider last element of design formula as sample attribute
contrastAttribute
<-
str_split
(
designFormula
,
"[+]"
)
%>%
unlist
()
%>%
tail
(
1
)
assert
(
designFormula
!
=
"sample"
&&
!
is.null
(
design_matrix_file
),
"custom designs are not supported without a design matrix"
)
assert
(
designFormula
=
=
"sample"
||
!
is.null
(
design_matrix_file
),
"custom designs are not supported without a design matrix"
)
#' # Differential Expression Analysis
...
...
@@ -434,7 +434,7 @@ geneInfo <- quote({
})
%>%
cache_it
(
"geneInfo"
)
## save as reference for downstream analysis
write_tsv
(
geneInfo
,
path
=
"geneInfo.txt"
)
write_tsv
(
geneInfo
,
path
=
paste0
(
resultsBase
,
"geneInfo.txt"
)
)
#' Export counts per replicate as double-normalized FPKMs=(read_count * 10^9)/(gene_length * library_size)
...
...
@@ -450,10 +450,11 @@ fpkms <- countMatrix %>%
#fpkms %>% ggplot(aes(fpkm)) + geom_histogram() + scale_x_log10(labels=comma)
write_tsv
(
fpkms
,
"fpkms_by_replicate.long.txt"
)
write_tsv
(
fpkms
,
paste0
(
resultsBase
,
"fpkms_by_replicate.long.txt"
)
)
fpkms
%>%
transmute
(
ensembl_gene_id
,
replicate
,
fpkm
)
%>%
spread
(
replicate
,
fpkm
)
%>%
write_tsv
(
"fpkms_by_replicate.wide.txt"
)
spread
(
replicate
,
fpkm
)
%>%
write_tsv
(
paste0
(
resultsBase
,
"fpkms_by_replicate.wide.txt"
))
#' Also export averaged counts per sample as double-normalized FPKMs=(read_count * 10^9)/(gene_length * library_size)
...
...
@@ -477,10 +478,10 @@ sampleFpkms <- countMatrix %>%
#fpkms %>% ggplot(aes(fpkm)) + geom_histogram() + scale_x_log10(labels=comma)
write_tsv
(
sampleFpkms
,
"fpkms_by_sample.long.txt"
)
write_tsv
(
sampleFpkms
,
paste0
(
resultsBase
,
"fpkms_by_sample.long.txt"
)
)
sampleFpkms
%>%
transmute
(
ensembl_gene_id
,
sample
,
fpkm
)
%>%
spread
(
sample
,
fpkm
)
%>%
write_tsv
(
"fpkms_by_sample.wide.txt"
)
spread
(
sample
,
fpkm
)
%>%
write_tsv
(
paste0
(
resultsBase
,
"fpkms_by_sample.wide.txt"
)
)
#' [FPKMs as table](fpkms.long.txt) [FPKMs as Matrix](fpkms.wide.txt)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment