Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
biopet.biopet
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD 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
Mirrors
biopet.biopet
Commits
ea4e9d7e
Commit
ea4e9d7e
authored
9 years ago
by
Sander Bollen
Browse files
Options
Downloads
Patches
Plain Diff
fixing SageCreateLibrary
parent
cfcd6e0e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/SageCreateLibrary.scala
+6
-7
6 additions, 7 deletions
...n/scala/nl/lumc/sasc/biopet/tools/SageCreateLibrary.scala
with
6 additions
and
7 deletions
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/SageCreateLibrary.scala
+
6
−
7
View file @
ea4e9d7e
...
...
@@ -77,10 +77,10 @@ object SageCreateLibrary extends ToolCommand {
opt
[
Int
](
"length"
)
required
()
unbounded
()
action
{
(
x
,
c
)
=>
c
.
copy
(
length
=
x
)
}
opt
[
File
](
"noTagsOutput"
)
required
()
unbounded
()
valueName
"<file>"
action
{
(
x
,
c
)
=>
opt
[
File
](
"noTagsOutput"
)
unbounded
()
valueName
"<file>"
action
{
(
x
,
c
)
=>
c
.
copy
(
noTagsOutput
=
x
)
}
opt
[
File
](
"noAntiTagsOutput"
)
required
()
unbounded
()
valueName
"<file>"
action
{
(
x
,
c
)
=>
opt
[
File
](
"noAntiTagsOutput"
)
unbounded
()
valueName
"<file>"
action
{
(
x
,
c
)
=>
c
.
copy
(
noAntiTagsOutput
=
x
)
}
opt
[
File
](
"allGenesOutput"
)
unbounded
()
valueName
"<file>"
action
{
(
x
,
c
)
=>
...
...
@@ -121,7 +121,8 @@ object SageCreateLibrary extends ToolCommand {
val
reader
=
FastaReaderHelper
.
readFastaDNASequence
(
commandArgs
.
input
)
System
.
err
.
println
(
"Finding tags"
)
for
((
name
,
seq
)
<-
reader
)
{
getTags
(
name
,
seq
)
val
result
=
getTags
(
name
,
seq
,
tagRegex
)
addTagresultToTaglib
(
name
,
result
)
count
+=
1
if
(
count
%
10000
==
0
)
System
.
err
.
println
(
count
+
" transcripts done"
)
}
...
...
@@ -167,7 +168,7 @@ object SageCreateLibrary extends ToolCommand {
}
}
def
addTagresultToTaglib
(
name
:
String
,
tagResult
:
TagResult
)
{
private
def
addTagresultToTaglib
(
name
:
String
,
tagResult
:
TagResult
)
{
val
id
=
name
.
split
(
" "
).
head
//.stripPrefix("hg19_ensGene_")
val
geneID
=
geneRegex
.
findFirstIn
(
name
).
getOrElse
(
"unknown_gene"
)
allGenes
.
add
(
geneID
)
...
...
@@ -195,15 +196,13 @@ object SageCreateLibrary extends ToolCommand {
}
}
def
getTags
(
name
:
String
,
seq
:
DNASequence
)
:
TagResult
=
{
def
getTags
(
name
:
String
,
seq
:
DNASequence
,
tagRegex
:
Regex
)
:
TagResult
=
{
val
allTags
:
List
[
String
]
=
for
(
tag
<-
tagRegex
.
findAllMatchIn
(
seq
.
getSequenceAsString
).
toList
)
yield
tag
.
toString
()
val
firstTag
=
if
(
allTags
.
isEmpty
)
null
else
allTags
.
last
val
allAntiTags
:
List
[
String
]
=
for
(
tag
<-
tagRegex
.
findAllMatchIn
(
seq
.
getReverseComplement
.
getSequenceAsString
).
toList
)
yield
tag
.
toString
()
val
firstAntiTag
=
if
(
allAntiTags
.
isEmpty
)
null
else
allAntiTags
.
head
val
result
=
new
TagResult
(
firstTag
,
allTags
,
firstAntiTag
,
allAntiTags
)
addTagresultToTaglib
(
name
,
result
)
result
}
}
\ No newline at end of file
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