Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
RNA-seq
Manage
Activity
Members
Labels
Plan
Issues
12
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
GUDMAP_RBK
RNA-seq
Commits
d5c23e26
Commit
d5c23e26
authored
4 years ago
by
Gervaise Henry
Browse files
Options
Downloads
Patches
Plain Diff
Update tpm table
#73
parent
64c587de
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!43
Develop
,
!42
0.0.3
Pipeline
#7989
failed with stages
in 1 minute and 48 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
workflow/rna-seq.nf
+2
-2
2 additions, 2 deletions
workflow/rna-seq.nf
workflow/scripts/calculateTPM.R
+5
-2
5 additions, 2 deletions
workflow/scripts/calculateTPM.R
workflow/scripts/convertGeneSymbols.R
+6
-4
6 additions, 4 deletions
workflow/scripts/convertGeneSymbols.R
with
13 additions
and
8 deletions
workflow/rna-seq.nf
+
2
−
2
View file @
d5c23e26
...
...
@@ -875,10 +875,10 @@ process countData {
echo -e "LOG: counting ${ends} features" >> ${repRID}.countData.log
if [ "${ends}" == "se" ]
then
featureCounts -T `nproc` -a ./genome.gtf -G ./genome.fna -g 'gene_name' -o ${repRID}.countData -s \${stranding} -R SAM --primary --ignoreDup ${repRID}.sorted.deduped.bam
featureCounts -T `nproc` -a ./genome.gtf -G ./genome.fna -g 'gene_name'
--extraAttributes 'gene_id'
-o ${repRID}.countData -s \${stranding} -R SAM --primary --ignoreDup ${repRID}.sorted.deduped.bam
elif [ "${ends}" == "pe" ]
then
featureCounts -T `nproc` -a ./genome.gtf -G ./genome.fna -g 'gene_name' -o ${repRID}.countData -s \${stranding} -p -B -R SAM --primary --ignoreDup ${repRID}.sorted.deduped.bam
featureCounts -T `nproc` -a ./genome.gtf -G ./genome.fna -g 'gene_name'
--extraAttributes 'gene_id'
-o ${repRID}.countData -s \${stranding} -p -B -R SAM --primary --ignoreDup ${repRID}.sorted.deduped.bam
fi
echo -e "LOG: counted" >> ${repRID}.countData.log
...
...
This diff is collapsed.
Click to expand it.
workflow/scripts/calculateTPM.R
+
5
−
2
View file @
d5c23e26
...
...
@@ -13,10 +13,13 @@ if (!("count" %in% names(opt))){
stop
(
"Count file doesn't exist, exiting."
)
}
repRID
<-
basename
(
gsub
(
".
featureCounts
"
,
""
,
opt
$
count
))
repRID
<-
basename
(
gsub
(
".
countData
"
,
""
,
opt
$
count
))
count
<-
read.delim
(
opt
$
count
,
comment.char
=
"#"
)
# if featureCounts file changes structure, be sure to update count and Length columns below
colnames
(
count
)[
7
]
<-
"count"
colnames
(
count
)[
1
]
<-
"gene_name"
colnames
(
count
)[
7
]
<-
"gene_id"
colnames
(
count
)[
8
]
<-
"count"
count
<-
count
[,
c
(
1
,
7
,
2
:
6
,
8
)]
rpk
<-
count
$
count
/
count
$
Length
/
1000
...
...
This diff is collapsed.
Click to expand it.
workflow/scripts/convertGeneSymbols.R
+
6
−
4
View file @
d5c23e26
...
...
@@ -7,18 +7,20 @@ option_list=list(
opt
=
parse_args
(
OptionParser
(
option_list
=
option_list
))
rm
(
option_list
)
countTable
<-
read.csv
(
paste0
(
opt
$
repRID
,
".
countData.
countTable.csv"
),
stringsAsFactors
=
FALSE
)
countTable
<-
read.csv
(
paste0
(
opt
$
repRID
,
".countTable.csv"
),
stringsAsFactors
=
FALSE
)
geneID
<-
read.delim
(
"geneID.tsv"
,
header
=
FALSE
,
stringsAsFactors
=
FALSE
)
Entrez
<-
read.delim
(
"Entrez.tsv"
,
header
=
FALSE
,
stringsAsFactors
=
FALSE
)
convert
<-
data.frame
(
gene
ID
=
countTable
$
G
ene
id
)
convert
<-
merge
(
x
=
convert
,
y
=
geneID
[,
1
:
2
],
by.x
=
"gene
ID
"
,
by.y
=
"V2"
,
all.x
=
TRUE
)
convert
<-
data.frame
(
gene
_name
=
countTable
$
g
ene
_name
)
convert
<-
merge
(
x
=
convert
,
y
=
geneID
[,
1
:
2
],
by.x
=
"gene
_name
"
,
by.y
=
"V2"
,
all.x
=
TRUE
)
convert
<-
merge
(
x
=
convert
,
y
=
Entrez
,
by.x
=
"V1"
,
by.y
=
"V1"
,
all.x
=
TRUE
)
convert
[
is.na
(
convert
$
V2
),
3
]
<-
""
convert
<-
convert
[,
-1
]
colnames
(
convert
)
<-
c
(
"GeneID"
,
"EntrezID"
)
convert
<-
unique
(
convert
)
output
<-
merge
(
x
=
convert
,
y
=
countTable
[,
c
(
"Geneid"
,
"count"
,
"tpm"
)],
by.x
=
"GeneID"
,
by.y
=
"Geneid"
,
all.x
=
TRUE
)
output
<-
merge
(
x
=
convert
,
y
=
countTable
[,
c
(
"gene_name"
,
"gene_id"
,
"count"
,
"tpm"
)],
by.x
=
"GeneID"
,
by.y
=
"gene_name"
,
all.x
=
TRUE
)
colnames
(
output
)
<-
c
(
"GENCODE_Gene_Symbol"
,
"NCBI_GeneID"
,
"Ensembl_GeneID"
,
"count"
,
"tpm"
)
output
<-
output
[,
c
(
1
,
3
,
2
,
4
:
5
)]
write.table
(
output
,
file
=
paste0
(
opt
$
repRID
,
".tpmTable.csv"
),
sep
=
","
,
row.names
=
FALSE
,
quote
=
FALSE
)
This diff is collapsed.
Click to expand it.
Preview
0%
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