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
3c07f87a
Commit
3c07f87a
authored
10 years ago
by
Holger Brandl
Browse files
Options
Downloads
Patches
Plain Diff
added expression filter clustering
parent
bf215324
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/dge_analysis.R
+29
-17
29 additions, 17 deletions
dge_workflow/dge_analysis.R
with
29 additions
and
17 deletions
dge_workflow/dge_analysis.R
+
29
−
17
View file @
3c07f87a
...
@@ -70,9 +70,9 @@ runInfo(cuff)
...
@@ -70,9 +70,9 @@ runInfo(cuff)
replicateInfo
<-
replicates
(
cuff
)
%>%
mutate
(
file
=
basename
(
file
))
%>%
select
(
-
c
(
total_mass
,
norm_mass
,
internal_scale
,
external_scale
))
replicateInfo
<-
replicates
(
cuff
)
%>%
mutate
(
file
=
basename
(
file
))
%>%
select
(
-
c
(
total_mass
,
norm_mass
,
internal_scale
,
external_scale
))
replicateInfo
replicateInfo
write.delim
(
replicateInfo
,
file
=
"replicate
I
nfo.txt"
)
write.delim
(
replicateInfo
,
file
=
"replicate
_i
nfo.txt"
)
# replicateInfo <- read.delim("replicate
I
nfo.txt")
# replicateInfo <- read.delim("replicate
_i
nfo.txt")
#' [replicateInfo](replicate
I
nfo.txt)
#' [replicateInfo](replicate
_i
nfo.txt)
#+ eval=skipQC
#+ eval=skipQC
#hello hidden field
#hello hidden field
...
@@ -117,27 +117,20 @@ repFpkmMatrix(genes(cuff)) %>%
...
@@ -117,27 +117,20 @@ repFpkmMatrix(genes(cuff)) %>%
# gene_fpkms <- read.delim("gene_fpkms_by_replicate.txt")
# gene_fpkms <- read.delim("gene_fpkms_by_replicate.txt")
#' [Annotated Expresssion Table](gene_fpkms_by_replicate.txt)
#' [Annotated Expresssion Table](gene_fpkms_by_replicate.txt)
fpkm
(
genes
(
cuff
))
%>%
dplyr
::
rename
(
ensembl_gene_id
=
gene_id
)
%>%
merge
(
geneInfo
,
by
=
"ensembl_gene_id"
,
all.x
=
T
)
%>%
write.delim
(
file
=
"geneFpkm.txt"
)
## also export count tables
## also export count tables
countMatrix
(
genes
(
cuff
))
%>%
count
(
genes
(
cuff
))
%>%
rownames2column
(
"ensembl_gene_id"
)
%>%
dplyr
::
rename
(
ensembl_gene_id
=
gene_id
)
%>%
merge
(
geneInfo
,
by
=
"ensembl_gene_id"
,
all.x
=
T
)
%>%
merge
(
geneInfo
,
by
=
"ensembl_gene_id"
,
all.x
=
T
)
%>%
write.delim
(
file
=
"gene_counts.txt"
)
write.delim
(
file
=
"gene_counts.txt"
)
# gene_counts <- read.delim("gene_counts.txt")
#' [Gene Fragment Counts](gene_counts.txt)
countMatrix
(
genes
(
cuff
))
%>%
#' [Gene Counts](gene_counts.txt)
repCountMatrix
(
genes
(
cuff
))
%>%
rownames2column
(
"ensembl_gene_id"
)
%>%
rownames2column
(
"ensembl_gene_id"
)
%>%
merge
(
geneInfo
,
by
=
"ensembl_gene_id"
,
all.x
=
T
)
%>%
merge
(
geneInfo
,
by
=
"ensembl_gene_id"
,
all.x
=
T
)
%>%
write.delim
(
file
=
"replicate
Counts
.txt"
)
write.delim
(
file
=
"
gene_counts_by_
replicate.txt"
)
# repCounts <- read.delim("replicateCounts.txt")
# repCounts <- read.delim("replicateCounts.txt")
#' [
Raw
Counts by Replicate](replicateCounts.txt)
#' [
Gene
Counts by Replicate](replicateCounts.txt)
##ggplot(geneFpkm, aes(fpkm)) + geom_histogram() + scale_x_log10()
##ggplot(geneFpkm, aes(fpkm)) + geom_histogram() + scale_x_log10()
...
@@ -205,6 +198,25 @@ csDendro(genes(cuff),replicates=T)
...
@@ -205,6 +198,25 @@ csDendro(genes(cuff),replicates=T)
#dev.off()
#dev.off()
#' Also cluster expression filtered data
exprGenes
<-
repFpkmMatrix
(
genes
(
cuff
))
%>%
rownames2column
(
"ensembl_gene_id"
)
%>%
melt
(
value.name
=
"fpkm"
)
%>%
group_by
(
ensembl_gene_id
)
%>%
## apply log trafo
mutate
(
log_fpkm
=
log10
(
fpkm
+1
))
%>%
## apply expression filter
filter
(
max
(
log_fpkm
)
>
1
)
%>%
dcast
(
ensembl_gene_id
~
variable
,
value.var
=
"log_fpkm"
)
%>%
column2rownames
(
"ensembl_gene_id"
)
res
<-
JSdist
(
makeprobs
(
exprGenes
))
%>%
hclust
()
%>%
as.dendrogram
()
par
(
mar
=
c
(
10
,
4
,
4
,
4
))
plot
(
res
,
main
=
"Replicate Clustering of Expressed Genes"
)
#######################################################################################################################
#######################################################################################################################
#' ## Extract lists of differentially expressed genes
#' ## Extract lists of differentially expressed genes
...
...
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