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
ad70d502
Commit
ad70d502
authored
9 years ago
by
Holger Brandl
Browse files
Options
Downloads
Patches
Plain Diff
cont pe-aligner wrapper
parent
53b1a7a1
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
dge_workflow/star_align.kts
+11
-17
11 additions, 17 deletions
dge_workflow/star_align.kts
with
11 additions
and
17 deletions
dge_workflow/star_align.kts
+
11
−
17
View file @
ad70d502
#
!/
usr
/
bin
/
env
kscript
//DEPS org.docopt:docopt:0.6.0-SNAPSHOT de.mpicbg.scicomp:joblist:0.6-SNAPSHOT de.mpicbg.scicomp.bioinfo:kutils:0.1-SNAPSHOT
//DEPS org.docopt:docopt:0.6.0-SNAPSHOT de.mpicbg.scicomp:joblist
_2.11
:0.6-SNAPSHOT de.mpicbg.scicomp.bioinfo:kutils:0.1-SNAPSHOT
// add docopts to local m2 index
// git clone https://github.com/docopt/docopt.java && cd docopt.java && mvn clean package install -Dmaven.test.skip=true
// kotlinc-jvm -classpath $(mvncp org.docopt:docopt:0.6.0-SNAPSHOT)
// update joblist
// cd ~/mnt/mack/bioinfo/holger/misc/Dropbox/cluster_sync/joblist/
import
joblist.JobConfiguration
import
joblist.JobList
import
kutils.bashEval
import
org.docopt.Docopt
import
java.io.File
import
java.util.*
//val args = listOf("/projects/bioinfo/igenomes/Drosophila_melanogaster/Ensembl/BDGP6", "test.fastq.gz")
// basic usage tutorial
// http://www.homolog.us/blogs/blog/2012/11/02/star-really-kick-ass-rna-seq-aligner/
// https://www.biostars.org/p/91020/
val
usage
=
"""
...
...
@@ -30,37 +23,38 @@ Use star to align fastq files against a genome
Usage: star_align.sh [options] <igenome> <fastq_files>...
Options:
--gtf <gtfFile> Custom gtf file instead of igenome bundled copy
--pc-only Use protein coding genes only for mapping and quantification
--gtf <gtfFile> Custom gtf file instead of igenome bundled copy
--pc-only Use protein coding genes only for mapping and quantification
"""
val
doArgs
=
Docopt
(
usage
).
parse
(
args
.
toList
()).
map
{
it
.
key
.
removePrefix
(
"--"
).
replace
(
"[<>]"
,
""
)
to
it
.
value
?.
toString
()
}.
toMap
()
println
(
Objects
.
toString
(
1
))
println
(
Objects
.
nonNull
(
true
))
// extract all configuration parameters
val
fastqFiles
=
(
doArgs
[
"fastq_files"
]
as
String
).
split
(
" "
).
map
{
File
(
it
)
}
val
igenome
=
File
(
doArgs
[
"igenome"
])
val
star_index
=
File
(
igenome
,
"Sequence/StarIndex"
)
val
gtfFile
=
if
(
doArgs
[
"gtfFile"
]
!=
null
)
File
(
doArgs
[
"gtfFile"
])
else
File
(
igenome
,
"Annotation/Genes/genes.gtf"
)
// check if gtf file exists
if
(!
gtfFile
.
isFile
())
throw
IllegalArgumentException
(
"gtf '${gtfFile}' does not exist"
)
// make sure that STAR is in the PATH
if
(
bashEval
(
"which STAR"
).
exitCode
!=
0
)
throw
IllegalArgumentException
(
"gtf '${gtfFile}' does not exist"
)
if
(
bashEval
(
"which STAR"
).
exitCode
!=
0
)
throw
IllegalArgumentException
(
"STAR aligner is not in PATH"
)
// check if gtf file exists
if
(!
gtfFile
.
isFile
())
throw
IllegalArgumentException
(
"gtf '${gtfFile}' does not exist"
)
// Check if STAR index is not present
if
(!
File
(
"${star_index}/SA"
).
isFile
())
throw
IllegalArgumentException
(
"Missing STAR for ${star_index}/SA; use 'dge_create_star_index ${igenome}' to create it"
)
// dge_create_star_index ${igenome}'
println
(
"running STAR using igenome '${igenome}' for the following files"
)
val
jl
=
JobList
(
".starjobs"
)
...
...
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